win32u: Move NtUserSetClipboardViewer implementation from user32.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-04-22 14:45:43 +02:00 committed by Alexandre Julliard
parent 172ae86945
commit c38e287bef
8 changed files with 37 additions and 27 deletions

View File

@ -702,31 +702,6 @@ BOOL WINAPI EmptyClipboard(void)
}
/**************************************************************************
* SetClipboardViewer (USER32.@)
*/
HWND WINAPI SetClipboardViewer( HWND hwnd )
{
HWND prev = 0, owner = 0;
SERVER_START_REQ( set_clipboard_viewer )
{
req->viewer = wine_server_user_handle( hwnd );
if (!wine_server_call_err( req ))
{
prev = wine_server_ptr_handle( reply->old_viewer );
owner = wine_server_ptr_handle( reply->owner );
}
}
SERVER_END_REQ;
if (hwnd) SendNotifyMessageW( hwnd, WM_DRAWCLIPBOARD, (WPARAM)owner, 0 );
TRACE( "%p returning %p\n", hwnd, prev );
return prev;
}
/**************************************************************************
* ChangeClipboardChain (USER32.@)
*/

View File

@ -655,7 +655,7 @@
@ stdcall SetClassLongW(long long long)
@ stdcall SetClassWord(long long long) NtUserSetClassWord
@ stdcall SetClipboardData(long long)
@ stdcall SetClipboardViewer(long)
@ stdcall SetClipboardViewer(long) NtUserSetClipboardViewer
@ stdcall SetCoalescableTimer(long long long ptr long) NtUserSetTimer
# @ stub SetConsoleReserveKeys
@ stdcall -import SetCursor(long) NtUserSetCursor

View File

@ -231,6 +231,32 @@ HWND WINAPI NtUserGetClipboardOwner(void)
return owner;
}
/**************************************************************************
* NtUserSetClipboardViewer (win32u.@)
*/
HWND WINAPI NtUserSetClipboardViewer( HWND hwnd )
{
HWND prev = 0, owner = 0;
SERVER_START_REQ( set_clipboard_viewer )
{
req->viewer = wine_server_user_handle( hwnd );
if (!wine_server_call_err( req ))
{
prev = wine_server_ptr_handle( reply->old_viewer );
owner = wine_server_ptr_handle( reply->owner );
}
}
SERVER_END_REQ;
if (hwnd)
NtUserMessageCall( hwnd, WM_DRAWCLIPBOARD, (WPARAM)owner, 0,
NULL, NtUserSendNotifyMessage, FALSE );
TRACE( "%p returning %p\n", hwnd, prev );
return prev;
}
/**************************************************************************
* NtUserGetClipboardViewer (win32u.@)
*/

View File

@ -1192,6 +1192,7 @@ static struct unix_funcs unix_funcs =
NtUserSetClassLong,
NtUserSetClassLongPtr,
NtUserSetClassWord,
NtUserSetClipboardViewer,
NtUserSetCursor,
NtUserSetCursorIconData,
NtUserSetCursorPos,

View File

@ -1175,7 +1175,7 @@
@ stdcall NtUserSetClassLongPtr(long long long long)
@ stdcall NtUserSetClassWord(long long long)
@ stub NtUserSetClipboardData
@ stub NtUserSetClipboardViewer
@ stdcall NtUserSetClipboardViewer(long)
@ stub NtUserSetCoreWindow
@ stub NtUserSetCoreWindowPartner
@ stdcall NtUserSetCursor(long)

View File

@ -263,6 +263,7 @@ struct unix_funcs
DWORD (WINAPI *pNtUserSetClassLong)( HWND hwnd, INT offset, LONG newval, BOOL ansi );
ULONG_PTR (WINAPI *pNtUserSetClassLongPtr)( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
WORD (WINAPI *pNtUserSetClassWord)( HWND hwnd, INT offset, WORD newval );
HWND (WINAPI *pNtUserSetClipboardViewer)( HWND hwnd );
HCURSOR (WINAPI *pNtUserSetCursor)( HCURSOR cursor );
BOOL (WINAPI *pNtUserSetCursorIconData)( HCURSOR cursor, UNICODE_STRING *module,
UNICODE_STRING *res_name, struct cursoricon_desc *desc );

View File

@ -1088,6 +1088,12 @@ WORD WINAPI NtUserSetClassWord( HWND hwnd, INT offset, WORD newval )
return unix_funcs->pNtUserSetClassWord( hwnd, offset, newval );
}
HWND WINAPI NtUserSetClipboardViewer( HWND hwnd )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserSetClipboardViewer( hwnd );
}
BOOL WINAPI NtUserSetCursorIconData( HCURSOR cursor, UNICODE_STRING *module, UNICODE_STRING *res_name,
struct cursoricon_desc *desc )
{

View File

@ -547,6 +547,7 @@ HWND WINAPI NtUserSetCapture( HWND hwnd );
DWORD WINAPI NtUserSetClassLong( HWND hwnd, INT offset, LONG newval, BOOL ansi );
ULONG_PTR WINAPI NtUserSetClassLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
WORD WINAPI NtUserSetClassWord( HWND hwnd, INT offset, WORD newval );
HWND WINAPI NtUserSetClipboardViewer( HWND hwnd );
HCURSOR WINAPI NtUserSetCursor( HCURSOR cursor );
BOOL WINAPI NtUserSetCursorIconData( HCURSOR cursor, UNICODE_STRING *module, UNICODE_STRING *res_name,
struct cursoricon_desc *desc );