Added marshalling of IUnknown.

This commit is contained in:
Marcus Meissner 2002-06-04 22:14:06 +00:00 committed by Alexandre Julliard
parent 05fffb15ec
commit fd625ddb0b
3 changed files with 21 additions and 5 deletions

View File

@ -452,7 +452,9 @@ PSFacBuf_CreateProxy(
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 @@ PSFacBuf_CreateStub(
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 @@ HRESULT WINAPI OLE32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
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;

View File

@ -436,6 +436,8 @@ marshall_param(
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 @@ stuballoc_param(
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 @@ stubunalloc_param(
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;

View File

@ -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"