PATCH: IUnknown / DCOM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This adds IUnknown marshalling. Not 100% sure it is correct this way.

Ciao, Marcus
License: LGPL
Changelog:
	Added Marshalling of IUnknown.
Index: winedefault.reg
===================================================================
RCS file: /home/wine/wine/winedefault.reg,v
retrieving revision 1.47
diff -u -r1.47 winedefault.reg
--- winedefault.reg	22 May 2002 21:32:49 -0000	1.47
+++ winedefault.reg	2 Jun 2002 15:07:37 -0000
@@ -129,6 +129,9 @@
 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000000-0000-0000-C000-000000000046}\NumMethods]
 @="3"
 
+[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000000-0000-0000-C000-000000000046}\ProxyStubClsid32]
+@="{00000320-0000-0000-C000-000000000046}"
+
 # IClassFactory, standard interface for creating instances of classes.
 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000001-0000-0000-C000-000000000046}]
 @="IClassFactory"
Index: dlls/ole32/oleproxy.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/oleproxy.c,v
retrieving revision 1.3
diff -u -r1.3 oleproxy.c
--- dlls/ole32/oleproxy.c	31 May 2002 23:25:50 -0000	1.3
+++ dlls/ole32/oleproxy.c	2 Jun 2002 15:07:37 -0000
@@ -452,7 +452,9 @@
     LPPSFACTORYBUFFER iface, IUnknown* pUnkOuter, REFIID riid,
     IRpcProxyBuffer **ppProxy, LPVOID *ppv
 ) {
-    if (IsEqualIID(&IID_IClassFactory,riid))
+    if (IsEqualIID(&IID_IClassFactory,riid) ||
+	IsEqualIID(&IID_IUnknown,riid)
+    )
 	return CFProxy_Construct(ppv,(LPVOID*)ppProxy);
     FIXME("proxying not implemented for (%s) yet!\n",debugstr_guid(riid));
     return E_FAIL;
@@ -467,7 +469,9 @@
 
     TRACE("(%s,%p,%p)\n",debugstr_guid(riid),pUnkServer,ppStub);
 
-    if (IsEqualIID(&IID_IClassFactory,riid)) {
+    if (IsEqualIID(&IID_IClassFactory,riid) ||
+        IsEqualIID(&IID_IUnknown,riid)
+    ) {
 	hres = CFStub_Construct(ppStub);
 	if (!hres)
 	    IRpcStubBuffer_Connect((*ppStub),pUnkServer);
@@ -503,7 +507,11 @@
 	STUBMGR_Start();
 	return S_OK;
     }
-    if (IsEqualIID(rclsid,&CLSID_DfMarshal)&&IsEqualIID(iid,&IID_IClassFactory))
+    if (IsEqualIID(rclsid,&CLSID_DfMarshal)&&(
+		IsEqualIID(iid,&IID_IClassFactory) ||
+		IsEqualIID(iid,&IID_IUnknown)
+	)
+    )
 	return MARSHAL_GetStandardMarshalCF(ppv);
     FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
     return CLASS_E_CLASSNOTAVAILABLE;
Index: dlls/oleaut32/tmarshal.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/tmarshal.c,v
retrieving revision 1.4
diff -u -r1.4 tmarshal.c
--- dlls/oleaut32/tmarshal.c	31 May 2002 23:25:50 -0000	1.4
+++ dlls/oleaut32/tmarshal.c	2 Jun 2002 15:07:38 -0000
@@ -436,6 +436,8 @@
 	ITypeInfo_Release(tinfo2);
 	return hres;
     }
+    case VT_UNKNOWN:
+        return _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg);
     default:
 	ERR("Cannot marshal type %d\n",tdesc->vt);
 	/*dump_ELEMDESC(elem);*/
@@ -887,7 +889,10 @@
 	case VT_UNKNOWN:
 	    /* FIXME: UNKNOWN is unknown ..., but allocate 4 byte for it */
 	    *arg=(DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DWORD));
-	    return S_OK;
+	    hres = S_OK;
+	    if (elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN)
+		hres = _unmarshal_interface(buf,&IID_IUnknown,(LPUNKNOWN*)arg);
+	    return hres;
 	case VT_VOID:
 	    *arg = (DWORD)HeapAlloc(GetProcessHeap(),0,sizeof(LPVOID));
 	    hres = S_OK;
@@ -993,7 +998,7 @@
     case VT_UNKNOWN:
 	if (elem->u.paramdesc.wParamFlags & PARAMFLAG_FOUT) {
 	    FIXME("Marshaling back VT_UNKNOWN %lx\n",*arg);
-	    hres = xbuf_add(buf,(LPBYTE)*arg,sizeof(DWORD));
+	    hres = _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg);
 	}
 	HeapFree(GetProcessHeap(),0,(LPVOID)*arg);
 	return hres;


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux