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

user32/tests: Add more GetRawInputData tests.

parent c8d74874
......@@ -1757,8 +1757,11 @@ static void test_GetRawInputData(void)
UINT ret;
/* Null raw input handle */
SetLastError(0xdeadbeef);
ret = GetRawInputData(NULL, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER));
ok(ret == ~0U, "Expect ret %u, got %u\n", ~0U, ret);
todo_wine
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetRawInputData returned %08x\n", GetLastError());
}
static void test_RegisterRawInputDevices(void)
......@@ -1906,14 +1909,47 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara
* from the first message has been overwritten. */
size = sizeof(ri);
memset(&ri, 0, sizeof(ri));
count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER));
SetLastError(0xdeadbeef);
count = GetRawInputData((HRAWINPUT)lparam, RID_HEADER, &ri, &size, sizeof(RAWINPUTHEADER));
if (iteration == 1)
{
SetLastError(0xdeadbeef);
count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, 0);
ok(count == ~0U, "GetRawInputData succeeded\n");
todo_wine
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08x\n", GetLastError());
SetLastError(0xdeadbeef);
size = 0;
count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER));
ok(count == ~0U, "GetRawInputData succeeded\n");
todo_wine
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetRawInputData returned %08x\n", GetLastError());
SetLastError(0xdeadbeef);
size = sizeof(ri);
count = GetRawInputData((HRAWINPUT)lparam, 0, &ri, &size, sizeof(RAWINPUTHEADER));
ok(count == ~0U, "GetRawInputData succeeded\n");
todo_wine
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08x\n", GetLastError());
SetLastError(0xdeadbeef);
size = sizeof(ri);
count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER));
todo_wine
ok(count == sizeof(ri), "GetRawInputData failed\n");
todo_wine
ok(ri.data.mouse.lLastX == 6, "Unexpected rawinput data: %d\n", ri.data.mouse.lLastX);
ok(GetLastError() == 0xdeadbeef, "GetRawInputData returned %08x\n", GetLastError());
}
else
{
ok(count == ~0U, "GetRawInputData succeeded\n");
todo_wine
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetRawInputData returned %08x\n", GetLastError());
}
return 0;
}
return DefWindowProcA(hwnd, msg, wparam, lparam);
......
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