Jacek Caban : win32u: Move NtUserGetCursorInfo implementation from user32.
Alexandre Julliard
julliard at winehq.org
Thu Feb 24 15:33:40 CST 2022
Module: wine
Branch: master
Commit: 47ca0f49c7fe3d439993a8c7e885bfea4b5bae40
URL: https://source.winehq.org/git/wine.git/?a=commit;h=47ca0f49c7fe3d439993a8c7e885bfea4b5bae40
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Feb 24 01:28:18 2022 +0100
win32u: Move NtUserGetCursorInfo implementation from user32.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/input.c | 24 ------------------------
dlls/user32/user32.spec | 2 +-
dlls/win32u/gdiobj.c | 1 +
dlls/win32u/input.c | 23 +++++++++++++++++++++++
dlls/win32u/win32u.spec | 2 +-
dlls/win32u/win32u_private.h | 1 +
dlls/win32u/wrappers.c | 6 ++++++
include/ntuser.h | 1 +
8 files changed, 34 insertions(+), 26 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 781896fd16b..6cf60abeae2 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -307,30 +307,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
}
-/***********************************************************************
- * GetCursorInfo (USER32.@)
- */
-BOOL WINAPI GetCursorInfo( PCURSORINFO pci )
-{
- BOOL ret;
-
- if (!pci) return FALSE;
-
- SERVER_START_REQ( get_thread_input )
- {
- req->tid = 0;
- if ((ret = !wine_server_call( req )))
- {
- pci->hCursor = wine_server_ptr_handle( reply->cursor );
- pci->flags = (reply->show_count >= 0) ? CURSOR_SHOWING : 0;
- }
- }
- SERVER_END_REQ;
- GetCursorPos(&pci->ptScreenPos);
- return ret;
-}
-
-
/**********************************************************************
* SetCapture (USER32.@)
*/
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index 5204852bef5..40044023bf4 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -284,7 +284,7 @@
@ stdcall GetCurrentInputMessageSource(ptr)
@ stdcall GetCursor() NtUserGetCursor
@ stdcall GetCursorFrameInfo(long long long ptr ptr)
-@ stdcall GetCursorInfo(ptr)
+@ stdcall GetCursorInfo(ptr) NtUserGetCursorInfo
@ stdcall GetCursorPos(ptr)
@ stdcall GetDC(long)
@ stdcall GetDCEx(long long long)
diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index 2ac40d71e3c..1d54865bf46 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -1162,6 +1162,7 @@ static struct unix_funcs unix_funcs =
NtUserEnumDisplayMonitors,
NtUserEnumDisplaySettings,
NtUserGetAsyncKeyState,
+ NtUserGetCursorInfo,
NtUserGetDisplayConfigBufferSizes,
NtUserGetIconInfo,
NtUserGetKeyNameText,
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
index f8f4d41ad2c..72af32fd471 100644
--- a/dlls/win32u/input.c
+++ b/dlls/win32u/input.c
@@ -131,6 +131,29 @@ BOOL get_cursor_pos( POINT *pt )
return ret;
}
+/***********************************************************************
+ * NtUserGetCursorInfo (win32u.@)
+ */
+BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info )
+{
+ BOOL ret;
+
+ if (!info) return FALSE;
+
+ SERVER_START_REQ( get_thread_input )
+ {
+ req->tid = 0;
+ if ((ret = !wine_server_call( req )))
+ {
+ info->hCursor = wine_server_ptr_handle( reply->cursor );
+ info->flags = reply->show_count >= 0 ? CURSOR_SHOWING : 0;
+ }
+ }
+ SERVER_END_REQ;
+ get_cursor_pos( &info->ptScreenPos );
+ return ret;
+}
+
static void check_for_events( UINT flags )
{
if (user_driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, flags, 0 ) == WAIT_TIMEOUT)
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index 4a743c7d37e..c1dca3d425c 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -914,7 +914,7 @@
@ stub NtUserGetCurrentInputMessageSource
@ stdcall -syscall NtUserGetCursor()
@ stdcall -syscall NtUserGetCursorFrameInfo(long long ptr ptr)
-@ stub NtUserGetCursorInfo
+@ stdcall NtUserGetCursorInfo(ptr)
@ stub NtUserGetDC
@ stub NtUserGetDCEx
@ stub NtUserGetDManipHookInitFunction
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index 9b94387be79..002524a18f4 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -199,6 +199,7 @@ struct unix_funcs
BOOL (WINAPI *pNtUserEnumDisplaySettings)( UNICODE_STRING *device, DWORD mode,
DEVMODEW *dev_mode, DWORD flags );
SHORT (WINAPI *pNtUserGetAsyncKeyState)( INT key );
+ BOOL (WINAPI *pNtUserGetCursorInfo)( CURSORINFO *info );
LONG (WINAPI *pNtUserGetDisplayConfigBufferSizes)( UINT32 flags, UINT32 *num_path_info,
UINT32 *num_mode_info );
BOOL (WINAPI *pNtUserGetIconInfo)( HICON icon, ICONINFO *info, UNICODE_STRING *module,
diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c
index 8d57fc20036..ca69422f086 100644
--- a/dlls/win32u/wrappers.c
+++ b/dlls/win32u/wrappers.c
@@ -777,6 +777,12 @@ SHORT WINAPI NtUserGetAsyncKeyState( INT key )
return unix_funcs->pNtUserGetAsyncKeyState( key );
}
+BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info )
+{
+ if (!unix_funcs) return FALSE;
+ return unix_funcs->pNtUserGetCursorInfo( info );
+}
+
LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info,
UINT32 *num_mode_info )
{
diff --git a/include/ntuser.h b/include/ntuser.h
index fdc33ce7e70..8730c739b11 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -205,6 +205,7 @@ HWND WINAPI NtUserGetClipboardViewer(void);
HCURSOR WINAPI NtUserGetCursor(void);
HCURSOR WINAPI NtUserGetCursorFrameInfo( HCURSOR hCursor, DWORD istep, DWORD *rate_jiffies,
DWORD *num_steps );
+BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info );
LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info,
UINT32 *num_mode_info );
UINT WINAPI NtUserGetDoubleClickTime(void);
More information about the wine-cvs
mailing list