ole32: Always rewind the stream in StdGlobalInterfaceTable_GetInterfaceFromGlobal
as CoUnmarshalInterface may have advanced the stream, even if it failed.
This commit is contained in:
parent
fa757df883
commit
f2dc25a5f3
|
@ -298,16 +298,17 @@ StdGlobalInterfaceTable_GetInterfaceFromGlobal(
|
||||||
|
|
||||||
/* unmarshal the interface */
|
/* unmarshal the interface */
|
||||||
hres = CoUnmarshalInterface(entry->stream, riid, ppv);
|
hres = CoUnmarshalInterface(entry->stream, riid, ppv);
|
||||||
if (hres) {
|
|
||||||
WARN("Failed to unmarshal stream\n");
|
|
||||||
return hres;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* rewind stream, in case it's used again */
|
/* rewind stream, in case it's used again */
|
||||||
move.u.LowPart = 0;
|
move.u.LowPart = 0;
|
||||||
move.u.HighPart = 0;
|
move.u.HighPart = 0;
|
||||||
IStream_Seek(entry->stream, move, STREAM_SEEK_SET, NULL);
|
IStream_Seek(entry->stream, move, STREAM_SEEK_SET, NULL);
|
||||||
|
|
||||||
|
if (hres) {
|
||||||
|
WARN("Failed to unmarshal stream\n");
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
|
||||||
/* addref it */
|
/* addref it */
|
||||||
lpUnk = *ppv;
|
lpUnk = *ppv;
|
||||||
IUnknown_AddRef(lpUnk);
|
IUnknown_AddRef(lpUnk);
|
||||||
|
|
|
@ -1978,7 +1978,7 @@ static DWORD CALLBACK get_global_interface_proc(LPVOID pv)
|
||||||
|
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(params->git, params->cookie, &IID_IClassFactory, (void **)&cf);
|
hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(params->git, params->cookie, &IID_IClassFactory, (void **)&cf);
|
||||||
todo_wine ok_ole_success(hr, IGlobalInterfaceTable_GetInterfaceFromGlobal);
|
ok_ole_success(hr, IGlobalInterfaceTable_GetInterfaceFromGlobal);
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
Loading…
Reference in New Issue