PATCH: marshall return values in tl marshaller

Marcus Meissner meissner at suse.de
Sun Mar 27 14:02:49 CST 2005


Hi folks,

It really helps if we pass back the return value of the COM
call.

Silly me of thinking the lower layer COM would do that.

Mike: This is the "Make FashionCam01 installer work" patch ;)

Ciao, Marcus

Changelog:
	Fixed ppvObject serializer. (deref twice instead of once)
	Actually pass back return value of remote call in type marshaller.

Index: tmarshal.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/tmarshal.c,v
retrieving revision 1.48
diff -u -r1.48 tmarshal.c
--- tmarshal.c	27 Mar 2005 18:20:10 -0000	1.48
+++ tmarshal.c	27 Mar 2005 19:56:48 -0000
@@ -898,13 +898,13 @@
 	FIXME("ppvObject not expressed as VT_PTR -> VT_PTR -> VT_VOID?\n");
 	return E_FAIL;
     }
-    cookie = (*arg) ? 0x42424242: 0x0;
+    cookie = (*(DWORD*)*arg) ? 0x42424242: 0x0;
     if (writeit) {
 	hres = xbuf_add(buf, (LPVOID)&cookie, sizeof(cookie));
 	if (hres)
 	    return hres;
     }
-    if (!*arg) {
+    if (!*(DWORD*)*arg) {
 	if (debugout) TRACE_(olerelay)("<lpvoid NULL>");
 	return S_OK;
     }
@@ -1470,6 +1470,7 @@
     BSTR		names[10];
     int			nrofnames;
     int			is_idispatch_getidsofnames = 0;
+    DWORD		remoteresult = 0;
 
     EnterCriticalSection(&tpinfo->crit);
 
@@ -1618,7 +1619,7 @@
 	return hres;
     }
 
-    if (relaydeb) TRACE_(olerelay)(" = %08lx (",status);
+    if (relaydeb) TRACE_(olerelay)(" status = %08lx (",status);
     if (buf.base)
 	buf.base = HeapReAlloc(GetProcessHeap(),0,buf.base,msg.cbBuffer);
     else
@@ -1645,6 +1646,7 @@
 
     /* generic deserializer using typelib description */
     xargs = args;
+    status = S_OK;
     for (i=0;i<fdesc->cParams;i++) {
 	ELEMDESC	*elem = fdesc->lprgelemdescParam+i;
 	BOOL	isdeserialized = FALSE;
@@ -1714,12 +1716,17 @@
 	xargs += _argsize(elem->tdesc.vt);
     }
 after_deserialize:
-    if (relaydeb) TRACE_(olerelay)(")\n");
-    HeapFree(GetProcessHeap(),0,buf.base);
+    hres = xbuf_get(&buf, (LPBYTE)&remoteresult, sizeof(DWORD));
+    if (hres != S_OK)
+	return hres;
+    if (relaydeb) TRACE_(olerelay)(") = %08lx\n", remoteresult);
 
-    LeaveCriticalSection(&tpinfo->crit);
+    if (status != S_OK) /* OLE/COM internal error */
+	return status;
 
-    return status;
+    HeapFree(GetProcessHeap(),0,buf.base);
+    LeaveCriticalSection(&tpinfo->crit);
+    return remoteresult;
 }
 
 HRESULT WINAPI ProxyIUnknown_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
@@ -2137,11 +2144,15 @@
 	}
     }
 afterserialize:
+    hres = xbuf_add (&buf, (LPBYTE)&res, sizeof(DWORD));
+    if (hres != S_OK)
+	return hres;
+   
     /* might need to use IRpcChannelBuffer_GetBuffer ? */
     xmsg->cbBuffer	= buf.curoff;
     xmsg->Buffer	= buf.base;
     HeapFree(GetProcessHeap(),0,args);
-    return res;
+    return S_OK;
 }
 
 static LPRPCSTUBBUFFER WINAPI



More information about the wine-patches mailing list