Rob Shearman : ole32: Allow the marshaling/
unmarshaling of NULL interfaces for IClassFactory.
Alexandre Julliard
julliard at wine.codeweavers.com
Sun Dec 24 09:37:56 CST 2006
Module: wine
Branch: master
Commit: d3217872b34c1be49740d3744397ea278cb4ca62
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d3217872b34c1be49740d3744397ea278cb4ca62
Author: Rob Shearman <rob at codeweavers.com>
Date: Sat Dec 23 15:50:22 2006 +0000
ole32: Allow the marshaling/unmarshaling of NULL interfaces for IClassFactory.
---
dlls/ole32/oleproxy.c | 30 +++++++++++++++++++++---------
1 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c
index 889e03c..dd12e5c 100644
--- a/dlls/ole32/oleproxy.c
+++ b/dlls/ole32/oleproxy.c
@@ -181,12 +181,19 @@ CFStub_Invoke(
FIXME("Failed to create stream on hglobal\n");
goto getbuffer;
}
- hres = CoMarshalInterface(pStm,&iid,ppv,0,NULL,0);
- IUnknown_Release((IUnknown*)ppv);
+ hres = IStream_Write(pStm, &ppv, sizeof(ppv), NULL);
if (hres) {
- FIXME("CoMarshalInterface failed, %x!\n",hres);
- goto getbuffer;
+ ERR("IStream_Write failed, 0x%08x\n", hres);
+ goto getbuffer;
}
+ if (ppv) {
+ hres = CoMarshalInterface(pStm,&iid,ppv,0,NULL,0);
+ IUnknown_Release(ppv);
+ if (hres) {
+ FIXME("CoMarshalInterface failed, %x!\n",hres);
+ goto getbuffer;
+ }
+ }
hres = IStream_Stat(pStm,&ststg,0);
if (hres) {
FIXME("Stat failed.\n");
@@ -401,11 +408,16 @@ static HRESULT WINAPI CFProxy_CreateInst
IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg);
return hres;
}
- hres = CoUnmarshalInterface(
- pStream,
- riid,
- ppv
- );
+ hres = IStream_Read(pStream, ppv, sizeof(*ppv), NULL);
+ if (hres != S_OK)
+ hres = E_FAIL;
+ else if (*ppv) {
+ hres = CoUnmarshalInterface(
+ pStream,
+ riid,
+ ppv
+ );
+ }
IStream_Release(pStream); /* Does GlobalFree hGlobal too. */
IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg);
More information about the wine-cvs
mailing list