Checking the expected basic behavior, for https://bugs.winehq.org/show_bug.cgi?id=51537 and https://bugs.winehq.org/show_bug.cgi?id=53847.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/input.c | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 86c88520eeb..fde5aedeb4a 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -81,6 +81,7 @@ static struct { BOOL sendinput_broken; } key_status;
+static BOOL (WINAPI *pEnableMouseInPointer)( BOOL ); static BOOL (WINAPI *pGetCurrentInputMessageSource)( INPUT_MESSAGE_SOURCE *source ); static BOOL (WINAPI *pGetPointerType)(UINT32, POINTER_INPUT_TYPE*); static BOOL (WINAPI *pGetPointerInfo)(UINT32, POINTER_INFO*); @@ -149,6 +150,7 @@ static void init_function_pointers(void) if (!(p ## func = (void*)GetProcAddress(hdll, #func))) \ trace("GetProcAddress(%s) failed\n", #func)
+ GET_PROC(EnableMouseInPointer); GET_PROC(GetCurrentInputMessageSource); GET_PROC(GetMouseMovePointsEx); GET_PROC(GetPointerInfo); @@ -4590,6 +4592,43 @@ static void test_SendInput(void) DestroyWindow( hwnd ); }
+static void test_EnableMouseInPointer_process( const char *arg ) +{ + DWORD enable = strtoul( arg, 0, 10 ); + BOOL ret; + + ret = pEnableMouseInPointer( enable ); + todo_wine + ok( ret, "EnableMouseInPointer failed, error %lu\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + ret = pEnableMouseInPointer( !enable ); + ok( !ret, "EnableMouseInPointer succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError() ); + + ret = pEnableMouseInPointer( enable ); + todo_wine + ok( ret, "EnableMouseInPointer failed, error %lu\n", GetLastError() ); +} + +static void test_EnableMouseInPointer( char **argv, BOOL enable ) +{ + STARTUPINFOA startup = {.cb = sizeof(STARTUPINFOA)}; + PROCESS_INFORMATION info = {0}; + char cmdline[MAX_PATH * 2]; + BOOL ret; + + sprintf( cmdline, "%s %s EnableMouseInPointer %u", argv[0], argv[1], enable ); + ret = CreateProcessA( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ); + ok( ret, "CreateProcessA failed, error %lu\n", GetLastError() ); + if (!ret) return; + + wait_child_process( info.hProcess ); + CloseHandle( info.hThread ); + CloseHandle( info.hProcess ); +} + START_TEST(input) { char **argv; @@ -4612,6 +4651,14 @@ START_TEST(input) return; }
+ if (argc >= 4 && strcmp( argv[2], "EnableMouseInPointer" ) == 0) + { + winetest_push_context( "enable %s", argv[3] ); + test_EnableMouseInPointer_process( argv[3] ); + winetest_pop_context(); + return; + } + test_SendInput(); test_Input_blackbox(); test_Input_whitebox(); @@ -4657,4 +4704,12 @@ START_TEST(input) win_skip("GetPointerType is not available\n");
test_UnregisterDeviceNotification(); + + if (!pEnableMouseInPointer) + win_skip( "EnableMouseInPointer not found, skipping tests\n" ); + else + { + test_EnableMouseInPointer( argv, FALSE ); + test_EnableMouseInPointer( argv, TRUE ); + } }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/input.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index fde5aedeb4a..3f9ad8b184f 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -82,6 +82,7 @@ static struct { } key_status;
static BOOL (WINAPI *pEnableMouseInPointer)( BOOL ); +static BOOL (WINAPI *pIsMouseInPointerEnabled)(void); static BOOL (WINAPI *pGetCurrentInputMessageSource)( INPUT_MESSAGE_SOURCE *source ); static BOOL (WINAPI *pGetPointerType)(UINT32, POINTER_INPUT_TYPE*); static BOOL (WINAPI *pGetPointerInfo)(UINT32, POINTER_INFO*); @@ -151,6 +152,7 @@ static void init_function_pointers(void) trace("GetProcAddress(%s) failed\n", #func)
GET_PROC(EnableMouseInPointer); + GET_PROC(IsMouseInPointerEnabled); GET_PROC(GetCurrentInputMessageSource); GET_PROC(GetMouseMovePointsEx); GET_PROC(GetPointerInfo); @@ -4606,10 +4608,18 @@ static void test_EnableMouseInPointer_process( const char *arg ) ok( !ret, "EnableMouseInPointer succeeded\n" ); todo_wine ok( GetLastError() == ERROR_ACCESS_DENIED, "got error %lu\n", GetLastError() ); + if (!pIsMouseInPointerEnabled) ret = !enable; + else ret = pIsMouseInPointerEnabled(); + todo_wine_if(!pIsMouseInPointerEnabled) + ok( ret == enable, "IsMouseInPointerEnabled returned %u, error %lu\n", ret, GetLastError() );
ret = pEnableMouseInPointer( enable ); todo_wine ok( ret, "EnableMouseInPointer failed, error %lu\n", GetLastError() ); + if (!pIsMouseInPointerEnabled) ret = !enable; + else ret = pIsMouseInPointerEnabled(); + todo_wine_if(!pIsMouseInPointerEnabled) + ok( ret == enable, "IsMouseInPointerEnabled returned %u, error %lu\n", ret, GetLastError() ); }
static void test_EnableMouseInPointer( char **argv, BOOL enable )
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/input.c | 134 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 3f9ad8b184f..88d93965287 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -4594,6 +4594,138 @@ static void test_SendInput(void) DestroyWindow( hwnd ); }
+static DWORD CALLBACK test_GetPointerInfo_thread( void *arg ) +{ + POINTER_INFO pointer_info; + HWND hwnd; + BOOL ret; + + hwnd = CreateWindowW( L"test", L"test name", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, + 200, 0, 0, NULL, 0 ); + + memset( &pointer_info, 0xcd, sizeof(pointer_info) ); + ret = pGetPointerInfo( 1, &pointer_info ); + ok( !ret, "GetPointerInfo succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() ); + + DestroyWindow( hwnd ); + + return 0; +} + +static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) +{ + void *invalid_ptr = (void *)0xdeadbeef; + POINTER_INFO pointer_info[4]; + WNDCLASSW cls = + { + .lpfnWndProc = DefWindowProcW, + .hInstance = GetModuleHandleW( NULL ), + .hbrBackground = GetStockObject( WHITE_BRUSH ), + .lpszClassName = L"test", + }; + HANDLE thread; + ATOM class; + DWORD res; + HWND hwnd; + BOOL ret; + + if (!pGetPointerInfo) + { + todo_wine + win_skip( "GetPointerInfo not found, skipping tests\n" ); + return; + } + + class = RegisterClassW( &cls ); + ok( class, "RegisterClassW failed: %lu\n", GetLastError() ); + + ret = pGetPointerInfo( 1, invalid_ptr ); + ok( !ret, "GetPointerInfo succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_NOACCESS || broken(GetLastError() == ERROR_INVALID_PARAMETER) /* w10 32bit */, + "got error %lu\n", GetLastError() ); + + memset( pointer_info, 0xcd, sizeof(pointer_info) ); + ret = pGetPointerInfo( 1, pointer_info ); + ok( !ret, "GetPointerInfo succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() ); + + hwnd = CreateWindowW( L"test", L"test name", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, + 200, 0, 0, NULL, 0 ); + empty_message_queue(); + + memset( pointer_info, 0xcd, sizeof(pointer_info) ); + ret = pGetPointerInfo( 1, pointer_info ); + ok( !ret, "GetPointerInfo succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() ); + + SetCursorPos( 200, 200 ); + empty_message_queue(); + mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 ); + empty_message_queue(); + mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 ); + empty_message_queue(); + mouse_event( MOUSEEVENTF_MOVE, 10, 10, 0, 0 ); + empty_message_queue(); + + memset( pointer_info, 0xcd, sizeof(pointer_info) ); + ret = pGetPointerInfo( 0xdead, pointer_info ); + ok( !ret, "GetPointerInfo succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() ); + + memset( pointer_info, 0xcd, sizeof(pointer_info) ); + ret = pGetPointerInfo( 1, pointer_info ); + todo_wine_if(mouse_in_pointer_enabled) + ok( ret == mouse_in_pointer_enabled, "GetPointerInfo failed, error %lu\n", GetLastError() ); + if (!mouse_in_pointer_enabled) + { + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() ); + return; + } + + todo_wine + ok( pointer_info[0].pointerType == PT_MOUSE, "got pointerType %lu\n", pointer_info[0].pointerType ); + todo_wine + ok( pointer_info[0].pointerId == 1, "got pointerId %u\n", pointer_info[0].pointerId ); + ok( !!pointer_info[0].frameId, "got frameId %u\n", pointer_info[0].frameId ); + todo_wine + ok( pointer_info[0].pointerFlags == (0x20000 | POINTER_MESSAGE_FLAG_INRANGE | POINTER_MESSAGE_FLAG_PRIMARY), + "got pointerFlags %#x\n", pointer_info[0].pointerFlags ); + todo_wine + ok( pointer_info[0].sourceDevice == INVALID_HANDLE_VALUE || broken(!!pointer_info[0].sourceDevice) /* < w10 & 32bit */, + "got sourceDevice %p\n", pointer_info[0].sourceDevice ); + todo_wine + ok( pointer_info[0].hwndTarget == hwnd, "got hwndTarget %p\n", pointer_info[0].hwndTarget ); + ok( !!pointer_info[0].ptPixelLocation.x, "got ptPixelLocation %s\n", wine_dbgstr_point( &pointer_info[0].ptPixelLocation ) ); + ok( !!pointer_info[0].ptPixelLocation.y, "got ptPixelLocation %s\n", wine_dbgstr_point( &pointer_info[0].ptPixelLocation ) ); + ok( !!pointer_info[0].ptHimetricLocation.x, "got ptHimetricLocation %s\n", wine_dbgstr_point( &pointer_info[0].ptHimetricLocation ) ); + ok( !!pointer_info[0].ptHimetricLocation.y, "got ptHimetricLocation %s\n", wine_dbgstr_point( &pointer_info[0].ptHimetricLocation ) ); + ok( !!pointer_info[0].ptPixelLocationRaw.x, "got ptPixelLocationRaw %s\n", wine_dbgstr_point( &pointer_info[0].ptPixelLocationRaw ) ); + ok( !!pointer_info[0].ptPixelLocationRaw.y, "got ptPixelLocationRaw %s\n", wine_dbgstr_point( &pointer_info[0].ptPixelLocationRaw ) ); + ok( !!pointer_info[0].ptHimetricLocationRaw.x, "got ptHimetricLocationRaw %s\n", wine_dbgstr_point( &pointer_info[0].ptHimetricLocationRaw ) ); + ok( !!pointer_info[0].ptHimetricLocationRaw.y, "got ptHimetricLocationRaw %s\n", wine_dbgstr_point( &pointer_info[0].ptHimetricLocationRaw ) ); + ok( !!pointer_info[0].dwTime, "got dwTime %lu\n", pointer_info[0].dwTime ); + todo_wine + ok( pointer_info[0].historyCount == 1, "got historyCount %u\n", pointer_info[0].historyCount ); + todo_wine + ok( pointer_info[0].InputData == 0, "got InputData %u\n", pointer_info[0].InputData ); + todo_wine + ok( pointer_info[0].dwKeyStates == 0, "got dwKeyStates %lu\n", pointer_info[0].dwKeyStates ); + ok( !!pointer_info[0].PerformanceCount, "got PerformanceCount %I64u\n", pointer_info[0].PerformanceCount ); + todo_wine + ok( pointer_info[0].ButtonChangeType == 0, "got ButtonChangeType %u\n", pointer_info[0].ButtonChangeType ); + + thread = CreateThread( NULL, 0, test_GetPointerInfo_thread, NULL, 0, NULL ); + res = WaitForSingleObject( thread, 5000 ); + ok( !res, "WaitForSingleObject returned %#lx, error %lu\n", res, GetLastError() ); + + DestroyWindow( hwnd ); + + ret = UnregisterClassW( L"test", GetModuleHandleW( NULL ) ); + ok( ret, "UnregisterClassW failed: %lu\n", GetLastError() ); +} + static void test_EnableMouseInPointer_process( const char *arg ) { DWORD enable = strtoul( arg, 0, 10 ); @@ -4620,6 +4752,8 @@ static void test_EnableMouseInPointer_process( const char *arg ) else ret = pIsMouseInPointerEnabled(); todo_wine_if(!pIsMouseInPointerEnabled) ok( ret == enable, "IsMouseInPointerEnabled returned %u, error %lu\n", ret, GetLastError() ); + + test_GetPointerInfo( enable ); }
static void test_EnableMouseInPointer( char **argv, BOOL enable )
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/input.c | 60 ++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 35 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 88d93965287..e9b633ee005 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -4446,38 +4446,6 @@ static void test_input_message_source(void) UnregisterClassA( cls.lpszClassName, GetModuleHandleA(0) ); }
-static void test_pointer_info(void) -{ - BOOL ret; - POINTER_INPUT_TYPE type = -1; - POINTER_INFO info; - UINT id = 0; - - SetLastError(0xdeadbeef); - ret = pGetPointerType(id, NULL); - ok(!ret, "GetPointerType should have failed.\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected error ERROR_INVALID_PARAMETER, got %lu.\n", GetLastError()); - - SetLastError(0xdeadbeef); - ret = pGetPointerType(id, &type); - ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected error ERROR_INVALID_PARAMETER, got %lu.\n", GetLastError()); - ok(!ret, "GetPointerType failed, got type %ld for %u.\n", type, id ); - ok(type == -1, " type %ld\n", type ); - - id = 1; - ret = pGetPointerType(id, &type); - ok(ret, "GetPointerType failed, got type %ld for %u.\n", type, id ); - ok(type == PT_MOUSE, " type %ld\n", type ); - - /* GetPointerInfo always fails unless the app receives WM_POINTER messages. */ - SetLastError(0xdeadbeef); - ret = pGetPointerInfo(id, &info); - ok(!ret, "succeeded.\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %lu.\n", GetLastError()); -} - static void test_UnregisterDeviceNotification(void) { BOOL ret = UnregisterDeviceNotification(NULL); @@ -4617,6 +4585,7 @@ static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) { void *invalid_ptr = (void *)0xdeadbeef; POINTER_INFO pointer_info[4]; + POINTER_INPUT_TYPE type; WNDCLASSW cls = { .lpfnWndProc = DefWindowProcW, @@ -4630,6 +4599,27 @@ static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) HWND hwnd; BOOL ret;
+ if (!pGetPointerType) + { + todo_wine + win_skip( "GetPointerType not found, skipping tests\n" ); + return; + } + + SetLastError( 0xdeadbeef ); + ret = pGetPointerType( 1, NULL ); + ok( !ret, "GetPointerType succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pGetPointerType( 0xdead, &type ); + todo_wine + ok( !ret, "GetPointerType succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError() ); + ret = pGetPointerType( 1, &type ); + ok( ret, "GetPointerType failed, error %lu\n", GetLastError() ); + ok( type == PT_MOUSE, " type %ld\n", type ); + if (!pGetPointerInfo) { todo_wine @@ -4842,10 +4832,10 @@ START_TEST(input)
SetCursorPos( pos.x, pos.y );
- if(pGetPointerType) - test_pointer_info(); + if (pGetPointerType) + test_GetPointerInfo( FALSE ); else - win_skip("GetPointerType is not available\n"); + win_skip( "GetPointerType is not available\n" );
test_UnregisterDeviceNotification();
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/input.c | 44 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index e9b633ee005..5635aa593e7 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -86,6 +86,9 @@ static BOOL (WINAPI *pIsMouseInPointerEnabled)(void); static BOOL (WINAPI *pGetCurrentInputMessageSource)( INPUT_MESSAGE_SOURCE *source ); static BOOL (WINAPI *pGetPointerType)(UINT32, POINTER_INPUT_TYPE*); static BOOL (WINAPI *pGetPointerInfo)(UINT32, POINTER_INFO*); +static BOOL (WINAPI *pGetPointerInfoHistory)(UINT32, UINT32*, POINTER_INFO*); +static BOOL (WINAPI *pGetPointerFrameInfo)(UINT32, UINT32*, POINTER_INFO*); +static BOOL (WINAPI *pGetPointerFrameInfoHistory)(UINT32, UINT32*, UINT32*, POINTER_INFO*); static int (WINAPI *pGetMouseMovePointsEx) (UINT, LPMOUSEMOVEPOINT, LPMOUSEMOVEPOINT, int, DWORD); static UINT (WINAPI *pGetRawInputDeviceList) (PRAWINPUTDEVICELIST, PUINT, UINT); static UINT (WINAPI *pGetRawInputDeviceInfoW) (HANDLE, UINT, void *, UINT *); @@ -156,6 +159,9 @@ static void init_function_pointers(void) GET_PROC(GetCurrentInputMessageSource); GET_PROC(GetMouseMovePointsEx); GET_PROC(GetPointerInfo); + GET_PROC(GetPointerInfoHistory); + GET_PROC(GetPointerFrameInfo); + GET_PROC(GetPointerFrameInfoHistory); GET_PROC(GetPointerType); GET_PROC(GetRawInputDeviceList); GET_PROC(GetRawInputDeviceInfoW); @@ -4583,8 +4589,9 @@ static DWORD CALLBACK test_GetPointerInfo_thread( void *arg )
static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) { + POINTER_INFO pointer_info[4], expect_pointer; void *invalid_ptr = (void *)0xdeadbeef; - POINTER_INFO pointer_info[4]; + UINT32 entry_count, pointer_count; POINTER_INPUT_TYPE type; WNDCLASSW cls = { @@ -4710,6 +4717,41 @@ static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) res = WaitForSingleObject( thread, 5000 ); ok( !res, "WaitForSingleObject returned %#lx, error %lu\n", res, GetLastError() );
+ expect_pointer = pointer_info[0]; + + memset( pointer_info, 0xa5, sizeof(pointer_info) ); + entry_count = pointer_count = 2; + if (!pGetPointerFrameInfo) ret = FALSE; + else ret = pGetPointerFrameInfo( 1, &pointer_count, pointer_info ); + todo_wine_if(!pGetPointerFrameInfo) + ok( ret, "GetPointerFrameInfo failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerFrameInfo) + ok( pointer_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFrameInfo) + ok( !memcmp( &expect_pointer, pointer_info, sizeof(expect_pointer) ), "got unexpected pointer info\n" ); + memset( pointer_info, 0xa5, sizeof(pointer_info) ); + entry_count = pointer_count = 2; + if (!pGetPointerInfoHistory) ret = FALSE; + else ret = pGetPointerInfoHistory( 1, &entry_count, pointer_info ); + todo_wine_if(!pGetPointerInfoHistory) + ok( ret, "GetPointerInfoHistory failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerInfoHistory) + ok( entry_count == 1, "got entry_count %u\n", entry_count ); + todo_wine_if(!pGetPointerInfoHistory) + ok( !memcmp( &expect_pointer, pointer_info, sizeof(expect_pointer) ), "got unexpected pointer info\n" ); + memset( pointer_info, 0xa5, sizeof(pointer_info) ); + entry_count = pointer_count = 2; + if (!pGetPointerFrameInfoHistory) ret = FALSE; + else ret = pGetPointerFrameInfoHistory( 1, &entry_count, &pointer_count, pointer_info ); + todo_wine_if(!pGetPointerFrameInfoHistory) + ok( ret, "GetPointerFrameInfoHistory failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerFrameInfoHistory) + ok( entry_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFrameInfoHistory) + ok( pointer_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFrameInfoHistory) + ok( !memcmp( &expect_pointer, pointer_info, sizeof(expect_pointer) ), "got unexpected pointer info\n" ); + DestroyWindow( hwnd );
ret = UnregisterClassW( L"test", GetModuleHandleW( NULL ) );
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/input.c | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 5635aa593e7..2bc2ba2825d 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -85,6 +85,10 @@ static BOOL (WINAPI *pEnableMouseInPointer)( BOOL ); static BOOL (WINAPI *pIsMouseInPointerEnabled)(void); static BOOL (WINAPI *pGetCurrentInputMessageSource)( INPUT_MESSAGE_SOURCE *source ); static BOOL (WINAPI *pGetPointerType)(UINT32, POINTER_INPUT_TYPE*); +static BOOL (WINAPI *pGetPointerPenInfo)(UINT32, POINTER_PEN_INFO*); +static BOOL (WINAPI *pGetPointerPenInfoHistory)(UINT32, UINT32*, POINTER_PEN_INFO*); +static BOOL (WINAPI *pGetPointerFramePenInfo)(UINT32, UINT32*, POINTER_PEN_INFO*); +static BOOL (WINAPI *pGetPointerFramePenInfoHistory)(UINT32, UINT32*, UINT32*, POINTER_PEN_INFO*); static BOOL (WINAPI *pGetPointerInfo)(UINT32, POINTER_INFO*); static BOOL (WINAPI *pGetPointerInfoHistory)(UINT32, UINT32*, POINTER_INFO*); static BOOL (WINAPI *pGetPointerFrameInfo)(UINT32, UINT32*, POINTER_INFO*); @@ -162,6 +166,10 @@ static void init_function_pointers(void) GET_PROC(GetPointerInfoHistory); GET_PROC(GetPointerFrameInfo); GET_PROC(GetPointerFrameInfoHistory); + GET_PROC(GetPointerPenInfo); + GET_PROC(GetPointerPenInfoHistory); + GET_PROC(GetPointerFramePenInfo); + GET_PROC(GetPointerFramePenInfoHistory); GET_PROC(GetPointerType); GET_PROC(GetRawInputDeviceList); GET_PROC(GetRawInputDeviceInfoW); @@ -4592,6 +4600,7 @@ static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) POINTER_INFO pointer_info[4], expect_pointer; void *invalid_ptr = (void *)0xdeadbeef; UINT32 entry_count, pointer_count; + POINTER_PEN_INFO pen_info[4]; POINTER_INPUT_TYPE type; WNDCLASSW cls = { @@ -4752,6 +4761,46 @@ static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) todo_wine_if(!pGetPointerFrameInfoHistory) ok( !memcmp( &expect_pointer, pointer_info, sizeof(expect_pointer) ), "got unexpected pointer info\n" );
+ memset( pen_info, 0xa5, sizeof(pen_info) ); + if (!pGetPointerPenInfo) ret = FALSE; + else ret = pGetPointerPenInfo( 1, pen_info ); + todo_wine_if(!pGetPointerPenInfo) + ok( ret, "GetPointerPenInfo failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerPenInfo) + ok( !memcmp( &expect_pointer, &pen_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected pen info\n" ); + memset( pen_info, 0xa5, sizeof(pen_info) ); + entry_count = pointer_count = 2; + if (!pGetPointerFramePenInfo) ret = FALSE; + else ret = pGetPointerFramePenInfo( 1, &pointer_count, pen_info ); + todo_wine_if(!pGetPointerFramePenInfo) + ok( ret, "GetPointerFramePenInfo failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerFramePenInfo) + ok( pointer_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFramePenInfo) + ok( !memcmp( &expect_pointer, &pen_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected pen info\n" ); + memset( pen_info, 0xa5, sizeof(pen_info) ); + entry_count = pointer_count = 2; + if (!pGetPointerPenInfoHistory) ret = FALSE; + else ret = pGetPointerPenInfoHistory( 1, &entry_count, pen_info ); + todo_wine_if(!pGetPointerPenInfoHistory) + ok( ret, "GetPointerPenInfoHistory failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerPenInfoHistory) + ok( entry_count == 1, "got entry_count %u\n", entry_count ); + todo_wine_if(!pGetPointerPenInfoHistory) + ok( !memcmp( &expect_pointer, &pen_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected pen info\n" ); + memset( pen_info, 0xa5, sizeof(pen_info) ); + entry_count = pointer_count = 2; + if (!pGetPointerFramePenInfoHistory) ret = FALSE; + else ret = pGetPointerFramePenInfoHistory( 1, &entry_count, &pointer_count, pen_info ); + todo_wine_if(!pGetPointerFramePenInfoHistory) + ok( ret, "GetPointerFramePenInfoHistory failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerFramePenInfoHistory) + ok( entry_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFramePenInfoHistory) + ok( pointer_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFramePenInfoHistory) + ok( !memcmp( &expect_pointer, &pen_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected pen info\n" ); + DestroyWindow( hwnd );
ret = UnregisterClassW( L"test", GetModuleHandleW( NULL ) );
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/input.c | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 2bc2ba2825d..436056e2e96 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -93,6 +93,10 @@ static BOOL (WINAPI *pGetPointerInfo)(UINT32, POINTER_INFO*); static BOOL (WINAPI *pGetPointerInfoHistory)(UINT32, UINT32*, POINTER_INFO*); static BOOL (WINAPI *pGetPointerFrameInfo)(UINT32, UINT32*, POINTER_INFO*); static BOOL (WINAPI *pGetPointerFrameInfoHistory)(UINT32, UINT32*, UINT32*, POINTER_INFO*); +static BOOL (WINAPI *pGetPointerTouchInfo)(UINT32, POINTER_TOUCH_INFO*); +static BOOL (WINAPI *pGetPointerTouchInfoHistory)(UINT32, UINT32*, POINTER_TOUCH_INFO*); +static BOOL (WINAPI *pGetPointerFrameTouchInfo)(UINT32, UINT32*, POINTER_TOUCH_INFO*); +static BOOL (WINAPI *pGetPointerFrameTouchInfoHistory)(UINT32, UINT32*, UINT32*, POINTER_TOUCH_INFO*); static int (WINAPI *pGetMouseMovePointsEx) (UINT, LPMOUSEMOVEPOINT, LPMOUSEMOVEPOINT, int, DWORD); static UINT (WINAPI *pGetRawInputDeviceList) (PRAWINPUTDEVICELIST, PUINT, UINT); static UINT (WINAPI *pGetRawInputDeviceInfoW) (HANDLE, UINT, void *, UINT *); @@ -170,6 +174,10 @@ static void init_function_pointers(void) GET_PROC(GetPointerPenInfoHistory); GET_PROC(GetPointerFramePenInfo); GET_PROC(GetPointerFramePenInfoHistory); + GET_PROC(GetPointerTouchInfo); + GET_PROC(GetPointerTouchInfoHistory); + GET_PROC(GetPointerFrameTouchInfo); + GET_PROC(GetPointerFrameTouchInfoHistory); GET_PROC(GetPointerType); GET_PROC(GetRawInputDeviceList); GET_PROC(GetRawInputDeviceInfoW); @@ -4600,6 +4608,7 @@ static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) POINTER_INFO pointer_info[4], expect_pointer; void *invalid_ptr = (void *)0xdeadbeef; UINT32 entry_count, pointer_count; + POINTER_TOUCH_INFO touch_info[4]; POINTER_PEN_INFO pen_info[4]; POINTER_INPUT_TYPE type; WNDCLASSW cls = @@ -4801,6 +4810,44 @@ static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) todo_wine_if(!pGetPointerFramePenInfoHistory) ok( !memcmp( &expect_pointer, &pen_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected pen info\n" );
+ memset( touch_info, 0xa5, sizeof(touch_info) ); + ret = pGetPointerTouchInfo( 1, touch_info ); + todo_wine + ok( ret, "GetPointerTouchInfo failed, error %lu\n", GetLastError() ); + todo_wine + ok( !memcmp( &expect_pointer, &touch_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected touch info\n" ); + memset( touch_info, 0xa5, sizeof(touch_info) ); + entry_count = pointer_count = 2; + if (!pGetPointerFrameTouchInfo) ret = FALSE; + else ret = pGetPointerFrameTouchInfo( 1, &pointer_count, touch_info ); + todo_wine_if(!pGetPointerFrameTouchInfo) + ok( ret, "GetPointerFrameTouchInfo failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerFrameTouchInfo) + ok( pointer_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFrameTouchInfo) + ok( !memcmp( &expect_pointer, &touch_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected touch info\n" ); + memset( touch_info, 0xa5, sizeof(touch_info) ); + entry_count = pointer_count = 2; + ret = pGetPointerTouchInfoHistory( 1, &entry_count, touch_info ); + todo_wine + ok( ret, "GetPointerTouchInfoHistory failed, error %lu\n", GetLastError() ); + todo_wine + ok( entry_count == 1, "got entry_count %u\n", entry_count ); + todo_wine + ok( !memcmp( &expect_pointer, &touch_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected touch info\n" ); + memset( touch_info, 0xa5, sizeof(touch_info) ); + entry_count = pointer_count = 2; + if (!pGetPointerFrameTouchInfoHistory) ret = FALSE; + else ret = pGetPointerFrameTouchInfoHistory( 1, &entry_count, &pointer_count, touch_info ); + todo_wine_if(!pGetPointerFrameTouchInfoHistory) + ok( ret, "GetPointerFrameTouchInfoHistory failed, error %lu\n", GetLastError() ); + todo_wine_if(!pGetPointerFrameTouchInfoHistory) + ok( entry_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFrameTouchInfoHistory) + ok( pointer_count == 1, "got pointer_count %u\n", pointer_count ); + todo_wine_if(!pGetPointerFrameTouchInfoHistory) + ok( !memcmp( &expect_pointer, &touch_info[0].pointerInfo, sizeof(expect_pointer) ), "got unexpected touch info\n" ); + DestroyWindow( hwnd );
ret = UnregisterClassW( L"test", GetModuleHandleW( NULL ) );
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=127840
Your paranoid android.
=== w864 (32 bit report) ===
user32: input.c:4749: Test failed: enable 1: got unexpected pointer info input.c:4759: Test failed: enable 1: got unexpected pointer info input.c:4771: Test failed: enable 1: got unexpected pointer info input.c:4779: Test failed: enable 1: got unexpected pen info input.c:4789: Test failed: enable 1: got unexpected pen info input.c:4799: Test failed: enable 1: got unexpected pen info input.c:4811: Test failed: enable 1: got unexpected pen info input.c:4818: Test failed: enable 1: got unexpected touch info input.c:4828: Test failed: enable 1: got unexpected touch info input.c:4837: Test failed: enable 1: got unexpected touch info input.c:4849: Test failed: enable 1: got unexpected touch info
=== w1064v1507 (32 bit report) ===
user32: input.c:4749: Test failed: enable 1: got unexpected pointer info input.c:4759: Test failed: enable 1: got unexpected pointer info input.c:4771: Test failed: enable 1: got unexpected pointer info input.c:4779: Test failed: enable 1: got unexpected pen info input.c:4789: Test failed: enable 1: got unexpected pen info input.c:4799: Test failed: enable 1: got unexpected pen info input.c:4811: Test failed: enable 1: got unexpected pen info input.c:4818: Test failed: enable 1: got unexpected touch info input.c:4828: Test failed: enable 1: got unexpected touch info input.c:4837: Test failed: enable 1: got unexpected touch info input.c:4849: Test failed: enable 1: got unexpected touch info
=== w1064v1809 (32 bit report) ===
user32: input.c:4749: Test failed: enable 1: got unexpected pointer info input.c:4759: Test failed: enable 1: got unexpected pointer info input.c:4771: Test failed: enable 1: got unexpected pointer info input.c:4779: Test failed: enable 1: got unexpected pen info input.c:4789: Test failed: enable 1: got unexpected pen info input.c:4799: Test failed: enable 1: got unexpected pen info input.c:4811: Test failed: enable 1: got unexpected pen info input.c:4818: Test failed: enable 1: got unexpected touch info input.c:4828: Test failed: enable 1: got unexpected touch info input.c:4837: Test failed: enable 1: got unexpected touch info input.c:4849: Test failed: enable 1: got unexpected touch info
=== w1064_tsign (32 bit report) ===
user32: input.c:4749: Test failed: enable 1: got unexpected pointer info input.c:4759: Test failed: enable 1: got unexpected pointer info input.c:4771: Test failed: enable 1: got unexpected pointer info input.c:4779: Test failed: enable 1: got unexpected pen info input.c:4789: Test failed: enable 1: got unexpected pen info input.c:4799: Test failed: enable 1: got unexpected pen info input.c:4811: Test failed: enable 1: got unexpected pen info input.c:4818: Test failed: enable 1: got unexpected touch info input.c:4828: Test failed: enable 1: got unexpected touch info input.c:4837: Test failed: enable 1: got unexpected touch info input.c:4849: Test failed: enable 1: got unexpected touch info
=== w10pro64 (32 bit report) ===
user32: input.c:4749: Test failed: enable 1: got unexpected pointer info input.c:4759: Test failed: enable 1: got unexpected pointer info input.c:4771: Test failed: enable 1: got unexpected pointer info input.c:4779: Test failed: enable 1: got unexpected pen info input.c:4789: Test failed: enable 1: got unexpected pen info input.c:4799: Test failed: enable 1: got unexpected pen info input.c:4811: Test failed: enable 1: got unexpected pen info input.c:4818: Test failed: enable 1: got unexpected touch info input.c:4828: Test failed: enable 1: got unexpected touch info input.c:4837: Test failed: enable 1: got unexpected touch info input.c:4849: Test failed: enable 1: got unexpected touch info