Module: wine
Branch: master
Commit: 33e99ce5f750331a287b033fe98d949011a41f18
URL: https://source.winehq.org/git/wine.git/?a=commit;h=33e99ce5f750331a287b033f…
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Tue Aug 31 11:18:20 2021 +0200
win32u: Add the infrastructure for building the syscall table.
With a simple NtGdiFlush() export as example.
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/win32u/Makefile.in | 8 ++++++
dlls/win32u/main.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++
dlls/win32u/syscall.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/win32u/win32u.spec | 3 ++-
4 files changed, 138 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/Makefile.in b/dlls/win32u/Makefile.in
index 4147d8586b9..9dce0bc39fd 100644
--- a/dlls/win32u/Makefile.in
+++ b/dlls/win32u/Makefile.in
@@ -1 +1,9 @@
MODULE = win32u.dll
+IMPORTS = ntdll winecrt0
+EXTRALIBS = -Wl,--subsystem,unixlib
+
+EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin -Wb,--syscall-table,1
+
+C_SRCS = \
+ main.c \
+ syscall.c
diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c
new file mode 100644
index 00000000000..f0a052be545
--- /dev/null
+++ b/dlls/win32u/main.c
@@ -0,0 +1,65 @@
+/*
+ * Win32u kernel interface
+ *
+ * Copyright 2021 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
+ */
+
+#include <stdarg.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winnt.h"
+#include "winternl.h"
+#include "wine/exception.h"
+#include "wine/unixlib.h"
+
+extern void *__wine_syscall_dispatcher DECLSPEC_HIDDEN;
+
+static unixlib_handle_t win32u_handle;
+
+void __cdecl __wine_spec_unimplemented_stub( const char *module, const char *function )
+{
+ EXCEPTION_RECORD record;
+
+ record.ExceptionCode = EXCEPTION_WINE_STUB;
+ record.ExceptionFlags = EH_NONCONTINUABLE;
+ record.ExceptionRecord = NULL;
+ record.ExceptionAddress = __wine_spec_unimplemented_stub;
+ record.NumberParameters = 2;
+ record.ExceptionInformation[0] = (ULONG_PTR)module;
+ record.ExceptionInformation[1] = (ULONG_PTR)function;
+ for (;;) RtlRaiseException( &record );
+}
+
+BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
+{
+ switch (reason)
+ {
+ case DLL_PROCESS_ATTACH:
+ LdrDisableThreadCalloutsForDll( inst );
+ if (__wine_syscall_dispatcher) break; /* already set through Wow64Transition */
+ if (!NtQueryVirtualMemory( GetCurrentProcess(), inst, MemoryWineUnixFuncs,
+ &win32u_handle, sizeof(win32u_handle), NULL ))
+ {
+ __wine_unix_call( win32u_handle, 0, &__wine_syscall_dispatcher );
+ }
+ break;
+ }
+ return TRUE;
+}
diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c
new file mode 100644
index 00000000000..cb9d88a5b92
--- /dev/null
+++ b/dlls/win32u/syscall.c
@@ -0,0 +1,63 @@
+/*
+ * Unix interface for Win32 syscalls
+ *
+ * Copyright (C) 2021 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 "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winnt.h"
+#include "winternl.h"
+#include "wine/unixlib.h"
+
+
+/***********************************************************************
+ * NtGdiFlush (win32u.@)
+ */
+BOOL WINAPI NtGdiFlush(void)
+{
+ return TRUE;
+}
+
+static void * const syscalls[] =
+{
+ NtGdiFlush,
+};
+
+static BYTE arguments[ARRAY_SIZE(syscalls)];
+
+static SYSTEM_SERVICE_TABLE syscall_table =
+{
+ (ULONG_PTR *)syscalls,
+ 0,
+ ARRAY_SIZE(syscalls),
+ arguments
+};
+
+static NTSTATUS init( void *dispatcher )
+{
+ return ntdll_init_syscalls( 1, &syscall_table, dispatcher );
+}
+
+unixlib_entry_t __wine_unix_call_funcs[] = { init };
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index 57d1871f453..7bb8c334069 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -1,3 +1,4 @@
+@ extern -arch=win32 Wow64Transition __wine_syscall_dispatcher
@ stub NtBindCompositionSurface
@ stub NtCloseCompositionInputSink
@ stub NtCompositionInputThread
@@ -435,7 +436,7 @@
@ stub NtGdiFillPath
@ stub NtGdiFillRgn
@ stub NtGdiFlattenPath
-@ stub NtGdiFlush
+@ stdcall -syscall NtGdiFlush()
@ stub NtGdiFontIsLinked
@ stub NtGdiForceUFIMapping
@ stub NtGdiFrameRgn
Module: wine
Branch: master
Commit: 56104123d9721c4ab99425421275acaf70a3c41e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=56104123d9721c4ab9942542…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Mon Aug 30 22:26:00 2021 -0500
mountmgr: Return STATUS_BUFFER_OVERFLOW if an insufficient buffer is passed to IOCTL_MOUNTMGR_ENUMERATE_CREDENTIALS.
STATUS_MORE_ENTRIES is used for directory enumeration APIs, and signals that a
continuation will be returned on the next call.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/mountmgr.sys/mountmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c
index 757983c3f0b..1e018a9fc0b 100644
--- a/dlls/mountmgr.sys/mountmgr.c
+++ b/dlls/mountmgr.sys/mountmgr.c
@@ -877,7 +877,7 @@ static NTSTATUS enumerate_credentials( void *buff, SIZE_T insize, SIZE_T outsize
{
if (size >= sizeof(list->size)) list->size = size;
iosb->Information = sizeof(list->size);
- status = STATUS_MORE_ENTRIES;
+ status = STATUS_BUFFER_OVERFLOW;
}
else
{