Jacek Caban : win32u: Move NtUserGetClipboardViewer implementation from user32.

Alexandre Julliard julliard at winehq.org
Mon Nov 15 16:01:27 CST 2021


Module: wine
Branch: master
Commit: e2ede91cf1e3a6231c3158ee1c0cb76995cedfca
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e2ede91cf1e3a6231c3158ee1c0cb76995cedfca

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Nov 12 12:53:59 2021 +0100

win32u: Move NtUserGetClipboardViewer 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/clipboard.c | 19 -------------------
 dlls/user32/user32.spec |  2 +-
 dlls/win32u/clipboard.c | 17 +++++++++++++++++
 dlls/win32u/syscall.c   |  1 +
 dlls/win32u/win32u.spec |  2 +-
 dlls/wow64win/syscall.h |  1 +
 dlls/wow64win/user.c    |  5 +++++
 include/ntuser.h        |  1 +
 8 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c
index a1fe923ffb3..8b00fcf5c9e 100644
--- a/dlls/user32/clipboard.c
+++ b/dlls/user32/clipboard.c
@@ -794,25 +794,6 @@ HWND WINAPI SetClipboardViewer( HWND hwnd )
 }
 
 
-/**************************************************************************
- *              GetClipboardViewer (USER32.@)
- */
-HWND WINAPI GetClipboardViewer(void)
-{
-    HWND hWndViewer = 0;
-
-    SERVER_START_REQ( get_clipboard_info )
-    {
-        if (!wine_server_call_err( req )) hWndViewer = wine_server_ptr_handle( reply->viewer );
-    }
-    SERVER_END_REQ;
-
-    TRACE( "returning %p\n", hWndViewer );
-
-    return hWndViewer;
-}
-
-
 /**************************************************************************
  *              ChangeClipboardChain (USER32.@)
  */
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index 7592b477b6b..c464664e581 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -279,7 +279,7 @@
 @ stdcall GetClipboardFormatNameW(long ptr long) NtUserGetClipboardFormatName
 @ stdcall GetClipboardOwner() NtUserGetClipboardOwner
 @ stdcall GetClipboardSequenceNumber ()
-@ stdcall GetClipboardViewer()
+@ stdcall GetClipboardViewer() NtUserGetClipboardViewer
 @ stdcall GetComboBoxInfo(long ptr)
 @ stdcall GetCurrentInputMessageSource(ptr)
 @ stdcall GetCursor()
diff --git a/dlls/win32u/clipboard.c b/dlls/win32u/clipboard.c
index 4e584ceb71c..d592e007a6e 100644
--- a/dlls/win32u/clipboard.c
+++ b/dlls/win32u/clipboard.c
@@ -157,3 +157,20 @@ HWND WINAPI NtUserGetClipboardOwner(void)
     TRACE( "returning %p\n", owner );
     return owner;
 }
+
+/**************************************************************************
+ *           NtUserGetClipboardViewer    (win32u.@)
+ */
+HWND WINAPI NtUserGetClipboardViewer(void)
+{
+    HWND viewer = 0;
+
+    SERVER_START_REQ( get_clipboard_info )
+    {
+        if (!wine_server_call_err( req )) viewer = wine_server_ptr_handle( reply->viewer );
+    }
+    SERVER_END_REQ;
+
+    TRACE( "returning %p\n", viewer );
+    return viewer;
+}
diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c
index 9bc6265e79b..699c0667b16 100644
--- a/dlls/win32u/syscall.c
+++ b/dlls/win32u/syscall.c
@@ -107,6 +107,7 @@ static void * const syscalls[] =
     NtUserCreateWindowStation,
     NtUserGetClipboardFormatName,
     NtUserGetClipboardOwner,
+    NtUserGetClipboardViewer,
     NtUserGetLayeredWindowAttributes,
     NtUserGetObjectInformation,
     NtUserGetProcessWindowStation,
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index 34a1caf6bcd..9c98aa645b9 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -906,7 +906,7 @@
 @ stdcall -syscall NtUserGetClipboardFormatName(long ptr long)
 @ stdcall -syscall NtUserGetClipboardOwner()
 @ stub NtUserGetClipboardSequenceNumber
-@ stub NtUserGetClipboardViewer
+@ stdcall -syscall NtUserGetClipboardViewer()
 @ stub NtUserGetComboBoxInfo
 @ stub NtUserGetControlBrush
 @ stub NtUserGetControlColor
diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h
index 62375014010..79179bcf1b2 100644
--- a/dlls/wow64win/syscall.h
+++ b/dlls/wow64win/syscall.h
@@ -94,6 +94,7 @@
     SYSCALL_ENTRY( NtUserCreateWindowStation ) \
     SYSCALL_ENTRY( NtUserGetClipboardFormatName ) \
     SYSCALL_ENTRY( NtUserGetClipboardOwner ) \
+    SYSCALL_ENTRY( NtUserGetClipboardViewer ) \
     SYSCALL_ENTRY( NtUserGetLayeredWindowAttributes ) \
     SYSCALL_ENTRY( NtUserGetObjectInformation ) \
     SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c
index f0d520bfaa4..7b34d8140a0 100644
--- a/dlls/wow64win/user.c
+++ b/dlls/wow64win/user.c
@@ -204,3 +204,8 @@ NTSTATUS WINAPI wow64_NtUserGetClipboardOwner( UINT *args )
 {
     return HandleToUlong( NtUserGetClipboardOwner() );
 }
+
+NTSTATUS WINAPI wow64_NtUserGetClipboardViewer( UINT *args )
+{
+    return HandleToUlong( NtUserGetClipboardViewer() );
+}
diff --git a/include/ntuser.h b/include/ntuser.h
index 27fb6b60bc3..0fed1368acf 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -33,6 +33,7 @@ HWINSTA WINAPI NtUserCreateWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK m
                                           ULONG arg4, ULONG arg5, ULONG arg6, ULONG arg7 );
 INT     WINAPI NtUserGetClipboardFormatName( UINT format, WCHAR *buffer, INT maxlen );
 HWND    WINAPI NtUserGetClipboardOwner(void);
+HWND    WINAPI NtUserGetClipboardViewer(void);
 BOOL    WINAPI NtUserGetLayeredWindowAttributes( HWND hwnd, COLORREF *key, BYTE *alpha, DWORD *flags );
 BOOL    WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info,
                                            DWORD len, DWORD *needed );




More information about the wine-cvs mailing list