Commit 52475287 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Fixed OleLoadFromStream: Dereference ppvObj and get IPersistStream

instead of accessing IUnknown.
parent f9b6d7bb
...@@ -5688,20 +5688,28 @@ HRESULT WINAPI OleLoadFromStream(IStream *pStm,REFIID iidInterface,void** ppvOb ...@@ -5688,20 +5688,28 @@ HRESULT WINAPI OleLoadFromStream(IStream *pStm,REFIID iidInterface,void** ppvOb
{ {
CLSID clsid; CLSID clsid;
HRESULT res; HRESULT res;
LPPERSISTSTREAM xstm;
FIXME("(),stub!\n"); TRACE("(%p,%s,%p)\n",pStm,debugstr_guid(iidInterface),ppvObj);
res=ReadClassStm(pStm,&clsid); res=ReadClassStm(pStm,&clsid);
if (!SUCCEEDED(res))
if (SUCCEEDED(res)){ return res;
res=CoCreateInstance(&clsid,NULL,CLSCTX_INPROC_SERVER,iidInterface,ppvObj); res=CoCreateInstance(&clsid,NULL,CLSCTX_INPROC_SERVER,iidInterface,ppvObj);
if (!SUCCEEDED(res))
if (SUCCEEDED(res)) return res;
res=IUnknown_QueryInterface((IUnknown*)*ppvObj,&IID_IPersistStream,(LPVOID*)&xstm);
res=IPersistStream_Load((IPersistStream*)ppvObj,pStm); if (!SUCCEEDED(res)) {
IUnknown_Release((IUnknown*)*ppvObj);
return res;
} }
res=IPersistStream_Load(xstm,pStm);
IPersistStream_Release(xstm);
/* FIXME: all refcounts ok at this point? I think they should be:
* pStm : unchanged
* ppvObj : 1
* xstm : 0 (released)
*/
return res; return res;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment