Alexandre Julliard : wow64: Add stubs for Wow64LdrpInitialize() and Wow64SystemServiceEx().

Alexandre Julliard julliard at winehq.org
Thu Jul 22 16:28:19 CDT 2021


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jul 21 15:03:24 2021 +0200

wow64: Add stubs for Wow64LdrpInitialize() and Wow64SystemServiceEx().

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wow64/Makefile.in |  6 +++++
 dlls/wow64/syscall.c   | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++
 dlls/wow64/wow64.spec  |  4 +--
 3 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/dlls/wow64/Makefile.in b/dlls/wow64/Makefile.in
index 9d0618f8e3e..8dc4dac5ba7 100644
--- a/dlls/wow64/Makefile.in
+++ b/dlls/wow64/Makefile.in
@@ -1,2 +1,8 @@
 MODULE    = wow64.dll
 IMPORTLIB = wow64
+IMPORTS   = ntdll winecrt0
+
+EXTRADLLFLAGS = -nodefaultlibs -mno-cygwin -Wl,--image-base,0x6f000000
+
+C_SRCS = \
+	syscall.c
diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c
new file mode 100644
index 00000000000..a4acb8ba646
--- /dev/null
+++ b/dlls/wow64/syscall.c
@@ -0,0 +1,73 @@
+/*
+ * WoW64 syscall wrapping
+ *
+ * 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/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wow);
+
+void *dummy = RtlUnwind;
+
+BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
+{
+    if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst );
+    return TRUE;
+}
+
+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 );
+}
+
+
+/**********************************************************************
+ *           Wow64SystemServiceEx  (NTDLL.@)
+ */
+NTSTATUS WINAPI Wow64SystemServiceEx( UINT num, UINT *args )
+{
+    FIXME( "stub\n" );
+    return STATUS_INVALID_SYSTEM_SERVICE;
+}
+
+
+/**********************************************************************
+ *           Wow64LdrpInitialize  (NTDLL.@)
+ */
+void WINAPI Wow64LdrpInitialize( CONTEXT *context )
+{
+    FIXME( "stub\n" );
+}
diff --git a/dlls/wow64/wow64.spec b/dlls/wow64/wow64.spec
index f9230ced19a..a477b6b628a 100644
--- a/dlls/wow64/wow64.spec
+++ b/dlls/wow64/wow64.spec
@@ -10,7 +10,7 @@
 @ stub Wow64IsControlFlowGuardEnforced
 @ stub Wow64IsStackExtentsCheckEnforced
 @ stub Wow64KiUserCallbackDispatcher
-@ stub Wow64LdrpInitialize
+@ stdcall Wow64LdrpInitialize(ptr)
 @ stub Wow64LogPrint
 @ stub Wow64NotifyUnsimulateComplete
 @ stub Wow64PassExceptionToGuest
@@ -22,6 +22,6 @@
 @ stub Wow64ShallowThunkSIZE_T32TO64
 @ stub Wow64ShallowThunkSIZE_T64TO32
 @ stub Wow64SuspendLocalThread
-@ stub Wow64SystemServiceEx
+@ stdcall -norelay Wow64SystemServiceEx(long ptr)
 @ stub Wow64ValidateUserCallTarget
 @ stub Wow64ValidateUserCallTargetFilter




More information about the wine-cvs mailing list