Module: wine Branch: master Commit: 588dc55e9e089f1939b9ce3fa9caff3cfca1d2ca URL: https://source.winehq.org/git/wine.git/?a=commit;h=588dc55e9e089f1939b9ce3fa...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Oct 13 14:52:53 2021 +0200
win32u: Move NtUserGetProcessWindowStation implementation from user32.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/user32/driver.c | 2 +- dlls/user32/sysparams.c | 2 +- dlls/user32/user32.spec | 2 +- dlls/user32/user_main.c | 2 +- dlls/user32/winstation.c | 19 +------------------ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/winstation.c | 16 ++++++++++++++++ dlls/wow64win/syscall.h | 3 ++- dlls/wow64win/user.c | 5 +++++ include/ntuser.h | 3 ++- 11 files changed, 32 insertions(+), 25 deletions(-)
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 7de45376740..183e596dcef 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -95,7 +95,7 @@ static const USER_DRIVER *load_driver(void) USEROBJECTFLAGS flags; HWINSTA winstation;
- winstation = GetProcessWindowStation(); + winstation = NtUserGetProcessWindowStation(); if (!GetUserObjectInformationA(winstation, UOI_FLAGS, &flags, sizeof(flags), NULL) || (flags.dwFlags & WSF_VISIBLE)) driver->pCreateWindow = nodrv_CreateWindow; diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 733acd3d3c6..8572b78a484 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -4120,7 +4120,7 @@ BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC pro TRACE("(%p, %p, %p, 0x%lx)\n", hdc, rect, proc, lp);
/* Report physical monitor information only if window station has visible display surfaces */ - winstation = GetProcessWindowStation(); + winstation = NtUserGetProcessWindowStation(); if (GetUserObjectInformationW( winstation, UOI_FLAGS, &flags, sizeof(flags), NULL )) is_winstation_visible = flags.dwFlags & WSF_VISIBLE;
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 21b45c911d1..c50740732e2 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -361,7 +361,7 @@ @ stdcall GetPriorityClipboardFormat(ptr long) @ stdcall GetProcessDefaultLayout(ptr) @ stdcall GetProcessDpiAwarenessInternal(long ptr) -@ stdcall GetProcessWindowStation() +@ stdcall GetProcessWindowStation() NtUserGetProcessWindowStation @ stdcall GetProgmanWindow () @ stdcall GetPropA(long str) @ stdcall GetPropW(long wstr) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 30e5d154d3d..f037d1684c4 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -290,7 +290,7 @@ static void winstation_init(void) }
/* set winstation if explicitly specified, or if we don't have one yet */ - if (buffer || !GetProcessWindowStation()) + if (buffer || !NtUserGetProcessWindowStation()) { handle = CreateWindowStationW( winstation ? winstation : L"WinSta0", 0, WINSTA_ALL_ACCESS, NULL ); if (handle) diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c index 057f0d75cb8..245cd6c0f40 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 }
-/****************************************************************************** - * GetProcessWindowStation (USER32.@) - */ -HWINSTA WINAPI GetProcessWindowStation(void) -{ - HWINSTA ret = 0; - - SERVER_START_REQ( get_process_winstation ) - { - if (!wine_server_call_err( req )) - ret = wine_server_ptr_handle( reply->handle ); - } - SERVER_END_REQ; - return ret; -} - - /*********************************************************************** * SetProcessWindowStation (USER32.@) */ @@ -472,7 +455,7 @@ BOOL WINAPI EnumDesktopsW( HWINSTA winsta, DESKTOPENUMPROCW func, LPARAM lparam NTSTATUS status;
if (!winsta) - winsta = GetProcessWindowStation(); + winsta = NtUserGetProcessWindowStation();
while (ret) { diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 596ec6bbba3..859dda9780d 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -95,6 +95,7 @@ static void * const syscalls[] = NtGdiSwapBuffers, NtGdiTransformPoints, NtUserCloseWindowStation, + NtUserGetProcessWindowStation, };
static BYTE arguments[ARRAY_SIZE(syscalls)]; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 92f9a143800..7427c8e10d0 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -979,7 +979,7 @@ @ stub NtUserGetPriorityClipboardFormat @ stub NtUserGetProcessDpiAwarenessContext @ stub NtUserGetProcessUIContextInformation -@ stub NtUserGetProcessWindowStation +@ stdcall -syscall NtUserGetProcessWindowStation() @ stub NtUserGetProp @ stub NtUserGetQueueStatus @ stub NtUserGetQueueStatusReadonly diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c index f50464f856d..3a6ef8059b4 100644 --- a/dlls/win32u/winstation.c +++ b/dlls/win32u/winstation.c @@ -43,3 +43,19 @@ BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle ) SERVER_END_REQ; return ret; } + +/*********************************************************************** + * NtUSerGetProcessWindowStation (win32u.@) + */ +HWINSTA WINAPI NtUserGetProcessWindowStation(void) +{ + HWINSTA ret = 0; + + SERVER_START_REQ( get_process_winstation ) + { + if (!wine_server_call_err( req )) + ret = wine_server_ptr_handle( reply->handle ); + } + SERVER_END_REQ; + return ret; +} diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 276c83474fe..0a905e131d8 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -81,6 +81,7 @@ SYSCALL_ENTRY( NtGdiSetVirtualResolution ) \ SYSCALL_ENTRY( NtGdiSwapBuffers ) \ SYSCALL_ENTRY( NtGdiTransformPoints ) \ - SYSCALL_ENTRY( NtUserCloseWindowStation ) + SYSCALL_ENTRY( NtUserCloseWindowStation ) \ + SYSCALL_ENTRY( NtUserGetProcessWindowStation )
#endif /* __WOW64WIN_SYSCALL_H */ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 7370a3d4940..56156e6fdeb 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -33,3 +33,8 @@ NTSTATUS WINAPI wow64_NtUserCloseWindowStation( UINT *args )
return NtUserCloseWindowStation( handle ); } + +NTSTATUS WINAPI wow64_NtUserGetProcessWindowStation( UINT *args ) +{ + return HandleToUlong( NtUserGetProcessWindowStation() ); +} diff --git a/include/ntuser.h b/include/ntuser.h index 8b09f732ecd..7ea4ccd4bdf 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -22,6 +22,7 @@ #include <winuser.h> #include <winternl.h>
-BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle ); +BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle ); +HWINSTA WINAPI NtUserGetProcessWindowStation(void);
#endif /* _NTUSER_ */