dinput: Check data format dwObjSize in IDirectInputDevice2WImpl_SetDataFormat.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-09-23 10:51:34 +02:00 committed by Alexandre Julliard
parent 2064181c1f
commit 0e75722971
2 changed files with 1 additions and 1 deletions

View File

@ -1094,6 +1094,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat(LPDIRECTINPUTDEVICE8W ifac
_dump_DIDATAFORMAT(df);
if (df->dwSize != sizeof(DIDATAFORMAT)) return DIERR_INVALIDPARAM;
if (df->dwObjSize != sizeof(DIOBJECTDATAFORMAT)) return DIERR_INVALIDPARAM;
if (This->acquired) return DIERR_ACQUIRED;
EnterCriticalSection(&This->crit);

View File

@ -4015,7 +4015,6 @@ static void test_simple_joystick(void)
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
dataformat.dwSize = sizeof(DIDATAFORMAT);
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );
todo_wine
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetDataFormat returned: %#x\n", hr );
dataformat.dwObjSize = sizeof(DIOBJECTDATAFORMAT);
hr = IDirectInputDevice8_SetDataFormat( device, &dataformat );