Module: wine Branch: master Commit: afe342284967c1043ea4b465098797a94c553f6d URL: http://source.winehq.org/git/wine.git/?a=commit;h=afe342284967c1043ea4b46509...
Author: Piotr Caban piotr@codeweavers.com Date: Fri Mar 6 11:20:43 2015 +0100
gdiplus: Don't use CoCreateInstance in get_palette function.
---
dlls/gdiplus/image.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index e2342d5..ca5f165 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -71,8 +71,7 @@ static ColorPalette *get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteT IWICPalette *wic_palette; ColorPalette *palette = NULL;
- hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICImagingFactory, (void **)&factory); + hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); if (hr != S_OK) return NULL;
hr = IWICImagingFactory_CreatePalette(factory, &wic_palette); @@ -3181,8 +3180,7 @@ static PropertyItem *get_gif_palette(IWICBitmapDecoder *decoder, IWICMetadataRea if (!get_bool_property(reader, &GUID_MetadataFormatLSD, global_flagW)) return NULL;
- hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICImagingFactory, (void **)&factory); + hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); if (hr != S_OK) return NULL;
hr = IWICImagingFactory_CreatePalette(factory, &palette); @@ -3424,11 +3422,9 @@ static GpStatus decode_image_wic(IStream *stream, REFGUID container, UINT width, height, frame_count; BitmapData lockeddata; WICRect wrc; - HRESULT initresult;
TRACE("%p,%s,%u,%p\n", stream, wine_dbgstr_guid(container), active_frame, image);
- initresult = CoInitialize(NULL); hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); if (FAILED(hr)) goto end; hr = IWICImagingFactory_CreateDecoder(factory, container, NULL, &decoder); @@ -3544,8 +3540,6 @@ static GpStatus decode_image_wic(IStream *stream, REFGUID container, IWICBitmapDecoder_Release(decoder);
end: - if (SUCCEEDED(initresult)) CoUninitialize(); - if (FAILED(hr) && status == Ok) status = hresult_to_status(hr);
if (status == Ok)