Module: wine Branch: master Commit: 0b87623819baec326cb48d605bc0087614cb8974 URL: https://source.winehq.org/git/wine.git/?a=commit;h=0b87623819baec326cb48d605...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Mar 21 14:14:30 2022 +0100
user.exe: Use win32u directly for cursor icon handle support.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/user.exe16/message.c | 11 +++++------ dlls/user.exe16/user.c | 7 ++++--- dlls/user.exe16/user_private.h | 3 --- dlls/user32/controls.h | 6 ------ dlls/user32/cursoricon.c | 10 ---------- dlls/user32/user_main.c | 6 ------ dlls/user32/winproc.c | 3 --- 7 files changed, 9 insertions(+), 37 deletions(-)
diff --git a/dlls/user.exe16/message.c b/dlls/user.exe16/message.c index 6d3de0f77e6..915585267d6 100644 --- a/dlls/user.exe16/message.c +++ b/dlls/user.exe16/message.c @@ -2590,17 +2590,15 @@ HWND create_window16( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE instance, }
-/*********************************************************************** - * free_icon_param - */ -static void free_icon_param( ULONG_PTR param ) +static void WINAPI User16CallFreeIcon( ULONG *param, ULONG size ) { - GlobalFree16( LOWORD(param) ); + GlobalFree16( LOWORD(*param) ); }
void register_wow_handlers(void) { + void **callback_table = NtCurrentTeb()->Peb->KernelCallbackTable; static const struct wow_handlers16 handlers16 = { button_proc16, @@ -2614,8 +2612,9 @@ void register_wow_handlers(void) create_window16, call_window_proc_Ato16, call_dialog_proc_Ato16, - free_icon_param };
+ callback_table[NtUserCallFreeIcon] = User16CallFreeIcon; + UserRegisterWowHandlers( &handlers16, &wow_handlers32 ); } diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c index 4a56a67389b..39adb874125 100644 --- a/dlls/user.exe16/user.c +++ b/dlls/user.exe16/user.c @@ -31,6 +31,7 @@ #include "winbase.h" #include "wownt32.h" #include "user_private.h" +#include "ntuser.h" #include "wine/list.h" #include "wine/debug.h"
@@ -299,7 +300,7 @@ static HICON store_icon_32( HICON16 icon16, HICON icon ) { memcpy( &ret, (char *)(ptr + 1) + and_size + xor_size, sizeof(ret) ); memcpy( (char *)(ptr + 1) + and_size + xor_size, &icon, sizeof(icon) ); - wow_handlers32.set_icon_param( icon, icon16 ); + NtUserCallTwoParam( HandleToUlong(icon), icon16, NtUserSetIconParam ); } release_icon_ptr( icon16, ptr ); } @@ -341,7 +342,7 @@ HICON get_icon_32( HICON16 icon16 ) DeleteObject( iinfo.hbmMask ); DeleteObject( iinfo.hbmColor ); memcpy( (char *)(ptr + 1) + xor_size + and_size, &ret, sizeof(ret) ); - wow_handlers32.set_icon_param( ret, icon16 ); + NtUserCallTwoParam( HandleToUlong(ret), icon16, NtUserSetIconParam ); } } release_icon_ptr( icon16, ptr ); @@ -352,7 +353,7 @@ HICON get_icon_32( HICON16 icon16 ) /* retrieve the 16-bit counterpart of a 32-bit icon, creating it if needed */ HICON16 get_icon_16( HICON icon ) { - HICON16 ret = wow_handlers32.get_icon_param( icon ); + HICON16 ret = NtUserCallOneParam( HandleToUlong(icon), NtUserGetIconParam );
if (!ret) { diff --git a/dlls/user.exe16/user_private.h b/dlls/user.exe16/user_private.h index afd75f0b096..83c57379d35 100644 --- a/dlls/user.exe16/user_private.h +++ b/dlls/user.exe16/user_private.h @@ -45,7 +45,6 @@ struct wow_handlers16 HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL); LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*); LRESULT (*call_dialog_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*); - void (*free_icon_param)(ULONG_PTR); };
struct wow_handlers32 @@ -63,8 +62,6 @@ struct wow_handlers32 WNDPROC (*alloc_winproc)(WNDPROC,BOOL); struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL); INT (*dialog_box_loop)(HWND,HWND); - ULONG_PTR (*get_icon_param)(HICON); - ULONG_PTR (*set_icon_param)(HICON,ULONG_PTR); };
extern struct wow_handlers32 wow_handlers32 DECLSPEC_HIDDEN; diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 574143de438..47375590e29 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -73,7 +73,6 @@ struct wow_handlers16 HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL); LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*); LRESULT (*call_dialog_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*); - void (*free_icon_param)(ULONG_PTR); };
struct wow_handlers32 @@ -91,8 +90,6 @@ struct wow_handlers32 WNDPROC (*alloc_winproc)(WNDPROC,BOOL); struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL); INT (*dialog_box_loop)(HWND,HWND); - ULONG_PTR (*get_icon_param)(HICON); - ULONG_PTR (*set_icon_param)(HICON,ULONG_PTR); };
extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN; @@ -105,9 +102,6 @@ extern LRESULT MDIClientWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HI extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN; extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
-extern ULONG_PTR get_icon_param( HICON handle ) DECLSPEC_HIDDEN; -extern ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param ) DECLSPEC_HIDDEN; - /* Class functions */ struct tagCLASS; /* opaque structure */ struct tagWND; diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index abf3a5dac53..9e6712f606b 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -79,16 +79,6 @@ static void free_icon_frame( struct cursoricon_frame *frame ) if (frame->mask) DeleteObject( frame->mask ); }
-ULONG_PTR get_icon_param( HICON handle ) -{ - return NtUserCallOneParam( HandleToUlong(handle), NtUserGetIconParam ); -} - -ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param ) -{ - return NtUserCallTwoParam( HandleToUlong(handle), param, NtUserSetIconParam ); -} -
/*********************************************************************** * map_fileW diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 93274a773cc..88e2fc4eec1 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -185,11 +185,6 @@ static const struct user_callbacks user_funcs = unregister_imm, };
-static void WINAPI User32CallFreeIcon( ULONG *param, ULONG size ) -{ - wow_handlers.free_icon_param( *param ); -} - static BOOL WINAPI User32LoadDriver( const WCHAR *path, ULONG size ) { return LoadLibraryW( path ) != NULL; @@ -201,7 +196,6 @@ static const void *kernel_callback_table[NtUserCallCount] = User32CallWinEventHook, User32CallWindowsHook, User32LoadDriver, - User32CallFreeIcon, };
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index 1e12efe890b..cc547427270 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -1031,8 +1031,6 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo orig->alloc_winproc = WINPROC_AllocProc; orig->get_dialog_info = DIALOG_get_info; orig->dialog_box_loop = DIALOG_DoDialogBox; - orig->get_icon_param = get_icon_param; - orig->set_icon_param = set_icon_param;
wow_handlers = *new; } @@ -1050,7 +1048,6 @@ struct wow_handlers16 wow_handlers = WIN_CreateWindowEx, NULL, /* call_window_proc */ NULL, /* call_dialog_proc */ - NULL, /* free_icon_param */ };
static const struct user_client_procs client_procsA =