Commit bd730a5f authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Check for null handle in GetRawInputData().

parent d32ac5f4
......@@ -281,6 +281,9 @@ UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT *
TRACE("rawinput %p, command %#x, data %p, data_size %p, header_size %u.\n",
rawinput, command, data, data_size, header_size);
if (!ri)
return ~0U;
if (header_size != sizeof(RAWINPUTHEADER))
{
WARN("Invalid structure size %u.\n", header_size);
......
......@@ -1530,6 +1530,16 @@ static void test_GetRawInputDeviceList(void)
ok(odevcount == oret, "expected %d, got %d\n", oret, odevcount);
}
static void test_GetRawInputData(void)
{
UINT size;
UINT ret;
/* Null raw input handle */
ret = GetRawInputData(NULL, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER));
ok(ret == ~0U, "Expect ret %u, got %u\n", ~0U, ret);
}
static void test_key_map(void)
{
HKL kl = GetKeyboardLayout(0);
......@@ -2697,6 +2707,7 @@ START_TEST(input)
test_attach_input();
test_GetKeyState();
test_OemKeyScan();
test_GetRawInputData();
if(pGetMouseMovePointsEx)
test_GetMouseMovePointsEx();
......
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