[PATCH 2/4] oleaut32: Implement TMStubImpl_Invoke on x86_64.

Marcus Meissner marcus at jet.franken.de
Sun Nov 5 09:00:03 CST 2017


From: Sebastian Lackner <sebastian at fds-team.de>

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Marcus Meissner <marcus at jet.franken.de>
---
 dlls/oleaut32/tmarshal.c |  2 +-
 dlls/oleaut32/typelib.c  | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index 9fd0f0374b..95bf2a7489 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -2073,7 +2073,7 @@ static HRESULT WINAPI
 TMStubImpl_Invoke(
     LPRPCSTUBBUFFER iface, RPCOLEMESSAGE* xmsg,IRpcChannelBuffer*rpcchanbuf)
 {
-#ifdef __i386__
+#if defined(__i386__) || defined(__x86_64__)
     int		i;
     const FUNCDESC *fdesc;
     TMStubImpl *This = impl_from_IRpcStubBuffer(iface);
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 037c7034ed..a87f0af1f0 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -6422,6 +6422,34 @@ __ASM_GLOBAL_FUNC( call_method,
 /* same function but returning floating point */
 static double (CDECL * const call_double_method)(void*,int,const DWORD_PTR*) = (void *)call_method;
 
+DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args)
+{
+    DWORD res;
+
+    if (TRACE_ON(ole))
+    {
+        int i;
+        TRACE("Calling %p(", func);
+        for (i=0; i<min(nrargs, 30); i++) TRACE("%016lx,", args[i]);
+        if (nrargs > 30) TRACE("...");
+        TRACE(")\n");
+    }
+
+    switch (callconv) {
+    case CC_STDCALL:
+    case CC_CDECL:
+        res = call_method(func, nrargs, args);
+        break;
+    default:
+        FIXME("unsupported calling convention %d\n", callconv);
+        res = -1;
+        break;
+    }
+
+    TRACE("returns %08x\n", res);
+    return res;
+}
+
 #elif defined(__arm__)
 
 extern LONGLONG CDECL call_method( void *func, int nb_stk_args, const DWORD *stk_args, const DWORD *reg_args );
-- 
2.14.3




More information about the wine-patches mailing list