dinput/tests: Check IDirectInputDevice_EnumObjects error codes.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
740f8dc6d8
commit
ab8e416787
|
@ -1259,6 +1259,8 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(LPDIRECTINPUTDEVICE8A iface,
|
|||
_dump_EnumObjects_flags(dwFlags);
|
||||
TRACE("\n");
|
||||
|
||||
if (!lpCallback) return DIERR_INVALIDPARAM;
|
||||
|
||||
/* Only the fields till dwFFMaxForce are relevant */
|
||||
memset(&ddoi, 0, sizeof(ddoi));
|
||||
ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce);
|
||||
|
@ -1289,6 +1291,8 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface,
|
|||
_dump_EnumObjects_flags(dwFlags);
|
||||
TRACE("\n");
|
||||
|
||||
if (!lpCallback) return DIERR_INVALIDPARAM;
|
||||
|
||||
/* Only the fields till dwFFMaxForce are relevant */
|
||||
memset(&ddoi, 0, sizeof(ddoi));
|
||||
ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEW, dwFFMaxForce);
|
||||
|
|
|
@ -84,6 +84,9 @@ static void test_object_info(IDirectInputDeviceA *device, HWND hwnd)
|
|||
DWORD cnt = 0;
|
||||
DIDEVICEOBJECTDATA buffer[5];
|
||||
|
||||
hr = IDirectInputDevice_EnumObjects(device, NULL, &cnt, DIDFT_ALL);
|
||||
ok(hr == DIERR_INVALIDPARAM, "IDirectInputDevice_EnumObjects returned %08x, expected %08x\n", hr, DIERR_INVALIDPARAM);
|
||||
|
||||
hr = IDirectInputDevice_EnumObjects(device, enum_callback, &cnt, DIDFT_ALL);
|
||||
ok(SUCCEEDED(hr), "EnumObjects() failed: %08x\n", hr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue