Commit 439fb251 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move get_icon_param and set_icon_param from user32.

parent 4f3f1c98
......@@ -81,31 +81,12 @@ static void free_icon_frame( struct cursoricon_frame *frame )
ULONG_PTR get_icon_param( HICON handle )
{
ULONG_PTR ret = 0;
struct cursoricon_object *obj = get_user_handle_ptr( handle, NTUSER_OBJ_ICON );
if (obj == OBJ_OTHER_PROCESS) WARN( "icon handle %p from other process\n", handle );
else if (obj)
{
ret = obj->param;
release_user_handle_ptr( obj );
}
return ret;
return NtUserCallOneParam( HandleToUlong(handle), NtUserGetIconParam );
}
ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param )
{
ULONG_PTR ret = 0;
struct cursoricon_object *obj = get_user_handle_ptr( handle, NTUSER_OBJ_ICON );
if (obj == OBJ_OTHER_PROCESS) WARN( "icon handle %p from other process\n", handle );
else if (obj)
{
ret = obj->param;
obj->param = param;
release_user_handle_ptr( obj );
}
return ret;
return NtUserCallTwoParam( HandleToUlong(handle), param, NtUserSetIconParam );
}
......
......@@ -37,6 +37,30 @@
WINE_DEFAULT_DEBUG_CHANNEL(cursor);
WINE_DECLARE_DEBUG_CHANNEL(icon);
struct cursoricon_object
{
struct user_object obj; /* object header */
struct list entry; /* entry in shared icons list */
ULONG_PTR param; /* opaque param used by 16-bit code */
UNICODE_STRING module; /* module for icons loaded from resources */
WCHAR *resname; /* resource name for icons loaded from resources */
HRSRC rsrc; /* resource for shared icons */
BOOL is_shared; /* whether this object is shared */
BOOL is_icon; /* whether icon or cursor */
BOOL is_ani; /* whether this object is a static cursor or an animated cursor */
UINT delay; /* delay between this frame and the next (in jiffies) */
union
{
struct cursoricon_frame frame; /* frame-specific icon data */
struct
{
UINT num_frames; /* number of frames in the icon/cursor */
UINT num_steps; /* number of sequence steps in the icon/cursor */
HICON *frames; /* list of animated cursor frames */
} ani;
};
};
static struct list icon_cache = LIST_INIT( icon_cache );
static struct cursoricon_object *get_icon_ptr( HICON handle )
......@@ -733,3 +757,32 @@ failed:
release_user_handle_ptr( obj );
return result;
}
ULONG_PTR get_icon_param( HICON handle )
{
ULONG_PTR ret = 0;
struct cursoricon_object *obj = get_user_handle_ptr( handle, NTUSER_OBJ_ICON );
if (obj == OBJ_OTHER_PROCESS) WARN( "icon handle %p from other process\n", handle );
else if (obj)
{
ret = obj->param;
release_user_handle_ptr( obj );
}
return ret;
}
ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param )
{
ULONG_PTR ret = 0;
struct cursoricon_object *obj = get_user_handle_ptr( handle, NTUSER_OBJ_ICON );
if (obj == OBJ_OTHER_PROCESS) WARN( "icon handle %p from other process\n", handle );
else if (obj)
{
ret = obj->param;
obj->param = param;
release_user_handle_ptr( obj );
}
return ret;
}
......@@ -125,30 +125,6 @@ struct user_key_state_info
BYTE state[256]; /* State for each key */
};
struct cursoricon_object
{
struct user_object obj; /* object header */
struct list entry; /* entry in shared icons list */
ULONG_PTR param; /* opaque param used by 16-bit code */
UNICODE_STRING module; /* module for icons loaded from resources */
LPWSTR resname; /* resource name for icons loaded from resources */
HRSRC rsrc; /* resource for shared icons */
BOOL is_shared; /* whether this object is shared */
BOOL is_icon; /* whether icon or cursor */
BOOL is_ani; /* whether this object is a static cursor or an animated cursor */
UINT delay; /* delay between this frame and the next (in jiffies) */
union
{
struct cursoricon_frame frame; /* frame-specific icon data */
struct
{
UINT num_frames; /* number of frames in the icon/cursor */
UINT num_steps; /* number of sequence steps in the icon/cursor */
HICON *frames; /* list of animated cursor frames */
} ani;
};
};
/* cursoricon.c */
HICON alloc_cursoricon_handle( BOOL is_icon ) DECLSPEC_HIDDEN;
......
......@@ -4558,6 +4558,8 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
return get_clip_cursor( (RECT *)arg );
case NtUserGetCursorPos:
return get_cursor_pos( (POINT *)arg );
case NtUserGetIconParam:
return get_icon_param( UlongToHandle(arg) );
case NtUserGetSysColor:
return get_sys_color( arg );
case NtUserRealizePalette:
......@@ -4616,6 +4618,8 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
return mirror_window_region( UlongToHandle(arg1), UlongToHandle(arg2) );
case NtUserMonitorFromRect:
return HandleToUlong( monitor_from_rect( (const RECT *)arg1, arg2, get_thread_dpi() ));
case NtUserSetIconParam:
return set_icon_param( UlongToHandle(arg1), arg2 );
case NtUserUnhookWindowsHook:
return unhook_windows_hook( arg1, (HOOKPROC)arg2 );
/* temporary exports */
......
......@@ -247,6 +247,8 @@ struct unix_funcs
/* cursoricon.c */
extern HICON alloc_cursoricon_handle( BOOL is_icon ) DECLSPEC_HIDDEN;
extern BOOL get_clip_cursor( RECT *rect ) 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;
/* hook.c */
extern BOOL unhook_windows_hook( INT id, HOOKPROC proc ) DECLSPEC_HIDDEN;
......
......@@ -80,6 +80,7 @@ enum
NtUserCreateCursorIcon,
NtUserGetClipCursor,
NtUserGetCursorPos,
NtUserGetIconParam,
NtUserGetPrimaryMonitorRect,
NtUserGetSysColor,
NtUserGetSysColorBrush,
......@@ -104,6 +105,7 @@ enum
NtUserGetSystemMetricsForDpi,
NtUserMirrorRgn,
NtUserMonitorFromRect,
NtUserSetIconParam,
NtUserUnhookWindowsHook,
/* temporary exports */
NtUserAllocHandle,
......
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