ole32: Allow the marshaling/unmarshaling of NULL interfaces for IClassFactory.

This commit is contained in:
Rob Shearman 2006-12-23 15:50:22 +00:00 committed by Alexandre Julliard
parent 67386352c8
commit d3217872b3
1 changed files with 21 additions and 9 deletions

View File

@ -181,12 +181,19 @@ CFStub_Invoke(
FIXME("Failed to create stream on hglobal\n"); FIXME("Failed to create stream on hglobal\n");
goto getbuffer; goto getbuffer;
} }
hres = IStream_Write(pStm, &ppv, sizeof(ppv), NULL);
if (hres) {
ERR("IStream_Write failed, 0x%08x\n", hres);
goto getbuffer;
}
if (ppv) {
hres = CoMarshalInterface(pStm,&iid,ppv,0,NULL,0); hres = CoMarshalInterface(pStm,&iid,ppv,0,NULL,0);
IUnknown_Release((IUnknown*)ppv); IUnknown_Release(ppv);
if (hres) { if (hres) {
FIXME("CoMarshalInterface failed, %x!\n",hres); FIXME("CoMarshalInterface failed, %x!\n",hres);
goto getbuffer; goto getbuffer;
} }
}
hres = IStream_Stat(pStm,&ststg,0); hres = IStream_Stat(pStm,&ststg,0);
if (hres) { if (hres) {
FIXME("Stat failed.\n"); FIXME("Stat failed.\n");
@ -401,11 +408,16 @@ static HRESULT WINAPI CFProxy_CreateInstance(
IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg); IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg);
return hres; return hres;
} }
hres = IStream_Read(pStream, ppv, sizeof(*ppv), NULL);
if (hres != S_OK)
hres = E_FAIL;
else if (*ppv) {
hres = CoUnmarshalInterface( hres = CoUnmarshalInterface(
pStream, pStream,
riid, riid,
ppv ppv
); );
}
IStream_Release(pStream); /* Does GlobalFree hGlobal too. */ IStream_Release(pStream); /* Does GlobalFree hGlobal too. */
IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg); IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg);