Jacek Caban : win32u: Move NtUserSetProcessWindowStation implementation from user32.

Alexandre Julliard julliard at winehq.org
Wed Oct 13 15:59:27 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Oct 13 14:53:22 2021 +0200

win32u: Move NtUserSetProcessWindowStation implementation from user32.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/user32.spec  |  2 +-
 dlls/user32/user_main.c  |  2 +-
 dlls/user32/winstation.c | 17 -----------------
 dlls/win32u/syscall.c    |  1 +
 dlls/win32u/win32u.spec  |  2 +-
 dlls/win32u/winstation.c | 16 ++++++++++++++++
 dlls/wow64win/syscall.h  |  3 ++-
 dlls/wow64win/user.c     |  7 +++++++
 include/ntuser.h         |  1 +
 9 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index c50740732e2..19bf5ce1b8e 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -692,7 +692,7 @@
 @ stdcall SetProcessDefaultLayout(long)
 @ stdcall SetProcessDpiAwarenessContext(long)
 @ stdcall SetProcessDpiAwarenessInternal(long)
-@ stdcall SetProcessWindowStation(long)
+@ stdcall SetProcessWindowStation(long) NtUserSetProcessWindowStation
 @ stdcall SetProgmanWindow (long)
 @ stdcall SetPropA(long str long)
 @ stdcall SetPropW(long wstr long)
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index f037d1684c4..d7f320575cb 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -295,7 +295,7 @@ static void winstation_init(void)
         handle = CreateWindowStationW( winstation ? winstation : L"WinSta0", 0, WINSTA_ALL_ACCESS, NULL );
         if (handle)
         {
-            SetProcessWindowStation( handle );
+            NtUserSetProcessWindowStation( handle );
             /* only WinSta0 is visible */
             if (!winstation || !wcsicmp( winstation, L"WinSta0" ))
             {
diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c
index 245cd6c0f40..37ae9e9ceb2 100644
--- a/dlls/user32/winstation.c
+++ b/dlls/user32/winstation.c
@@ -203,23 +203,6 @@ HWINSTA WINAPI OpenWindowStationW( LPCWSTR name, BOOL inherit, ACCESS_MASK acces
 }
 
 
-/***********************************************************************
- *              SetProcessWindowStation  (USER32.@)
- */
-BOOL WINAPI SetProcessWindowStation( HWINSTA handle )
-{
-    BOOL ret;
-
-    SERVER_START_REQ( set_process_winstation )
-    {
-        req->handle = wine_server_obj_handle( handle );
-        ret = !wine_server_call_err( req );
-    }
-    SERVER_END_REQ;
-    return ret;
-}
-
-
 /******************************************************************************
  *              EnumWindowStationsA  (USER32.@)
  */
diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c
index 859dda9780d..132c55117a7 100644
--- a/dlls/win32u/syscall.c
+++ b/dlls/win32u/syscall.c
@@ -96,6 +96,7 @@ static void * const syscalls[] =
     NtGdiTransformPoints,
     NtUserCloseWindowStation,
     NtUserGetProcessWindowStation,
+    NtUserSetProcessWindowStation,
 };
 
 static BYTE arguments[ARRAY_SIZE(syscalls)];
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index 7427c8e10d0..24625316f9e 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -1221,7 +1221,7 @@
 @ stub NtUserSetProcessMousewheelRoutingMode
 @ stub NtUserSetProcessRestrictionExemption
 @ stub NtUserSetProcessUIAccessZorder
-@ stub NtUserSetProcessWindowStation
+@ stdcall -syscall NtUserSetProcessWindowStation(long)
 @ stub NtUserSetProp
 @ stub NtUserSetScrollInfo
 @ stub NtUserSetSensorPresence
diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c
index 3a6ef8059b4..153a83e313d 100644
--- a/dlls/win32u/winstation.c
+++ b/dlls/win32u/winstation.c
@@ -59,3 +59,19 @@ HWINSTA WINAPI NtUserGetProcessWindowStation(void)
     SERVER_END_REQ;
     return ret;
 }
+
+/***********************************************************************
+ *           NtUserSetProcessWindowStation  (win32u.@)
+ */
+BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle )
+{
+    BOOL ret;
+
+    SERVER_START_REQ( set_process_winstation )
+    {
+        req->handle = wine_server_obj_handle( handle );
+        ret = !wine_server_call_err( req );
+    }
+    SERVER_END_REQ;
+    return ret;
+}
diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h
index 0a905e131d8..ccf0574c639 100644
--- a/dlls/wow64win/syscall.h
+++ b/dlls/wow64win/syscall.h
@@ -82,6 +82,7 @@
     SYSCALL_ENTRY( NtGdiSwapBuffers ) \
     SYSCALL_ENTRY( NtGdiTransformPoints ) \
     SYSCALL_ENTRY( NtUserCloseWindowStation ) \
-    SYSCALL_ENTRY( NtUserGetProcessWindowStation )
+    SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
+    SYSCALL_ENTRY( NtUserSetProcessWindowStation )
 
 #endif /* __WOW64WIN_SYSCALL_H */
diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c
index 56156e6fdeb..cf028383c21 100644
--- a/dlls/wow64win/user.c
+++ b/dlls/wow64win/user.c
@@ -38,3 +38,10 @@ NTSTATUS WINAPI wow64_NtUserGetProcessWindowStation( UINT *args )
 {
     return HandleToUlong( NtUserGetProcessWindowStation() );
 }
+
+NTSTATUS WINAPI wow64_NtUserSetProcessWindowStation( UINT *args )
+{
+    HWINSTA handle = get_handle( &args );
+
+    return NtUserSetProcessWindowStation( handle );
+}
diff --git a/include/ntuser.h b/include/ntuser.h
index 7ea4ccd4bdf..eac4f0da092 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -24,5 +24,6 @@
 
 BOOL    WINAPI NtUserCloseWindowStation( HWINSTA handle );
 HWINSTA WINAPI NtUserGetProcessWindowStation(void);
+BOOL    WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
 
 #endif /* _NTUSER_ */




More information about the wine-cvs mailing list