[PATCH 1/4] windowscodecs: Use create_instance instead of ImagingFactory_CreateInstance.

Rémi Bernon rbernon at codeweavers.com
Wed Jan 20 03:30:05 CST 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

These are a bit of refactoring that will be required by the rest of the
wmphoto patches that I'll send next. It should make it not necessary
anymore to share stream.c and metadataquery.c with wmphoto.

 dlls/windowscodecs/clsfactory.c        | 2 +-
 dlls/windowscodecs/decoder.c           | 2 +-
 dlls/windowscodecs/palette.c           | 2 +-
 dlls/windowscodecs/wincodecs_private.h | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/windowscodecs/clsfactory.c b/dlls/windowscodecs/clsfactory.c
index 914e8ad52cd..b2914a7fd5b 100644
--- a/dlls/windowscodecs/clsfactory.c
+++ b/dlls/windowscodecs/clsfactory.c
@@ -206,7 +206,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
     return ret;
 }
 
-HRESULT create_instance(CLSID *clsid, const IID *iid, void **ppv)
+HRESULT create_instance(const CLSID *clsid, const IID *iid, void **ppv)
 {
     int i;
 
diff --git a/dlls/windowscodecs/decoder.c b/dlls/windowscodecs/decoder.c
index 3e43fa91114..5970a44cd53 100644
--- a/dlls/windowscodecs/decoder.c
+++ b/dlls/windowscodecs/decoder.c
@@ -665,7 +665,7 @@ static HRESULT WINAPI CommonDecoderFrame_Block_GetReaderByIndex(IWICMetadataBloc
         else
         {
             if (SUCCEEDED(hr))
-                hr = ImagingFactory_CreateInstance(&IID_IWICComponentFactory, (void**)&factory);
+                hr = create_instance(&CLSID_WICImagingFactory, &IID_IWICComponentFactory, (void**)&factory);
 
             if (SUCCEEDED(hr))
             {
diff --git a/dlls/windowscodecs/palette.c b/dlls/windowscodecs/palette.c
index 34329717201..051a5944eb2 100644
--- a/dlls/windowscodecs/palette.c
+++ b/dlls/windowscodecs/palette.c
@@ -679,7 +679,7 @@ static HRESULT WINAPI PaletteImpl_InitializeFromBitmap(IWICPalette *palette,
     else
         rgb24_source = source;
 
-    hr = ImagingFactory_CreateInstance(&IID_IWICImagingFactory, (void **)&factory);
+    hr = create_instance(&CLSID_WICImagingFactory, &IID_IWICImagingFactory, (void **)&factory);
     if (hr != S_OK) goto fail;
 
     hr = IWICImagingFactory_CreateBitmapFromSource(factory, rgb24_source, WICBitmapCacheOnLoad, &rgb24_bitmap);
diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h
index 3b20f7d6c24..85d057cc278 100644
--- a/dlls/windowscodecs/wincodecs_private.h
+++ b/dlls/windowscodecs/wincodecs_private.h
@@ -133,7 +133,7 @@ DECLARE_INTERFACE_(IMILUnknown2,IUnknown)
 };
 #undef INTERFACE
 
-HRESULT create_instance(CLSID *clsid, const IID *iid, void **ppv) DECLSPEC_HIDDEN;
+HRESULT create_instance(const CLSID *clsid, const IID *iid, void **ppv) DECLSPEC_HIDDEN;
 
 typedef HRESULT(*class_constructor)(REFIID,void**);
 extern HRESULT FormatConverter_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN;
-- 
2.30.0




More information about the wine-devel mailing list