From: "Anna (navi) Figueiredo Gomes" <navi@vlhl.dev> --- dlls/user32/misc.c | 11 ++--------- dlls/user32/tests/input.c | 2 -- dlls/win32u/input.c | 23 +++++++++++++++++------ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c index 6333fcb48b4..16f02958135 100644 --- a/dlls/user32/misc.c +++ b/dlls/user32/misc.c @@ -512,16 +512,9 @@ LRESULT WINAPI PackTouchHitTestingProximityEvaluation(const TOUCH_HIT_TESTING_IN */ BOOL WINAPI GetPointerType(UINT32 id, POINTER_INPUT_TYPE *type) { - FIXME("(%d %p): stub\n", id, type); + TRACE( "%d %p\n", id, type ); - if(!id || !type) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - *type = PT_MOUSE; - return TRUE; + return NtUserGetPointerType( id, type ); } BOOL WINAPI GetPointerInfo(UINT32 id, POINTER_INFO *info) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 905ff0dd922..d6fb9830d76 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -5527,9 +5527,7 @@ static void test_GetPointerInfo( BOOL mouse_in_pointer_enabled ) 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() ); diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 5aa9a7b1b7f..d823cf8745b 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2898,7 +2898,7 @@ static struct pointer *allocate_pointerid( UINT32 id, POINTER_INPUT_TYPE type ) return pointer; } -static struct pointer *find_pointerid( UINT32 id, POINTER_INPUT_TYPE type ) +static struct pointer *find_pointerid( UINT32 id ) { struct pointer_thread_data *thread_data = get_pointer_thread_data(); struct pointer *pointer; @@ -2912,7 +2912,7 @@ static struct pointer *find_pointerid( UINT32 id, POINTER_INPUT_TYPE type ) if (pointer->id == id) return pointer; - return allocate_pointerid( id, type ); + return NULL; } static POINTER_INFO pointer_info_from_msg( const MSG *msg ) @@ -2986,11 +2986,13 @@ static POINTER_INPUT_TYPE pointer_type_from_hw( const struct hw_msg_source *sour */ BOOL process_pointer_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data ) { + UINT32 pointer_id = GET_POINTERID_WPARAM( msg->wParam ); struct pointer *pointer; POINTER_INFO info; msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt ); - if (!(pointer = find_pointerid( GET_POINTERID_WPARAM( msg->wParam ), pointer_type_from_hw( &msg_data->source ) ))) + if (!(pointer = find_pointerid( pointer_id )) && + !(pointer = allocate_pointerid( pointer_id, pointer_type_from_hw( &msg_data->source ) ))) return TRUE; info = pointer_info_from_msg( msg ); info.ButtonChangeType = compare_button( &pointer->info, &info ); @@ -3004,9 +3006,18 @@ BOOL process_pointer_message( MSG *msg, UINT hw_id, const struct hardware_msg_da */ BOOL WINAPI NtUserGetPointerType(UINT32 id, POINTER_INPUT_TYPE *type) { - FIXME( "(%u, %p) stub!\n", id, type ); - RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + struct pointer *pointer; + + TRACE( "%u, %p\n", id, type ); + + if (!id || !type || !(pointer = find_pointerid( id )) ) + { + RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + *type = pointer->type; + return TRUE; } /********************************************************************** -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10649