commit 81ff07bc60951f1c6a5e9e8af4e27b07cb78a05a Author: Jacek Caban Date: Wed Jul 25 11:19:10 2012 +0200 wincodecs: Use type safe C interfaces in icoformat.c diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index 48a5c95..20b7241 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -21,6 +21,7 @@ #include #define COBJMACROS +#define WIDL_TYPE_SAFE_C_INTERFACE #include "windef.h" #include "winbase.h" @@ -260,14 +261,14 @@ static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result) if (IsEqualGUID(&pixelformat, &GUID_WICPixelFormat32bppBGR) || IsEqualGUID(&pixelformat, &GUID_WICPixelFormat32bppBGRA)) { - source = (IWICBitmapSource*)framedecode; + source = &framedecode->base; IWICBitmapSource_AddRef(source); has_alpha = TRUE; } else { hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA, - (IWICBitmapSource*)framedecode, &source); + &framedecode->base, &source); has_alpha = FALSE; } @@ -406,7 +407,7 @@ static HRESULT ReadIcoPng(IStream *stream, IcoFrameDecode *result) hr = IWICBitmapDecoder_GetFrame(decoder, 0, &sourceFrame); if (FAILED(hr)) goto end; - hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA, (IWICBitmapSource*)sourceFrame, &sourceBitmap); + hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA, &sourceFrame->base, &sourceBitmap); if (FAILED(hr)) goto end; hr = IWICBitmapFrameDecode_GetSize(sourceFrame, &result->width, &result->height); @@ -680,10 +681,10 @@ static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface, case sizeof(BITMAPINFOHEADER): case sizeof(BITMAPV4HEADER): case sizeof(BITMAPV5HEADER): - hr = ReadIcoDib((IStream*)substream, result); + hr = ReadIcoDib(&substream->base, result); break; case 0x474e5089: - hr = ReadIcoPng((IStream*)substream, result); + hr = ReadIcoPng(&substream->base, result); break; default: FIXME("Unrecognized ICO frame magic: %x\n", magic);