Commit da8a36c5 authored by Andrey Gusev's avatar Andrey Gusev Committed by Alexandre Julliard

user32: Implement DefRawInputProc.

Used in The Testament of Sherlock Holmes on mouse move.
parent 46740a23
...@@ -649,7 +649,7 @@ UINT WINAPI GetRawInputDeviceInfoA( HANDLE device, UINT command, void *data, UIN ...@@ -649,7 +649,7 @@ UINT WINAPI GetRawInputDeviceInfoA( HANDLE device, UINT command, void *data, UIN
*/ */
LRESULT WINAPI DefRawInputProc( RAWINPUT **data, INT data_count, UINT header_size ) LRESULT WINAPI DefRawInputProc( RAWINPUT **data, INT data_count, UINT header_size )
{ {
FIXME( "data %p, data_count %d, header_size %u stub!\n", data, data_count, header_size ); TRACE( "data %p, data_count %d, header_size %u.\n", data, data_count, header_size );
return 0; return header_size == sizeof(RAWINPUTHEADER) ? 0 : -1;
} }
...@@ -2900,6 +2900,25 @@ static void test_rawinput(const char* argv0) ...@@ -2900,6 +2900,25 @@ static void test_rawinput(const char* argv0)
CloseDesktop(params.desk); CloseDesktop(params.desk);
} }
static void test_DefRawInputProc(void)
{
LRESULT ret;
SetLastError(0xdeadbeef);
ret = DefRawInputProc(NULL, 0, sizeof(RAWINPUTHEADER));
ok(!ret, "got %Id\n", ret);
ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError());
ret = DefRawInputProc(LongToPtr(0xcafe), 0xbeef, sizeof(RAWINPUTHEADER));
ok(!ret, "got %Id\n", ret);
ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError());
ret = DefRawInputProc(NULL, 0, sizeof(RAWINPUTHEADER) - 1);
ok(ret == -1, "got %Id\n", ret);
ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError());
ret = DefRawInputProc(NULL, 0, sizeof(RAWINPUTHEADER) + 1);
ok(ret == -1, "got %Id\n", ret);
ok(GetLastError() == 0xdeadbeef, "got %ld\n", GetLastError());
}
static void test_key_map(void) static void test_key_map(void)
{ {
HKL kl = GetKeyboardLayout(0); HKL kl = GetKeyboardLayout(0);
...@@ -4589,6 +4608,7 @@ START_TEST(input) ...@@ -4589,6 +4608,7 @@ START_TEST(input)
test_GetRawInputBuffer(); test_GetRawInputBuffer();
test_RegisterRawInputDevices(); test_RegisterRawInputDevices();
test_rawinput(argv[0]); test_rawinput(argv[0]);
test_DefRawInputProc();
if(pGetMouseMovePointsEx) if(pGetMouseMovePointsEx)
test_GetMouseMovePointsEx(argv[0]); test_GetMouseMovePointsEx(argv[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