From: "Anna (navi) Figueiredo Gomes" <navi@vlhl.dev> --- dlls/user32/input.c | 8 -------- dlls/user32/user32.spec | 2 +- dlls/win32u/input.c | 19 ++++++++++++++++--- dlls/win32u/tests/win32u.c | 13 +++++-------- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 48b38166b75..623fab14d11 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -750,14 +750,6 @@ BOOL WINAPI GetPointerDeviceProperties( HANDLE device, UINT32 *count, return FALSE; } -BOOL WINAPI GetPointerDeviceRects( HANDLE device, RECT *device_rect, RECT *display_rect ) -{ - FIXME( "device %p, device_rect %p, display_rect %p stub!\n", - device, device_rect, display_rect ); - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; -} - BOOL WINAPI GetPointerPenInfo( UINT32 id, POINTER_PEN_INFO *info ) { FIXME( "id %u, info %p stub!\n", id, info ); diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index b8939646668..80dfa388dd8 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -630,7 +630,7 @@ # @ stub GetPointerDeviceInputSpace # @ stub GetPointerDeviceOrientation @ stdcall GetPointerDeviceProperties(ptr ptr ptr) -@ stdcall GetPointerDeviceRects(ptr ptr ptr) +@ stdcall GetPointerDeviceRects(ptr ptr ptr) NtUserGetPointerDeviceRects @ stdcall GetPointerDevices(ptr ptr) # @ stub GetPointerFrameInfo # @ stub GetPointerFrameInfoHistory diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 3ed2ca3a3e1..d1384a08ab9 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -40,6 +40,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); WINE_DECLARE_DEBUG_CHANNEL(keyboard); +#define HIMETRIC 2540 + static const WCHAR keyboard_layouts_keyW[] = { '\\','R','e','g','i','s','t','r','y', @@ -2868,7 +2870,18 @@ BOOL WINAPI NtUserGetPointerType(UINT32 id, POINTER_INPUT_TYPE *type) */ BOOL WINAPI NtUserGetPointerDeviceRects( HANDLE handle, RECT *pointerDeviceRect, RECT *displayRect ) { - FIXME( "(%p, %p, %p) stub!\n", handle, pointerDeviceRect, displayRect ); - RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; + UINT dpi = get_system_dpi(); + + TRACE( "%p, %p, %p\n", handle, pointerDeviceRect, displayRect ); + + if (handle != INVALID_HANDLE_VALUE) + { + FIXME( "Pointer devices are not implemented!\n" ); + RtlSetLastWin32Error( ERROR_NO_DATA ); + return FALSE; + } + + *displayRect = get_virtual_screen_rect( dpi, MDT_DEFAULT ); + *pointerDeviceRect = map_dpi_rect( *displayRect, dpi, HIMETRIC ); + return TRUE; } diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c index a7087d46e9d..1fd6358df39 100644 --- a/dlls/win32u/tests/win32u.c +++ b/dlls/win32u/tests/win32u.c @@ -2977,14 +2977,11 @@ void test_NtUserGetPointerDeviceRects(void) UINT ret; ret = NtUserGetPointerDeviceRects( INVALID_HANDLE_VALUE, &device, &display ); - todo_wine - { - ok( ret, "NtUserGetPointerDeviceRects failed, error %lu.\n", GetLastError() ); - ok( EqualRect( &device, &himetric_dev ), "device %s, expected %s\n", - wine_dbgstr_rect( &device ), wine_dbgstr_rect( &himetric_dev ) ); - ok( EqualRect( &display, &screen ), "display %s, expected %s\n", - wine_dbgstr_rect( &display ), wine_dbgstr_rect( &screen ) ); - } + ok( ret, "NtUserGetPointerDeviceRects failed, error %lu.\n", GetLastError() ); + ok( EqualRect( &device, &himetric_dev ), "device %s, expected %s\n", + wine_dbgstr_rect( &device ), wine_dbgstr_rect( &himetric_dev ) ); + ok( EqualRect( &display, &screen ), "display %s, expected %s\n", + wine_dbgstr_rect( &display ), wine_dbgstr_rect( &screen ) ); } START_TEST(win32u) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10649