ole32: Always rewind the stream in StdGlobalInterfaceTable_GetInterfaceFromGlobal

as CoUnmarshalInterface may have advanced the stream, even if it failed.
This commit is contained in:
Robert Shearman 2006-06-14 13:20:14 +01:00 committed by Alexandre Julliard
parent fa757df883
commit f2dc25a5f3
2 changed files with 6 additions and 5 deletions

View File

@ -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);

View File

@ -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;