Commit dfbeea04 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Vitaly Lipatov

oleaut32: Do not reimplement OleLoadPicture in OleLoadPicturePath.

punkCaller is ignored by StdPicture ClassFactory implementation anyway.
parent ae211425
...@@ -2419,9 +2419,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, ...@@ -2419,9 +2419,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
DWORD dwBytesRead; DWORD dwBytesRead;
IStream *stream; IStream *stream;
BOOL bRead; BOOL bRead;
IPersistStream *pStream;
HRESULT hRes; HRESULT hRes;
HRESULT init_res;
WCHAR *file_candidate; WCHAR *file_candidate;
WCHAR path_buf[MAX_PATH]; WCHAR path_buf[MAX_PATH];
...@@ -2497,32 +2495,10 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, ...@@ -2497,32 +2495,10 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
return hRes; return hRes;
} }
init_res = CoInitialize(NULL); hRes = OleLoadPicture(stream, 0, FALSE, riid, ppvRet);
hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER,
&IID_IPicture, (LPVOID*)&ipicture);
if (SUCCEEDED(hRes)) {
hRes = IPicture_QueryInterface(ipicture, &IID_IPersistStream, (LPVOID*)&pStream);
if (SUCCEEDED(hRes)) {
hRes = IPersistStream_Load(pStream, stream);
if (SUCCEEDED(hRes)) {
hRes = IPicture_QueryInterface(ipicture, riid, ppvRet);
if (FAILED(hRes))
ERR("Failed to get interface %s from IPicture.\n", debugstr_guid(riid));
}
IPersistStream_Release(pStream);
}
IPicture_Release(ipicture);
}
IStream_Release(stream); IStream_Release(stream);
if (SUCCEEDED(init_res))
CoUninitialize();
return hRes; return hRes;
} }
......
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