Commit 0b876238 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user.exe: Use win32u directly for cursor icon handle support.

parent 747f7b54
...@@ -2590,17 +2590,15 @@ HWND create_window16( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE instance, ...@@ -2590,17 +2590,15 @@ HWND create_window16( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE instance,
} }
/*********************************************************************** static void WINAPI User16CallFreeIcon( ULONG *param, ULONG size )
* free_icon_param
*/
static void free_icon_param( ULONG_PTR param )
{ {
GlobalFree16( LOWORD(param) ); GlobalFree16( LOWORD(*param) );
} }
void register_wow_handlers(void) void register_wow_handlers(void)
{ {
void **callback_table = NtCurrentTeb()->Peb->KernelCallbackTable;
static const struct wow_handlers16 handlers16 = static const struct wow_handlers16 handlers16 =
{ {
button_proc16, button_proc16,
...@@ -2614,8 +2612,9 @@ void register_wow_handlers(void) ...@@ -2614,8 +2612,9 @@ void register_wow_handlers(void)
create_window16, create_window16,
call_window_proc_Ato16, call_window_proc_Ato16,
call_dialog_proc_Ato16, call_dialog_proc_Ato16,
free_icon_param
}; };
callback_table[NtUserCallFreeIcon] = User16CallFreeIcon;
UserRegisterWowHandlers( &handlers16, &wow_handlers32 ); UserRegisterWowHandlers( &handlers16, &wow_handlers32 );
} }
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "winbase.h" #include "winbase.h"
#include "wownt32.h" #include "wownt32.h"
#include "user_private.h" #include "user_private.h"
#include "ntuser.h"
#include "wine/list.h" #include "wine/list.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -299,7 +300,7 @@ static HICON store_icon_32( HICON16 icon16, HICON icon ) ...@@ -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( &ret, (char *)(ptr + 1) + and_size + xor_size, sizeof(ret) );
memcpy( (char *)(ptr + 1) + and_size + xor_size, &icon, sizeof(icon) ); 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 ); release_icon_ptr( icon16, ptr );
} }
...@@ -341,7 +342,7 @@ HICON get_icon_32( HICON16 icon16 ) ...@@ -341,7 +342,7 @@ HICON get_icon_32( HICON16 icon16 )
DeleteObject( iinfo.hbmMask ); DeleteObject( iinfo.hbmMask );
DeleteObject( iinfo.hbmColor ); DeleteObject( iinfo.hbmColor );
memcpy( (char *)(ptr + 1) + xor_size + and_size, &ret, sizeof(ret) ); 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 ); release_icon_ptr( icon16, ptr );
...@@ -352,7 +353,7 @@ HICON get_icon_32( HICON16 icon16 ) ...@@ -352,7 +353,7 @@ HICON get_icon_32( HICON16 icon16 )
/* retrieve the 16-bit counterpart of a 32-bit icon, creating it if needed */ /* retrieve the 16-bit counterpart of a 32-bit icon, creating it if needed */
HICON16 get_icon_16( HICON icon ) HICON16 get_icon_16( HICON icon )
{ {
HICON16 ret = wow_handlers32.get_icon_param( icon ); HICON16 ret = NtUserCallOneParam( HandleToUlong(icon), NtUserGetIconParam );
if (!ret) if (!ret)
{ {
......
...@@ -45,7 +45,6 @@ struct wow_handlers16 ...@@ -45,7 +45,6 @@ struct wow_handlers16
HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL); HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL);
LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*); LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
LRESULT (*call_dialog_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 struct wow_handlers32
...@@ -63,8 +62,6 @@ struct wow_handlers32 ...@@ -63,8 +62,6 @@ struct wow_handlers32
WNDPROC (*alloc_winproc)(WNDPROC,BOOL); WNDPROC (*alloc_winproc)(WNDPROC,BOOL);
struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL); struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL);
INT (*dialog_box_loop)(HWND,HWND); 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; extern struct wow_handlers32 wow_handlers32 DECLSPEC_HIDDEN;
......
...@@ -73,7 +73,6 @@ struct wow_handlers16 ...@@ -73,7 +73,6 @@ struct wow_handlers16
HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL); HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,BOOL);
LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*); LRESULT (*call_window_proc)(HWND,UINT,WPARAM,LPARAM,LRESULT*,void*);
LRESULT (*call_dialog_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 struct wow_handlers32
...@@ -91,8 +90,6 @@ struct wow_handlers32 ...@@ -91,8 +90,6 @@ struct wow_handlers32
WNDPROC (*alloc_winproc)(WNDPROC,BOOL); WNDPROC (*alloc_winproc)(WNDPROC,BOOL);
struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL); struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL);
INT (*dialog_box_loop)(HWND,HWND); 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; extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN;
...@@ -105,9 +102,6 @@ extern LRESULT MDIClientWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HI ...@@ -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 ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
extern LRESULT StaticWndProc_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 */ /* Class functions */
struct tagCLASS; /* opaque structure */ struct tagCLASS; /* opaque structure */
struct tagWND; struct tagWND;
......
...@@ -79,16 +79,6 @@ static void free_icon_frame( struct cursoricon_frame *frame ) ...@@ -79,16 +79,6 @@ static void free_icon_frame( struct cursoricon_frame *frame )
if (frame->mask) DeleteObject( frame->mask ); 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 * map_fileW
......
...@@ -185,11 +185,6 @@ static const struct user_callbacks user_funcs = ...@@ -185,11 +185,6 @@ static const struct user_callbacks user_funcs =
unregister_imm, 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 ) static BOOL WINAPI User32LoadDriver( const WCHAR *path, ULONG size )
{ {
return LoadLibraryW( path ) != NULL; return LoadLibraryW( path ) != NULL;
...@@ -201,7 +196,6 @@ static const void *kernel_callback_table[NtUserCallCount] = ...@@ -201,7 +196,6 @@ static const void *kernel_callback_table[NtUserCallCount] =
User32CallWinEventHook, User32CallWinEventHook,
User32CallWindowsHook, User32CallWindowsHook,
User32LoadDriver, User32LoadDriver,
User32CallFreeIcon,
}; };
......
...@@ -1031,8 +1031,6 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo ...@@ -1031,8 +1031,6 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo
orig->alloc_winproc = WINPROC_AllocProc; orig->alloc_winproc = WINPROC_AllocProc;
orig->get_dialog_info = DIALOG_get_info; orig->get_dialog_info = DIALOG_get_info;
orig->dialog_box_loop = DIALOG_DoDialogBox; orig->dialog_box_loop = DIALOG_DoDialogBox;
orig->get_icon_param = get_icon_param;
orig->set_icon_param = set_icon_param;
wow_handlers = *new; wow_handlers = *new;
} }
...@@ -1050,7 +1048,6 @@ struct wow_handlers16 wow_handlers = ...@@ -1050,7 +1048,6 @@ struct wow_handlers16 wow_handlers =
WIN_CreateWindowEx, WIN_CreateWindowEx,
NULL, /* call_window_proc */ NULL, /* call_window_proc */
NULL, /* call_dialog_proc */ NULL, /* call_dialog_proc */
NULL, /* free_icon_param */
}; };
static const struct user_client_procs client_procsA = static const struct user_client_procs client_procsA =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment