dinput/tests: Add checks for Acquire/Unacquire.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Alistair Leslie-Hughes 2019-10-07 22:56:06 +00:00 committed by Alexandre Julliard
parent 47ec8ce911
commit 0555209757
1 changed files with 9 additions and 4 deletions

View File

@ -148,15 +148,20 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd)
ok(hr == S_OK && cnt > 0, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt);
mouse_event(MOUSEEVENTF_MOVE, 10, 10, 0, 0);
IDirectInputDevice_Unacquire(pMouse);
hr = IDirectInputDevice_Unacquire(pMouse);
ok(hr == S_OK, "Failed: %08x\n", hr);
cnt = 1;
hr = IDirectInputDevice_GetDeviceData(pMouse, sizeof(mouse_state), &mouse_state, &cnt, 0);
ok(hr == S_OK && cnt > 0, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt);
IDirectInputDevice_Acquire(pMouse);
hr = IDirectInputDevice_Acquire(pMouse);
ok(hr == S_OK, "Failed: %08x\n", hr);
mouse_event(MOUSEEVENTF_MOVE, 10, 10, 0, 0);
IDirectInputDevice_Unacquire(pMouse);
IDirectInputDevice_Acquire(pMouse);
hr = IDirectInputDevice_Unacquire(pMouse);
ok(hr == S_OK, "Failed: %08x\n", hr);
hr = IDirectInputDevice_Acquire(pMouse);
ok(hr == S_OK, "Failed: %08x\n", hr);
cnt = 1;
hr = IDirectInputDevice_GetDeviceData(pMouse, sizeof(mouse_state), &mouse_state, &cnt, 0);
ok(hr == S_OK && cnt > 0, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt);