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

dinput/tests: Add test to validate interactions between dinput and raw input devices.

parent 42a9b58b
......@@ -93,6 +93,7 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
};
DIDATAFORMAT df;
HKL hkl, hkl_orig;
UINT prev_raw_devices_count, raw_devices_count;
hkl = activate_keyboard_layout(MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), &hkl_orig);
if (!hkl) return;
......@@ -165,6 +166,22 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
}
keybd_event('Q', 0, KEYEVENTF_KEYUP, 0);
prev_raw_devices_count = 0;
GetRegisteredRawInputDevices(NULL, &prev_raw_devices_count, sizeof(RAWINPUTDEVICE));
ok(prev_raw_devices_count == 0 || broken(prev_raw_devices_count == 1) /* wxppro, w2003std */,
"Unexpected raw devices registered: %d\n", prev_raw_devices_count);
hr = IDirectInputDevice_Acquire(pKeyboard);
ok(SUCCEEDED(hr), "IDirectInputDevice_Acquire() failed: %08x\n", hr);
raw_devices_count = 0;
GetRegisteredRawInputDevices(NULL, &raw_devices_count, sizeof(RAWINPUTDEVICE));
ok(raw_devices_count == prev_raw_devices_count,
"Unexpected raw devices registered: %d\n", raw_devices_count);
hr = IDirectInputDevice_Unacquire(pKeyboard);
ok(SUCCEEDED(hr), "IDirectInputDevice_Unacquire() failed: %08x\n", hr);
if (pKeyboard) IUnknown_Release(pKeyboard);
ActivateKeyboardLayout(hkl_orig, 0);
......
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