oleaut32: Do not reimplement OleLoadPicture in OleLoadPicturePath.
punkCaller is ignored by StdPicture ClassFactory implementation anyway. Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
This commit is contained in:
parent
d5cfbf5da4
commit
d451842d16
1 changed files with 1 additions and 26 deletions
|
@ -2322,16 +2322,13 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
|||
DWORD dwReserved, OLE_COLOR clrReserved, REFIID riid,
|
||||
LPVOID *ppvRet )
|
||||
{
|
||||
IPicture *ipicture;
|
||||
HANDLE hFile;
|
||||
DWORD dwFileSize;
|
||||
HGLOBAL hGlobal = NULL;
|
||||
DWORD dwBytesRead;
|
||||
IStream *stream;
|
||||
BOOL bRead;
|
||||
IPersistStream *pStream;
|
||||
HRESULT hRes;
|
||||
HRESULT init_res;
|
||||
WCHAR *file_candidate;
|
||||
WCHAR path_buf[MAX_PATH];
|
||||
|
||||
|
@ -2407,32 +2404,10 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
|||
return hRes;
|
||||
}
|
||||
|
||||
init_res = CoInitialize(NULL);
|
||||
|
||||
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);
|
||||
}
|
||||
hRes = OleLoadPicture(stream, 0, FALSE, riid, ppvRet);
|
||||
|
||||
IStream_Release(stream);
|
||||
|
||||
if (SUCCEEDED(init_res))
|
||||
CoUninitialize();
|
||||
|
||||
return hRes;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue