wine-staging/patches/oleaut32-OleLoadPictureFile/0001-oleaut32-Do-not-reimplement-OleLoadPicture-in-OleLoa.patch
2020-11-27 11:25:44 +11:00

63 lines
1.9 KiB
Diff

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