Commit 0e757229 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Check data format dwObjSize in IDirectInputDevice2WImpl_SetDataFormat.

parent 2064181c
...@@ -1094,6 +1094,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat(LPDIRECTINPUTDEVICE8W ifac ...@@ -1094,6 +1094,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat(LPDIRECTINPUTDEVICE8W ifac
_dump_DIDATAFORMAT(df); _dump_DIDATAFORMAT(df);
if (df->dwSize != sizeof(DIDATAFORMAT)) return DIERR_INVALIDPARAM; if (df->dwSize != sizeof(DIDATAFORMAT)) return DIERR_INVALIDPARAM;
if (df->dwObjSize != sizeof(DIOBJECTDATAFORMAT)) return DIERR_INVALIDPARAM;
if (This->acquired) return DIERR_ACQUIRED; if (This->acquired) return DIERR_ACQUIRED;
EnterCriticalSection(&This->crit); EnterCriticalSection(&This->crit);
......
...@@ -4015,7 +4015,6 @@ static void test_simple_joystick(void) ...@@ -4015,7 +4015,6 @@ static void test_simple_joystick(void)
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
dataformat.dwSize = sizeof(DIDATAFORMAT); dataformat.dwSize = sizeof(DIDATAFORMAT);
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat ); hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr ); ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
dataformat.dwObjSize = sizeof(DIOBJECTDATAFORMAT); dataformat.dwObjSize = sizeof(DIOBJECTDATAFORMAT);
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat ); hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment