2 * Copyright 2009 Vincent Povirk for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "wincodecs_private.h"
44 IWICBitmapDecoder IWICBitmapDecoder_iface
;
49 CRITICAL_SECTION lock
; /* must be held when accessing stream */
53 IWICBitmapFrameDecode IWICBitmapFrameDecode_iface
;
60 static inline IcoDecoder
*impl_from_IWICBitmapDecoder(IWICBitmapDecoder
*iface
)
62 return CONTAINING_RECORD(iface
, IcoDecoder
, IWICBitmapDecoder_iface
);
65 static inline IcoFrameDecode
*impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode
*iface
)
67 return CONTAINING_RECORD(iface
, IcoFrameDecode
, IWICBitmapFrameDecode_iface
);
70 static HRESULT WINAPI
IcoFrameDecode_QueryInterface(IWICBitmapFrameDecode
*iface
, REFIID iid
,
73 IcoFrameDecode
*This
= impl_from_IWICBitmapFrameDecode(iface
);
74 TRACE("(%p,%s,%p)\n", iface
, debugstr_guid(iid
), ppv
);
76 if (!ppv
) return E_INVALIDARG
;
78 if (IsEqualIID(&IID_IUnknown
, iid
) ||
79 IsEqualIID(&IID_IWICBitmapSource
, iid
) ||
80 IsEqualIID(&IID_IWICBitmapFrameDecode
, iid
))
82 *ppv
= &This
->IWICBitmapFrameDecode_iface
;
90 IUnknown_AddRef((IUnknown
*)*ppv
);
94 static ULONG WINAPI
IcoFrameDecode_AddRef(IWICBitmapFrameDecode
*iface
)
96 IcoFrameDecode
*This
= impl_from_IWICBitmapFrameDecode(iface
);
97 ULONG ref
= InterlockedIncrement(&This
->ref
);
99 TRACE("(%p) refcount=%u\n", iface
, ref
);
104 static ULONG WINAPI
IcoFrameDecode_Release(IWICBitmapFrameDecode
*iface
)
106 IcoFrameDecode
*This
= impl_from_IWICBitmapFrameDecode(iface
);
107 ULONG ref
= InterlockedDecrement(&This
->ref
);
109 TRACE("(%p) refcount=%u\n", iface
, ref
);
113 HeapFree(GetProcessHeap(), 0, This
->bits
);
114 HeapFree(GetProcessHeap(), 0, This
);
120 static HRESULT WINAPI
IcoFrameDecode_GetSize(IWICBitmapFrameDecode
*iface
,
121 UINT
*puiWidth
, UINT
*puiHeight
)
123 IcoFrameDecode
*This
= impl_from_IWICBitmapFrameDecode(iface
);
125 *puiWidth
= This
->width
;
126 *puiHeight
= This
->height
;
128 TRACE("(%p) -> (%i,%i)\n", iface
, *puiWidth
, *puiHeight
);
133 static HRESULT WINAPI
IcoFrameDecode_GetPixelFormat(IWICBitmapFrameDecode
*iface
,
134 WICPixelFormatGUID
*pPixelFormat
)
136 memcpy(pPixelFormat
, &GUID_WICPixelFormat32bppBGRA
, sizeof(GUID
));
140 static HRESULT WINAPI
IcoFrameDecode_GetResolution(IWICBitmapFrameDecode
*iface
,
141 double *pDpiX
, double *pDpiY
)
143 IcoFrameDecode
*This
= impl_from_IWICBitmapFrameDecode(iface
);
148 TRACE("(%p) -> (%f,%f)\n", iface
, *pDpiX
, *pDpiY
);
153 static HRESULT WINAPI
IcoFrameDecode_CopyPalette(IWICBitmapFrameDecode
*iface
,
154 IWICPalette
*pIPalette
)
156 TRACE("(%p,%p)\n", iface
, pIPalette
);
157 return WINCODEC_ERR_PALETTEUNAVAILABLE
;
160 static HRESULT WINAPI
IcoFrameDecode_CopyPixels(IWICBitmapFrameDecode
*iface
,
161 const WICRect
*prc
, UINT cbStride
, UINT cbBufferSize
, BYTE
*pbBuffer
)
163 IcoFrameDecode
*This
= impl_from_IWICBitmapFrameDecode(iface
);
164 TRACE("(%p,%p,%u,%u,%p)\n", iface
, prc
, cbStride
, cbBufferSize
, pbBuffer
);
166 return copy_pixels(32, This
->bits
, This
->width
, This
->height
, This
->width
* 4,
167 prc
, cbStride
, cbBufferSize
, pbBuffer
);
170 static HRESULT WINAPI
IcoFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDecode
*iface
,
171 IWICMetadataQueryReader
**ppIMetadataQueryReader
)
173 TRACE("(%p,%p)\n", iface
, ppIMetadataQueryReader
);
174 return WINCODEC_ERR_UNSUPPORTEDOPERATION
;
177 static HRESULT WINAPI
IcoFrameDecode_GetColorContexts(IWICBitmapFrameDecode
*iface
,
178 UINT cCount
, IWICColorContext
**ppIColorContexts
, UINT
*pcActualCount
)
180 TRACE("(%p,%u,%p,%p)\n", iface
, cCount
, ppIColorContexts
, pcActualCount
);
181 return WINCODEC_ERR_UNSUPPORTEDOPERATION
;
184 static HRESULT WINAPI
IcoFrameDecode_GetThumbnail(IWICBitmapFrameDecode
*iface
,
185 IWICBitmapSource
**ppIThumbnail
)
187 TRACE("(%p,%p)\n", iface
, ppIThumbnail
);
188 return IWICBitmapFrameDecode_QueryInterface(iface
, &IID_IWICBitmapSource
, (void **)ppIThumbnail
);
191 static const IWICBitmapFrameDecodeVtbl IcoFrameDecode_Vtbl
= {
192 IcoFrameDecode_QueryInterface
,
193 IcoFrameDecode_AddRef
,
194 IcoFrameDecode_Release
,
195 IcoFrameDecode_GetSize
,
196 IcoFrameDecode_GetPixelFormat
,
197 IcoFrameDecode_GetResolution
,
198 IcoFrameDecode_CopyPalette
,
199 IcoFrameDecode_CopyPixels
,
200 IcoFrameDecode_GetMetadataQueryReader
,
201 IcoFrameDecode_GetColorContexts
,
202 IcoFrameDecode_GetThumbnail
205 static inline void pixel_set_trans(DWORD
* pixel
, BOOL transparent
)
207 if (transparent
) *pixel
= 0;
208 else *pixel
|= 0xff000000;
211 static HRESULT
ReadIcoDib(IStream
*stream
, IcoFrameDecode
*result
)
214 BmpDecoder
*bmp_decoder
;
215 IWICBitmapDecoder
*decoder
;
216 IWICBitmapFrameDecode
*framedecode
;
217 WICPixelFormatGUID pixelformat
;
218 IWICBitmapSource
*source
;
219 BOOL has_alpha
=FALSE
; /* if TRUE, alpha data might be in the image data */
222 hr
= IcoDibDecoder_CreateInstance(&bmp_decoder
);
225 BmpDecoder_GetWICDecoder(bmp_decoder
, &decoder
);
226 hr
= IWICBitmapDecoder_Initialize(decoder
, stream
, WICDecodeMetadataCacheOnLoad
);
229 hr
= IWICBitmapDecoder_GetFrame(decoder
, 0, &framedecode
);
233 hr
= IWICBitmapFrameDecode_GetSize(framedecode
, &result
->width
, &result
->height
);
237 result
->bits
= HeapAlloc(GetProcessHeap(), 0, result
->width
* result
->height
* 4);
238 if (!result
->bits
) hr
= E_OUTOFMEMORY
;
242 hr
= IWICBitmapFrameDecode_GetPixelFormat(framedecode
, &pixelformat
);
244 if (IsEqualGUID(&pixelformat
, &GUID_WICPixelFormat32bppBGR
) ||
245 IsEqualGUID(&pixelformat
, &GUID_WICPixelFormat32bppBGRA
))
247 source
= (IWICBitmapSource
*)framedecode
;
248 IWICBitmapSource_AddRef(source
);
253 hr
= WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA
,
254 (IWICBitmapSource
*)framedecode
, &source
);
262 rc
.Width
= result
->width
;
263 rc
.Height
= result
->height
;
264 hr
= IWICBitmapSource_CopyPixels(source
, &rc
, result
->width
* 4,
265 result
->width
* result
->height
* 4, result
->bits
);
267 IWICBitmapSource_Release(source
);
271 hr
= IWICBitmapFrameDecode_GetResolution(framedecode
, &result
->dpiX
, &result
->dpiY
);
273 IWICBitmapFrameDecode_Release(framedecode
);
276 if (SUCCEEDED(hr
) && has_alpha
)
278 /* If the alpha channel is fully transparent, we should ignore it. */
279 int nonzero_alpha
= 0;
282 for (i
=0; i
<(result
->height
*result
->width
); i
++)
284 if (result
->bits
[i
*4+3] != 0)
293 for (i
=0; i
<(result
->height
*result
->width
); i
++)
294 result
->bits
[i
*4+3] = 0xff;
300 if (SUCCEEDED(hr
) && !has_alpha
)
302 /* set alpha data based on the AND mask */
303 UINT andBytesPerRow
= (result
->width
+31)/32*4;
304 UINT andBytes
= andBytesPerRow
* result
->height
;
309 UINT bitsStride
= result
->width
* 4;
316 BmpDecoder_FindIconMask(bmp_decoder
, &offset
, &topdown
);
320 seek
.QuadPart
= offset
;
322 hr
= IStream_Seek(stream
, seek
, STREAM_SEEK_SET
, 0);
326 tempdata
= HeapAlloc(GetProcessHeap(), 0, andBytes
);
327 if (!tempdata
) hr
= E_OUTOFMEMORY
;
331 hr
= IStream_Read(stream
, tempdata
, andBytes
, &bytesread
);
333 if (SUCCEEDED(hr
) && bytesread
== andBytes
)
337 andStride
= andBytesPerRow
;
342 andStride
= -andBytesPerRow
;
343 andRow
= tempdata
+ (result
->height
-1)*andBytesPerRow
;
346 bitsRow
= result
->bits
;
347 for (y
=0; y
<result
->height
; y
++) {
348 BYTE
*andByte
=andRow
;
349 DWORD
*bitsPixel
=(DWORD
*)bitsRow
;
350 for (x
=0; x
<result
->width
; x
+=8) {
351 BYTE andVal
=*andByte
++;
352 pixel_set_trans(bitsPixel
++, andVal
>>7&1);
353 if (x
+1 < result
->width
) pixel_set_trans(bitsPixel
++, andVal
>>6&1);
354 if (x
+2 < result
->width
) pixel_set_trans(bitsPixel
++, andVal
>>5&1);
355 if (x
+3 < result
->width
) pixel_set_trans(bitsPixel
++, andVal
>>4&1);
356 if (x
+4 < result
->width
) pixel_set_trans(bitsPixel
++, andVal
>>3&1);
357 if (x
+5 < result
->width
) pixel_set_trans(bitsPixel
++, andVal
>>2&1);
358 if (x
+6 < result
->width
) pixel_set_trans(bitsPixel
++, andVal
>>1&1);
359 if (x
+7 < result
->width
) pixel_set_trans(bitsPixel
++, andVal
&1);
362 bitsRow
+= bitsStride
;
366 HeapFree(GetProcessHeap(), 0, tempdata
);
370 IWICBitmapDecoder_Release(decoder
);
376 static HRESULT
ReadIcoPng(IStream
*stream
, IcoFrameDecode
*result
)
378 IWICBitmapDecoder
*decoder
= NULL
;
379 IWICBitmapFrameDecode
*sourceFrame
= NULL
;
380 IWICBitmapSource
*sourceBitmap
= NULL
;
384 hr
= PngDecoder_CreateInstance(&IID_IWICBitmapDecoder
, (void**)&decoder
);
387 hr
= IWICBitmapDecoder_Initialize(decoder
, stream
, WICDecodeMetadataCacheOnLoad
);
390 hr
= IWICBitmapDecoder_GetFrame(decoder
, 0, &sourceFrame
);
393 hr
= WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA
, (IWICBitmapSource
*)sourceFrame
, &sourceBitmap
);
396 hr
= IWICBitmapFrameDecode_GetSize(sourceFrame
, &result
->width
, &result
->height
);
399 hr
= IWICBitmapFrameDecode_GetResolution(sourceFrame
, &result
->dpiX
, &result
->dpiY
);
402 result
->bits
= HeapAlloc(GetProcessHeap(), 0, 4 * result
->width
* result
->height
);
403 if (result
->bits
== NULL
)
410 rect
.Width
= result
->width
;
411 rect
.Height
= result
->height
;
412 hr
= IWICBitmapSource_CopyPixels(sourceBitmap
, &rect
, 4*result
->width
,
413 4*result
->width
*result
->height
, result
->bits
);
417 IWICBitmapDecoder_Release(decoder
);
418 if (sourceFrame
!= NULL
)
419 IWICBitmapFrameDecode_Release(sourceFrame
);
420 if (sourceBitmap
!= NULL
)
421 IWICBitmapSource_Release(sourceBitmap
);
425 static HRESULT WINAPI
IcoDecoder_QueryInterface(IWICBitmapDecoder
*iface
, REFIID iid
,
428 IcoDecoder
*This
= impl_from_IWICBitmapDecoder(iface
);
429 TRACE("(%p,%s,%p)\n", iface
, debugstr_guid(iid
), ppv
);
431 if (!ppv
) return E_INVALIDARG
;
433 if (IsEqualIID(&IID_IUnknown
, iid
) ||
434 IsEqualIID(&IID_IWICBitmapDecoder
, iid
))
436 *ppv
= &This
->IWICBitmapDecoder_iface
;
441 return E_NOINTERFACE
;
444 IUnknown_AddRef((IUnknown
*)*ppv
);
448 static ULONG WINAPI
IcoDecoder_AddRef(IWICBitmapDecoder
*iface
)
450 IcoDecoder
*This
= impl_from_IWICBitmapDecoder(iface
);
451 ULONG ref
= InterlockedIncrement(&This
->ref
);
453 TRACE("(%p) refcount=%u\n", iface
, ref
);
458 static ULONG WINAPI
IcoDecoder_Release(IWICBitmapDecoder
*iface
)
460 IcoDecoder
*This
= impl_from_IWICBitmapDecoder(iface
);
461 ULONG ref
= InterlockedDecrement(&This
->ref
);
463 TRACE("(%p) refcount=%u\n", iface
, ref
);
467 This
->lock
.DebugInfo
->Spare
[0] = 0;
468 DeleteCriticalSection(&This
->lock
);
469 if (This
->stream
) IStream_Release(This
->stream
);
470 HeapFree(GetProcessHeap(), 0, This
);
476 static HRESULT WINAPI
IcoDecoder_QueryCapability(IWICBitmapDecoder
*iface
, IStream
*stream
,
481 TRACE("(%p,%p,%p)\n", iface
, stream
, capability
);
483 if (!stream
|| !capability
) return E_INVALIDARG
;
485 hr
= IWICBitmapDecoder_Initialize(iface
, stream
, WICDecodeMetadataCacheOnDemand
);
486 if (hr
!= S_OK
) return hr
;
488 *capability
= WICBitmapDecoderCapabilityCanDecodeAllImages
;
492 static HRESULT WINAPI
IcoDecoder_Initialize(IWICBitmapDecoder
*iface
, IStream
*pIStream
,
493 WICDecodeOptions cacheOptions
)
495 IcoDecoder
*This
= impl_from_IWICBitmapDecoder(iface
);
499 TRACE("(%p,%p,%x)\n", iface
, pIStream
, cacheOptions
);
501 EnterCriticalSection(&This
->lock
);
503 if (This
->initialized
)
505 hr
= WINCODEC_ERR_WRONGSTATE
;
510 hr
= IStream_Seek(pIStream
, seek
, STREAM_SEEK_SET
, NULL
);
511 if (FAILED(hr
)) goto end
;
513 hr
= IStream_Read(pIStream
, &This
->header
, sizeof(ICONHEADER
), &bytesread
);
514 if (FAILED(hr
)) goto end
;
515 if (bytesread
!= sizeof(ICONHEADER
) ||
516 This
->header
.idReserved
!= 0 ||
517 This
->header
.idType
!= 1)
523 This
->initialized
= TRUE
;
524 This
->stream
= pIStream
;
525 IStream_AddRef(pIStream
);
529 LeaveCriticalSection(&This
->lock
);
534 static HRESULT WINAPI
IcoDecoder_GetContainerFormat(IWICBitmapDecoder
*iface
,
535 GUID
*pguidContainerFormat
)
537 memcpy(pguidContainerFormat
, &GUID_ContainerFormatIco
, sizeof(GUID
));
541 static HRESULT WINAPI
IcoDecoder_GetDecoderInfo(IWICBitmapDecoder
*iface
,
542 IWICBitmapDecoderInfo
**ppIDecoderInfo
)
545 IWICComponentInfo
*compinfo
;
547 TRACE("(%p,%p)\n", iface
, ppIDecoderInfo
);
549 hr
= CreateComponentInfo(&CLSID_WICIcoDecoder
, &compinfo
);
550 if (FAILED(hr
)) return hr
;
552 hr
= IWICComponentInfo_QueryInterface(compinfo
, &IID_IWICBitmapDecoderInfo
,
553 (void**)ppIDecoderInfo
);
555 IWICComponentInfo_Release(compinfo
);
560 static HRESULT WINAPI
IcoDecoder_CopyPalette(IWICBitmapDecoder
*iface
,
561 IWICPalette
*pIPalette
)
563 TRACE("(%p,%p)\n", iface
, pIPalette
);
564 return WINCODEC_ERR_PALETTEUNAVAILABLE
;
567 static HRESULT WINAPI
IcoDecoder_GetMetadataQueryReader(IWICBitmapDecoder
*iface
,
568 IWICMetadataQueryReader
**ppIMetadataQueryReader
)
570 TRACE("(%p,%p)\n", iface
, ppIMetadataQueryReader
);
571 return WINCODEC_ERR_UNSUPPORTEDOPERATION
;
574 static HRESULT WINAPI
IcoDecoder_GetPreview(IWICBitmapDecoder
*iface
,
575 IWICBitmapSource
**ppIBitmapSource
)
577 TRACE("(%p,%p)\n", iface
, ppIBitmapSource
);
578 return WINCODEC_ERR_UNSUPPORTEDOPERATION
;
581 static HRESULT WINAPI
IcoDecoder_GetColorContexts(IWICBitmapDecoder
*iface
,
582 UINT cCount
, IWICColorContext
**ppIColorContexts
, UINT
*pcActualCount
)
584 TRACE("(%p,%u,%p,%p)\n", iface
, cCount
, ppIColorContexts
, pcActualCount
);
585 return WINCODEC_ERR_UNSUPPORTEDOPERATION
;
588 static HRESULT WINAPI
IcoDecoder_GetThumbnail(IWICBitmapDecoder
*iface
,
589 IWICBitmapSource
**ppIThumbnail
)
591 TRACE("(%p,%p)\n", iface
, ppIThumbnail
);
592 return WINCODEC_ERR_CODECNOTHUMBNAIL
;
595 static HRESULT WINAPI
IcoDecoder_GetFrameCount(IWICBitmapDecoder
*iface
,
598 IcoDecoder
*This
= impl_from_IWICBitmapDecoder(iface
);
600 if (!pCount
) return E_INVALIDARG
;
602 EnterCriticalSection(&This
->lock
);
603 *pCount
= This
->initialized
? This
->header
.idCount
: 0;
604 LeaveCriticalSection(&This
->lock
);
606 TRACE("(%p) <-- %d\n", iface
, *pCount
);
611 static HRESULT WINAPI
IcoDecoder_GetFrame(IWICBitmapDecoder
*iface
,
612 UINT index
, IWICBitmapFrameDecode
**ppIBitmapFrame
)
614 IcoDecoder
*This
= impl_from_IWICBitmapDecoder(iface
);
615 IcoFrameDecode
*result
=NULL
;
617 ULARGE_INTEGER offset
, length
;
621 IWICStream
*substream
=NULL
;
623 TRACE("(%p,%u,%p)\n", iface
, index
, ppIBitmapFrame
);
625 EnterCriticalSection(&This
->lock
);
627 if (!This
->initialized
)
629 hr
= WINCODEC_ERR_FRAMEMISSING
;
633 if (This
->header
.idCount
< index
)
639 result
= HeapAlloc(GetProcessHeap(), 0, sizeof(IcoFrameDecode
));
646 result
->IWICBitmapFrameDecode_iface
.lpVtbl
= &IcoFrameDecode_Vtbl
;
650 /* read the icon entry */
651 seek
.QuadPart
= sizeof(ICONHEADER
) + sizeof(ICONDIRENTRY
) * index
;
652 hr
= IStream_Seek(This
->stream
, seek
, STREAM_SEEK_SET
, 0);
653 if (FAILED(hr
)) goto fail
;
655 hr
= IStream_Read(This
->stream
, &entry
, sizeof(ICONDIRENTRY
), &bytesread
);
656 if (FAILED(hr
) || bytesread
!= sizeof(ICONDIRENTRY
)) goto fail
;
658 /* create a stream object for this icon */
659 hr
= StreamImpl_Create(&substream
);
660 if (FAILED(hr
)) goto fail
;
662 offset
.QuadPart
= entry
.dwDIBOffset
;
663 length
.QuadPart
= entry
.dwDIBSize
;
664 hr
= IWICStream_InitializeFromIStreamRegion(substream
, This
->stream
, offset
, length
);
665 if (FAILED(hr
)) goto fail
;
667 /* read the bitmapinfo size or magic number */
668 hr
= IWICStream_Read(substream
, &magic
, sizeof(magic
), &bytesread
);
669 if (FAILED(hr
) || bytesread
!= sizeof(magic
)) goto fail
;
671 /* forward to the appropriate decoding function based on the magic number */
674 case sizeof(BITMAPCOREHEADER
):
675 case 64: /* sizeof(BITMAPCOREHEADER2) */
676 case sizeof(BITMAPINFOHEADER
):
677 case sizeof(BITMAPV4HEADER
):
678 case sizeof(BITMAPV5HEADER
):
679 hr
= ReadIcoDib((IStream
*)substream
, result
);
682 hr
= ReadIcoPng((IStream
*)substream
, result
);
685 FIXME("Unrecognized ICO frame magic: %x\n", magic
);
689 if (FAILED(hr
)) goto fail
;
691 *ppIBitmapFrame
= &result
->IWICBitmapFrameDecode_iface
;
693 LeaveCriticalSection(&This
->lock
);
695 IWICStream_Release(substream
);
700 LeaveCriticalSection(&This
->lock
);
701 HeapFree(GetProcessHeap(), 0, result
);
702 if (substream
) IWICStream_Release(substream
);
703 if (SUCCEEDED(hr
)) hr
= E_FAIL
;
704 TRACE("<-- %x\n", hr
);
708 static const IWICBitmapDecoderVtbl IcoDecoder_Vtbl
= {
709 IcoDecoder_QueryInterface
,
712 IcoDecoder_QueryCapability
,
713 IcoDecoder_Initialize
,
714 IcoDecoder_GetContainerFormat
,
715 IcoDecoder_GetDecoderInfo
,
716 IcoDecoder_CopyPalette
,
717 IcoDecoder_GetMetadataQueryReader
,
718 IcoDecoder_GetPreview
,
719 IcoDecoder_GetColorContexts
,
720 IcoDecoder_GetThumbnail
,
721 IcoDecoder_GetFrameCount
,
725 HRESULT
IcoDecoder_CreateInstance(REFIID iid
, void** ppv
)
730 TRACE("(%s,%p)\n", debugstr_guid(iid
), ppv
);
734 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(IcoDecoder
));
735 if (!This
) return E_OUTOFMEMORY
;
737 This
->IWICBitmapDecoder_iface
.lpVtbl
= &IcoDecoder_Vtbl
;
740 This
->initialized
= FALSE
;
741 InitializeCriticalSection(&This
->lock
);
742 This
->lock
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": IcoDecoder.lock");
744 ret
= IWICBitmapDecoder_QueryInterface(&This
->IWICBitmapDecoder_iface
, iid
, ppv
);
745 IWICBitmapDecoder_Release(&This
->IWICBitmapDecoder_iface
);