Module: wine
Branch: master
Commit: c05704c7130370c54b85c1c387a6da30bc16c7eb
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c05704c7130370c54b85c1c3…
Author: Jacek Caban <jacek(a)codeweavers.com>
Date: Tue Oct 12 15:33:30 2021 +0200
win32u/tests: Add NtUserCloseWindowStation test.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
configure | 1 +
configure.ac | 1 +
dlls/win32u/tests/Makefile.in | 5 +++++
dlls/win32u/tests/win32u.c | 42 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 49 insertions(+)
diff --git a/configure b/configure
index 7f863aa38c0..d9dfe3e9c89 100755
--- a/configure
+++ b/configure
@@ -20773,6 +20773,7 @@ wine_fn_config_makefile dlls/wiaservc/tests enable_tests
wine_fn_config_makefile dlls/wimgapi enable_wimgapi
wine_fn_config_makefile dlls/win32s16.dll16 enable_win16
wine_fn_config_makefile dlls/win32u enable_win32u
+wine_fn_config_makefile dlls/win32u/tests enable_tests
wine_fn_config_makefile dlls/win87em.dll16 enable_win16
wine_fn_config_makefile dlls/winaspi.dll16 enable_win16
wine_fn_config_makefile dlls/windebug.dll16 enable_win16
diff --git a/configure.ac b/configure.ac
index 1821feefa49..44f8a1e2af6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3659,6 +3659,7 @@ WINE_CONFIG_MAKEFILE(dlls/wiaservc/tests)
WINE_CONFIG_MAKEFILE(dlls/wimgapi)
WINE_CONFIG_MAKEFILE(dlls/win32s16.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/win32u)
+WINE_CONFIG_MAKEFILE(dlls/win32u/tests)
WINE_CONFIG_MAKEFILE(dlls/win87em.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/winaspi.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/windebug.dll16,enable_win16)
diff --git a/dlls/win32u/tests/Makefile.in b/dlls/win32u/tests/Makefile.in
new file mode 100644
index 00000000000..c0fa70e4e08
--- /dev/null
+++ b/dlls/win32u/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL = win32u.dll
+IMPORTS = user32 win32u
+
+C_SRCS = \
+ win32u.c
diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c
new file mode 100644
index 00000000000..2f5014b80b4
--- /dev/null
+++ b/dlls/win32u/tests/win32u.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2021 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "wine/test.h"
+
+#include "winbase.h"
+#include "ntuser.h"
+
+
+static void test_NtUserCloseWindowStation(void)
+{
+ BOOL ret;
+
+ SetLastError( 0xdeadbeef );
+ ret = NtUserCloseWindowStation( 0 );
+ ok( !ret && GetLastError() == ERROR_INVALID_HANDLE,
+ "NtUserCloseWindowStation returned %x %u\n", ret, GetLastError() );
+}
+
+
+START_TEST(win32u)
+{
+ /* native win32u.dll fails if user32 is not loaded, so make sure it's fully initialized */
+ GetDesktopWindow();
+
+ test_NtUserCloseWindowStation();
+}
Module: wine
Branch: master
Commit: d7ae3591ec29a86b263f376c05311edd48a5d812
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d7ae3591ec29a86b263f376c…
Author: Jacek Caban <jacek(a)codeweavers.com>
Date: Tue Oct 12 16:42:35 2021 +0200
win32u: Move NtUserCloseWindowStation from user32.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/user32/message.c | 2 +-
dlls/user32/user32.spec | 2 +-
dlls/user32/user_private.h | 2 +-
dlls/user32/winstation.c | 16 ----------------
dlls/win32u/Makefile.in | 1 +
dlls/win32u/syscall.c | 2 ++
dlls/win32u/win32u.spec | 2 +-
dlls/win32u/winstation.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
dlls/wow64win/Makefile.in | 3 ++-
dlls/wow64win/syscall.h | 3 ++-
dlls/wow64win/user.c | 35 +++++++++++++++++++++++++++++++++++
include/Makefile.in | 1 +
include/ntuser.h | 27 +++++++++++++++++++++++++++
13 files changed, 119 insertions(+), 22 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 6f0f58a5f3f..7e6b660b8af 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -4335,7 +4335,7 @@ static BOOL CALLBACK bcast_winsta( LPWSTR winsta, LPARAM lp )
return TRUE;
((BroadcastParm *)lp)->winsta = hwinsta;
ret = EnumDesktopsW( hwinsta, bcast_desktop, lp );
- CloseWindowStation( hwinsta );
+ NtUserCloseWindowStation( hwinsta );
TRACE("-->%d\n", ret);
return ret;
}
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index 8d5f1bc4145..21b45c911d1 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -77,7 +77,7 @@
@ stdcall CloseDesktop(long)
@ stdcall CloseTouchInputHandle(long)
@ stdcall CloseWindow(long)
-@ stdcall CloseWindowStation(long)
+@ stdcall CloseWindowStation(long) NtUserCloseWindowStation
@ stdcall CopyAcceleratorTableA(long ptr long)
@ stdcall CopyAcceleratorTableW(long ptr long)
@ stdcall CopyIcon(long)
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index 0be02919bbe..5c01006565c 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -25,7 +25,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
-#include "winuser.h"
+#include "ntuser.h"
#include "winreg.h"
#include "winternl.h"
#include "hidusage.h"
diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c
index 95a9eb85099..057f0d75cb8 100644
--- a/dlls/user32/winstation.c
+++ b/dlls/user32/winstation.c
@@ -203,22 +203,6 @@ HWINSTA WINAPI OpenWindowStationW( LPCWSTR name, BOOL inherit, ACCESS_MASK acces
}
-/***********************************************************************
- * CloseWindowStation (USER32.@)
- */
-BOOL WINAPI CloseWindowStation( HWINSTA handle )
-{
- BOOL ret;
- SERVER_START_REQ( close_winstation )
- {
- req->handle = wine_server_obj_handle( handle );
- ret = !wine_server_call_err( req );
- }
- SERVER_END_REQ;
- return ret;
-}
-
-
/******************************************************************************
* GetProcessWindowStation (USER32.@)
*/
diff --git a/dlls/win32u/Makefile.in b/dlls/win32u/Makefile.in
index 38109f8bc11..feb1e6a3eb2 100644
--- a/dlls/win32u/Makefile.in
+++ b/dlls/win32u/Makefile.in
@@ -37,6 +37,7 @@ C_SRCS = \
syscall.c \
vertical.c \
vulkan.c \
+ winstation.c \
wrappers.c
font_EXTRADEFS = -DWINE_FONT_DIR=\"`${MAKEDEP} -R ${datadir}/wine ${fontdir}`\"
diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c
index eaff8cb639a..596ec6bbba3 100644
--- a/dlls/win32u/syscall.c
+++ b/dlls/win32u/syscall.c
@@ -29,6 +29,7 @@
#include "windef.h"
#include "winnt.h"
#include "ntgdi_private.h"
+#include "ntuser.h"
#include "wine/unixlib.h"
@@ -93,6 +94,7 @@ static void * const syscalls[] =
NtGdiSetVirtualResolution,
NtGdiSwapBuffers,
NtGdiTransformPoints,
+ NtUserCloseWindowStation,
};
static BYTE arguments[ARRAY_SIZE(syscalls)];
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index 396b67ede5a..92f9a143800 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -795,7 +795,7 @@
@ stub NtUserClipCursor
@ stub NtUserCloseClipboard
@ stub NtUserCloseDesktop
-@ stub NtUserCloseWindowStation
+@ stdcall -syscall NtUserCloseWindowStation(long)
@ stub NtUserCompositionInputSinkLuidFromPoint
@ stub NtUserCompositionInputSinkViewInstanceIdFromPoint
@ stub NtUserConfigureActivationObject
diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c
new file mode 100644
index 00000000000..f50464f856d
--- /dev/null
+++ b/dlls/win32u/winstation.c
@@ -0,0 +1,45 @@
+/*
+ * Window stations and desktops
+ *
+ * Copyright 2002 Alexandre Julliard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#if 0
+#pragma makedep unix
+#endif
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "ntuser.h"
+#include "winternl.h"
+#include "wine/server.h"
+
+/***********************************************************************
+ * NtUserCloseWindowStation (win32u.@)
+ */
+BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle )
+{
+ BOOL ret;
+ SERVER_START_REQ( close_winstation )
+ {
+ req->handle = wine_server_obj_handle( handle );
+ ret = !wine_server_call_err( req );
+ }
+ SERVER_END_REQ;
+ return ret;
+}
diff --git a/dlls/wow64win/Makefile.in b/dlls/wow64win/Makefile.in
index 9445182af5c..99301c4edf1 100644
--- a/dlls/wow64win/Makefile.in
+++ b/dlls/wow64win/Makefile.in
@@ -5,4 +5,5 @@ EXTRADLLFLAGS = -nodefaultlibs -Wl,--image-base,0x6f200000
C_SRCS = \
gdi.c \
- syscall.c
+ syscall.c \
+ user.c
diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h
index 880c840ea02..276c83474fe 100644
--- a/dlls/wow64win/syscall.h
+++ b/dlls/wow64win/syscall.h
@@ -80,6 +80,7 @@
SYSCALL_ENTRY( NtGdiSetTextJustification ) \
SYSCALL_ENTRY( NtGdiSetVirtualResolution ) \
SYSCALL_ENTRY( NtGdiSwapBuffers ) \
- SYSCALL_ENTRY( NtGdiTransformPoints )
+ SYSCALL_ENTRY( NtGdiTransformPoints ) \
+ SYSCALL_ENTRY( NtUserCloseWindowStation )
#endif /* __WOW64WIN_SYSCALL_H */
diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c
new file mode 100644
index 00000000000..7370a3d4940
--- /dev/null
+++ b/dlls/wow64win/user.c
@@ -0,0 +1,35 @@
+/*
+ * WoW64 User functions
+ *
+ * Copyright 2021 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "ntuser.h"
+#include "wow64win_private.h"
+
+NTSTATUS WINAPI wow64_NtUserCloseWindowStation( UINT *args )
+{
+ HWINSTA handle = get_handle( &args );
+
+ return NtUserCloseWindowStation( handle );
+}
diff --git a/include/Makefile.in b/include/Makefile.in
index eac1c2e0570..ef4a6d55558 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -551,6 +551,7 @@ SOURCES = \
ntsecapi.h \
ntsecpkg.h \
ntstatus.h \
+ ntuser.h \
oaidl.idl \
objbase.h \
objectarray.idl \
diff --git a/include/ntuser.h b/include/ntuser.h
new file mode 100644
index 00000000000..8b09f732ecd
--- /dev/null
+++ b/include/ntuser.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2021 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _NTUSER_
+#define _NTUSER_
+
+#include <winuser.h>
+#include <winternl.h>
+
+BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle );
+
+#endif /* _NTUSER_ */