Commit f2dc25a5 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

ole32: Always rewind the stream in StdGlobalInterfaceTable_GetInterfaceFromGlobal

as CoUnmarshalInterface may have advanced the stream, even if it failed.
parent fa757df8
......@@ -298,16 +298,17 @@ StdGlobalInterfaceTable_GetInterfaceFromGlobal(
/* unmarshal the interface */
hres = CoUnmarshalInterface(entry->stream, riid, ppv);
if (hres) {
WARN("Failed to unmarshal stream\n");
return hres;
}
/* rewind stream, in case it's used again */
move.u.LowPart = 0;
move.u.HighPart = 0;
IStream_Seek(entry->stream, move, STREAM_SEEK_SET, NULL);
if (hres) {
WARN("Failed to unmarshal stream\n");
return hres;
}
/* addref it */
lpUnk = *ppv;
IUnknown_AddRef(lpUnk);
......
......@@ -1978,7 +1978,7 @@ static DWORD CALLBACK get_global_interface_proc(LPVOID pv)
CoInitialize(NULL);
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();
return hr;
......
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