2020-11-26 16:25:44 -08:00
|
|
|
From 89935f2a91305a577da2b08f80ac74235235a0d2 Mon Sep 17 00:00:00 2001
|
2016-03-27 09:22:11 -07:00
|
|
|
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
|
|
|
Date: Sun, 27 Mar 2016 12:30:00 +0800
|
2020-11-26 16:25:44 -08:00
|
|
|
Subject: [PATCH] oleaut32: Do not reimplement OleLoadPicture in
|
|
|
|
OleLoadPicturePath.
|
2016-03-27 09:22:11 -07:00
|
|
|
|
|
|
|
punkCaller is ignored by StdPicture ClassFactory implementation anyway.
|
|
|
|
---
|
2020-11-26 16:25:44 -08:00
|
|
|
dlls/oleaut32/olepicture.c | 26 +-------------------------
|
|
|
|
1 file changed, 1 insertion(+), 25 deletions(-)
|
2016-03-27 09:22:11 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
|
2020-11-26 16:25:44 -08:00
|
|
|
index 7312adac1dc..373ccd61724 100644
|
2016-03-27 09:22:11 -07:00
|
|
|
--- a/dlls/oleaut32/olepicture.c
|
|
|
|
+++ b/dlls/oleaut32/olepicture.c
|
2020-11-26 16:25:44 -08:00
|
|
|
@@ -2447,9 +2447,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
2016-03-27 09:22:11 -07:00
|
|
|
DWORD dwBytesRead;
|
|
|
|
IStream *stream;
|
|
|
|
BOOL bRead;
|
|
|
|
- IPersistStream *pStream;
|
|
|
|
HRESULT hRes;
|
|
|
|
- HRESULT init_res;
|
|
|
|
WCHAR *file_candidate;
|
|
|
|
WCHAR path_buf[MAX_PATH];
|
|
|
|
|
2020-11-26 16:25:44 -08:00
|
|
|
@@ -2526,32 +2524,10 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
2016-03-27 09:22:11 -07:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2020-11-26 16:25:44 -08:00
|
|
|
2.29.2
|
2016-03-27 09:22:11 -07:00
|
|
|
|