gdiplus: Don't use CoCreateInstance in get_palette function.
This commit is contained in:
parent
b03c60d85c
commit
afe3422849
|
@ -71,8 +71,7 @@ static ColorPalette *get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteT
|
||||||
IWICPalette *wic_palette;
|
IWICPalette *wic_palette;
|
||||||
ColorPalette *palette = NULL;
|
ColorPalette *palette = NULL;
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
|
hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
|
||||||
&IID_IWICImagingFactory, (void **)&factory);
|
|
||||||
if (hr != S_OK) return NULL;
|
if (hr != S_OK) return NULL;
|
||||||
|
|
||||||
hr = IWICImagingFactory_CreatePalette(factory, &wic_palette);
|
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))
|
if (!get_bool_property(reader, &GUID_MetadataFormatLSD, global_flagW))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
|
hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
|
||||||
&IID_IWICImagingFactory, (void **)&factory);
|
|
||||||
if (hr != S_OK) return NULL;
|
if (hr != S_OK) return NULL;
|
||||||
|
|
||||||
hr = IWICImagingFactory_CreatePalette(factory, &palette);
|
hr = IWICImagingFactory_CreatePalette(factory, &palette);
|
||||||
|
@ -3424,11 +3422,9 @@ static GpStatus decode_image_wic(IStream *stream, REFGUID container,
|
||||||
UINT width, height, frame_count;
|
UINT width, height, frame_count;
|
||||||
BitmapData lockeddata;
|
BitmapData lockeddata;
|
||||||
WICRect wrc;
|
WICRect wrc;
|
||||||
HRESULT initresult;
|
|
||||||
|
|
||||||
TRACE("%p,%s,%u,%p\n", stream, wine_dbgstr_guid(container), active_frame, image);
|
TRACE("%p,%s,%u,%p\n", stream, wine_dbgstr_guid(container), active_frame, image);
|
||||||
|
|
||||||
initresult = CoInitialize(NULL);
|
|
||||||
hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
|
hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
|
||||||
if (FAILED(hr)) goto end;
|
if (FAILED(hr)) goto end;
|
||||||
hr = IWICImagingFactory_CreateDecoder(factory, container, NULL, &decoder);
|
hr = IWICImagingFactory_CreateDecoder(factory, container, NULL, &decoder);
|
||||||
|
@ -3544,8 +3540,6 @@ static GpStatus decode_image_wic(IStream *stream, REFGUID container,
|
||||||
IWICBitmapDecoder_Release(decoder);
|
IWICBitmapDecoder_Release(decoder);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (SUCCEEDED(initresult)) CoUninitialize();
|
|
||||||
|
|
||||||
if (FAILED(hr) && status == Ok) status = hresult_to_status(hr);
|
if (FAILED(hr) && status == Ok) status = hresult_to_status(hr);
|
||||||
|
|
||||||
if (status == Ok)
|
if (status == Ok)
|
||||||
|
|
Loading…
Reference in New Issue