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
31 #include "wincodecsdk.h"
33 #include "wincodecs_private.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
40 IWICComponentFactory IWICComponentFactory_iface;
44 static inline ComponentFactory *impl_from_IWICComponentFactory(IWICComponentFactory *iface)
46 return CONTAINING_RECORD(iface, ComponentFactory, IWICComponentFactory_iface);
49 static HRESULT WINAPI ComponentFactory_QueryInterface(IWICComponentFactory *iface, REFIID iid,
52 ComponentFactory *This = impl_from_IWICComponentFactory(iface);
53 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
55 if (!ppv) return E_INVALIDARG;
57 if (IsEqualIID(&IID_IUnknown, iid) ||
58 IsEqualIID(&IID_IWICImagingFactory, iid) ||
59 IsEqualIID(&IID_IWICComponentFactory, iid))
61 *ppv = &This->IWICComponentFactory_iface;
69 IUnknown_AddRef((IUnknown*)*ppv);
73 static ULONG WINAPI ComponentFactory_AddRef(IWICComponentFactory *iface)
75 ComponentFactory *This = impl_from_IWICComponentFactory(iface);
76 ULONG ref = InterlockedIncrement(&This->ref);
78 TRACE("(%p) refcount=%u\n", iface, ref);
83 static ULONG WINAPI ComponentFactory_Release(IWICComponentFactory *iface)
85 ComponentFactory *This = impl_from_IWICComponentFactory(iface);
86 ULONG ref = InterlockedDecrement(&This->ref);
88 TRACE("(%p) refcount=%u\n", iface, ref);
91 HeapFree(GetProcessHeap(), 0, This);
96 static HRESULT WINAPI ComponentFactory_CreateDecoderFromFilename(
97 IWICComponentFactory *iface, LPCWSTR wzFilename, const GUID *pguidVendor,
98 DWORD dwDesiredAccess, WICDecodeOptions metadataOptions,
99 IWICBitmapDecoder **ppIDecoder)
104 TRACE("(%p,%s,%s,%u,%u,%p)\n", iface, debugstr_w(wzFilename),
105 debugstr_guid(pguidVendor), dwDesiredAccess, metadataOptions, ppIDecoder);
107 hr = StreamImpl_Create(&stream);
110 hr = IWICStream_InitializeFromFilename(stream, wzFilename, dwDesiredAccess);
114 hr = IWICComponentFactory_CreateDecoderFromStream(iface, (IStream*)stream,
115 pguidVendor, metadataOptions, ppIDecoder);
118 IWICStream_Release(stream);
124 static IWICBitmapDecoder *find_decoder(IStream *pIStream, const GUID *pguidVendor,
125 WICDecodeOptions metadataOptions)
127 IEnumUnknown *enumdecoders;
128 IUnknown *unkdecoderinfo;
129 IWICBitmapDecoderInfo *decoderinfo;
130 IWICBitmapDecoder *decoder = NULL;
136 res = CreateComponentEnumerator(WICDecoder, WICComponentEnumerateDefault, &enumdecoders);
137 if (FAILED(res)) return NULL;
141 res = IEnumUnknown_Next(enumdecoders, 1, &unkdecoderinfo, &num_fetched);
145 res = IUnknown_QueryInterface(unkdecoderinfo, &IID_IWICBitmapDecoderInfo, (void**)&decoderinfo);
151 res = IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo, &vendor);
152 if (FAILED(res) || !IsEqualIID(&vendor, pguidVendor))
154 IWICBitmapDecoderInfo_Release(decoderinfo);
155 IUnknown_Release(unkdecoderinfo);
160 res = IWICBitmapDecoderInfo_MatchesPattern(decoderinfo, pIStream, &matches);
162 if (SUCCEEDED(res) && matches)
164 res = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, &decoder);
166 /* FIXME: should use QueryCapability to choose a decoder */
170 res = IWICBitmapDecoder_Initialize(decoder, pIStream, metadataOptions);
174 IWICBitmapDecoder_Release(decoder);
180 IWICBitmapDecoderInfo_Release(decoderinfo);
183 IUnknown_Release(unkdecoderinfo);
189 IEnumUnknown_Release(enumdecoders);
194 static HRESULT WINAPI ComponentFactory_CreateDecoderFromStream(
195 IWICComponentFactory *iface, IStream *pIStream, const GUID *pguidVendor,
196 WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
199 IWICBitmapDecoder *decoder = NULL;
201 TRACE("(%p,%p,%s,%u,%p)\n", iface, pIStream, debugstr_guid(pguidVendor),
202 metadataOptions, ppIDecoder);
205 decoder = find_decoder(pIStream, pguidVendor, metadataOptions);
207 decoder = find_decoder(pIStream, NULL, metadataOptions);
211 *ppIDecoder = decoder;
216 if (WARN_ON(wincodecs))
222 WARN("failed to load from a stream\n");
225 res = IStream_Seek(pIStream, seek, STREAM_SEEK_SET, NULL);
227 res = IStream_Read(pIStream, data, 4, &bytesread);
229 WARN("first %i bytes of stream=%x %x %x %x\n", bytesread, data[0], data[1], data[2], data[3]);
232 return WINCODEC_ERR_COMPONENTNOTFOUND;
236 static HRESULT WINAPI ComponentFactory_CreateDecoderFromFileHandle(
237 IWICComponentFactory *iface, ULONG_PTR hFile, const GUID *pguidVendor,
238 WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
240 FIXME("(%p,%lx,%s,%u,%p): stub\n", iface, hFile, debugstr_guid(pguidVendor),
241 metadataOptions, ppIDecoder);
245 static HRESULT WINAPI ComponentFactory_CreateComponentInfo(IWICComponentFactory *iface,
246 REFCLSID clsidComponent, IWICComponentInfo **ppIInfo)
248 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(clsidComponent), ppIInfo);
249 return CreateComponentInfo(clsidComponent, ppIInfo);
252 static HRESULT WINAPI ComponentFactory_CreateDecoder(IWICComponentFactory *iface,
253 REFGUID guidContainerFormat, const GUID *pguidVendor,
254 IWICBitmapDecoder **ppIDecoder)
256 IEnumUnknown *enumdecoders;
257 IUnknown *unkdecoderinfo;
258 IWICBitmapDecoderInfo *decoderinfo;
259 IWICBitmapDecoder *decoder = NULL, *preferred_decoder = NULL;
264 TRACE("(%p,%s,%s,%p)\n", iface, debugstr_guid(guidContainerFormat),
265 debugstr_guid(pguidVendor), ppIDecoder);
267 if (!guidContainerFormat || !ppIDecoder) return E_INVALIDARG;
269 res = CreateComponentEnumerator(WICDecoder, WICComponentEnumerateDefault, &enumdecoders);
270 if (FAILED(res)) return res;
272 while (!preferred_decoder)
274 res = IEnumUnknown_Next(enumdecoders, 1, &unkdecoderinfo, &num_fetched);
275 if (res != S_OK) break;
277 res = IUnknown_QueryInterface(unkdecoderinfo, &IID_IWICBitmapDecoderInfo, (void **)&decoderinfo);
282 res = IWICBitmapDecoderInfo_GetContainerFormat(decoderinfo, &container_guid);
283 if (SUCCEEDED(res) && IsEqualIID(&container_guid, guidContainerFormat))
285 IWICBitmapDecoder *new_decoder;
287 res = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, &new_decoder);
292 res = IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo, &vendor);
293 if (SUCCEEDED(res) && IsEqualIID(&vendor, pguidVendor))
295 preferred_decoder = new_decoder;
300 if (new_decoder && !decoder)
302 decoder = new_decoder;
306 if (new_decoder) IWICBitmapDecoder_Release(new_decoder);
310 IWICBitmapDecoderInfo_Release(decoderinfo);
313 IUnknown_Release(unkdecoderinfo);
316 IEnumUnknown_Release(enumdecoders);
318 if (preferred_decoder)
320 *ppIDecoder = preferred_decoder;
321 if (decoder) IWICBitmapDecoder_Release(decoder);
327 *ppIDecoder = decoder;
332 return WINCODEC_ERR_COMPONENTNOTFOUND;
335 static HRESULT WINAPI ComponentFactory_CreateEncoder(IWICComponentFactory *iface,
336 REFGUID guidContainerFormat, const GUID *pguidVendor,
337 IWICBitmapEncoder **ppIEncoder)
340 IEnumUnknown *enumencoders;
341 IUnknown *unkencoderinfo;
342 IWICBitmapEncoderInfo *encoderinfo;
343 IWICBitmapEncoder *encoder=NULL;
346 GUID actual_containerformat;
348 TRACE("(%p,%s,%s,%p)\n", iface, debugstr_guid(guidContainerFormat),
349 debugstr_guid(pguidVendor), ppIEncoder);
351 if (pguidVendor && !fixme++)
352 FIXME("ignoring vendor GUID\n");
354 res = CreateComponentEnumerator(WICEncoder, WICComponentEnumerateDefault, &enumencoders);
355 if (FAILED(res)) return res;
359 res = IEnumUnknown_Next(enumencoders, 1, &unkencoderinfo, &num_fetched);
363 res = IUnknown_QueryInterface(unkencoderinfo, &IID_IWICBitmapEncoderInfo, (void**)&encoderinfo);
367 res = IWICBitmapEncoderInfo_GetContainerFormat(encoderinfo, &actual_containerformat);
369 if (SUCCEEDED(res) && IsEqualGUID(guidContainerFormat, &actual_containerformat))
371 res = IWICBitmapEncoderInfo_CreateInstance(encoderinfo, &encoder);
376 IWICBitmapEncoderInfo_Release(encoderinfo);
379 IUnknown_Release(unkencoderinfo);
385 IEnumUnknown_Release(enumencoders);
389 *ppIEncoder = encoder;
394 WARN("failed to create encoder\n");
396 return WINCODEC_ERR_COMPONENTNOTFOUND;
400 static HRESULT WINAPI ComponentFactory_CreatePalette(IWICComponentFactory *iface,
401 IWICPalette **ppIPalette)
403 TRACE("(%p,%p)\n", iface, ppIPalette);
404 return PaletteImpl_Create(ppIPalette);
407 static HRESULT WINAPI ComponentFactory_CreateFormatConverter(IWICComponentFactory *iface,
408 IWICFormatConverter **ppIFormatConverter)
410 return FormatConverter_CreateInstance(NULL, &IID_IWICFormatConverter, (void**)ppIFormatConverter);
413 static HRESULT WINAPI ComponentFactory_CreateBitmapScaler(IWICComponentFactory *iface,
414 IWICBitmapScaler **ppIBitmapScaler)
416 TRACE("(%p,%p)\n", iface, ppIBitmapScaler);
418 return BitmapScaler_Create(ppIBitmapScaler);
421 static HRESULT WINAPI ComponentFactory_CreateBitmapClipper(IWICComponentFactory *iface,
422 IWICBitmapClipper **ppIBitmapClipper)
424 FIXME("(%p,%p): stub\n", iface, ppIBitmapClipper);
428 static HRESULT WINAPI ComponentFactory_CreateBitmapFlipRotator(IWICComponentFactory *iface,
429 IWICBitmapFlipRotator **ppIBitmapFlipRotator)
431 TRACE("(%p,%p)\n", iface, ppIBitmapFlipRotator);
432 return FlipRotator_Create(ppIBitmapFlipRotator);
435 static HRESULT WINAPI ComponentFactory_CreateStream(IWICComponentFactory *iface,
436 IWICStream **ppIWICStream)
438 TRACE("(%p,%p)\n", iface, ppIWICStream);
439 return StreamImpl_Create(ppIWICStream);
442 static HRESULT WINAPI ComponentFactory_CreateColorContext(IWICComponentFactory *iface,
443 IWICColorContext **ppIColorContext)
445 FIXME("(%p,%p): stub\n", iface, ppIColorContext);
449 static HRESULT WINAPI ComponentFactory_CreateColorTransformer(IWICComponentFactory *iface,
450 IWICColorTransform **ppIColorTransform)
452 FIXME("(%p,%p): stub\n", iface, ppIColorTransform);
456 static HRESULT WINAPI ComponentFactory_CreateBitmap(IWICComponentFactory *iface,
457 UINT uiWidth, UINT uiHeight, REFWICPixelFormatGUID pixelFormat,
458 WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap)
460 TRACE("(%p,%u,%u,%s,%u,%p)\n", iface, uiWidth, uiHeight,
461 debugstr_guid(pixelFormat), option, ppIBitmap);
462 return BitmapImpl_Create(uiWidth, uiHeight, pixelFormat, option, ppIBitmap);
465 static HRESULT WINAPI ComponentFactory_CreateBitmapFromSource(IWICComponentFactory *iface,
466 IWICBitmapSource *piBitmapSource, WICBitmapCreateCacheOption option,
467 IWICBitmap **ppIBitmap)
470 IWICBitmapLock *lock;
471 IWICPalette *palette;
473 WICPixelFormatGUID pixelformat = {0};
477 IWICComponentInfo *info;
478 IWICPixelFormatInfo2 *formatinfo;
479 WICPixelFormatNumericRepresentation format_type;
481 TRACE("(%p,%p,%u,%p)\n", iface, piBitmapSource, option, ppIBitmap);
483 if (!piBitmapSource || !ppIBitmap)
486 hr = IWICBitmapSource_GetSize(piBitmapSource, &width, &height);
489 hr = IWICBitmapSource_GetPixelFormat(piBitmapSource, &pixelformat);
492 hr = CreateComponentInfo(&pixelformat, &info);
496 hr = IWICComponentInfo_QueryInterface(info, &IID_IWICPixelFormatInfo2, (void**)&formatinfo);
500 hr = IWICPixelFormatInfo2_GetNumericRepresentation(formatinfo, &format_type);
502 IWICPixelFormatInfo2_Release(formatinfo);
505 IWICComponentInfo_Release(info);
509 hr = BitmapImpl_Create(width, height, &pixelformat, option, &result);
513 hr = IWICBitmap_Lock(result, NULL, WICBitmapLockWrite, &lock);
516 UINT stride, buffersize;
522 hr = IWICBitmapLock_GetStride(lock, &stride);
525 hr = IWICBitmapLock_GetDataPointer(lock, &buffersize, &buffer);
528 hr = IWICBitmapSource_CopyPixels(piBitmapSource, &rc, stride,
531 IWICBitmapLock_Release(lock);
535 hr = PaletteImpl_Create(&palette);
537 if (SUCCEEDED(hr) && (format_type == WICPixelFormatNumericRepresentationUnspecified ||
538 format_type == WICPixelFormatNumericRepresentationIndexed))
540 hr = IWICBitmapSource_CopyPalette(piBitmapSource, palette);
543 hr = IWICBitmap_SetPalette(result, palette);
547 IWICPalette_Release(palette);
552 hr = IWICBitmapSource_GetResolution(piBitmapSource, &dpix, &dpiy);
555 hr = IWICBitmap_SetResolution(result, dpix, dpiy);
563 IWICBitmap_Release(result);
569 static HRESULT WINAPI ComponentFactory_CreateBitmapFromSourceRect(IWICComponentFactory *iface,
570 IWICBitmapSource *piBitmapSource, UINT x, UINT y, UINT width, UINT height,
571 IWICBitmap **ppIBitmap)
573 FIXME("(%p,%p,%u,%u,%u,%u,%p): stub\n", iface, piBitmapSource, x, y, width,
578 static HRESULT WINAPI ComponentFactory_CreateBitmapFromMemory(IWICComponentFactory *iface,
579 UINT uiWidth, UINT uiHeight, REFWICPixelFormatGUID pixelFormat, UINT cbStride,
580 UINT cbBufferSize, BYTE *pbBuffer, IWICBitmap **ppIBitmap)
582 FIXME("(%p,%u,%u,%s,%u,%u,%p,%p): stub\n", iface, uiWidth, uiHeight,
583 debugstr_guid(pixelFormat), cbStride, cbBufferSize, pbBuffer, ppIBitmap);
587 static HRESULT WINAPI ComponentFactory_CreateBitmapFromHBITMAP(IWICComponentFactory *iface,
588 HBITMAP hBitmap, HPALETTE hPalette, WICBitmapAlphaChannelOption options,
589 IWICBitmap **ppIBitmap)
591 FIXME("(%p,%p,%p,%u,%p): stub\n", iface, hBitmap, hPalette, options, ppIBitmap);
595 static HRESULT WINAPI ComponentFactory_CreateBitmapFromHICON(IWICComponentFactory *iface,
596 HICON hIcon, IWICBitmap **ppIBitmap)
598 FIXME("(%p,%p,%p): stub\n", iface, hIcon, ppIBitmap);
602 static HRESULT WINAPI ComponentFactory_CreateComponentEnumerator(IWICComponentFactory *iface,
603 DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown)
605 TRACE("(%p,%u,%u,%p)\n", iface, componentTypes, options, ppIEnumUnknown);
606 return CreateComponentEnumerator(componentTypes, options, ppIEnumUnknown);
609 static HRESULT WINAPI ComponentFactory_CreateFastMetadataEncoderFromDecoder(
610 IWICComponentFactory *iface, IWICBitmapDecoder *pIDecoder,
611 IWICFastMetadataEncoder **ppIFastEncoder)
613 FIXME("(%p,%p,%p): stub\n", iface, pIDecoder, ppIFastEncoder);
617 static HRESULT WINAPI ComponentFactory_CreateFastMetadataEncoderFromFrameDecode(
618 IWICComponentFactory *iface, IWICBitmapFrameDecode *pIFrameDecoder,
619 IWICFastMetadataEncoder **ppIFastEncoder)
621 FIXME("(%p,%p,%p): stub\n", iface, pIFrameDecoder, ppIFastEncoder);
625 static HRESULT WINAPI ComponentFactory_CreateQueryWriter(IWICComponentFactory *iface,
626 REFGUID guidMetadataFormat, const GUID *pguidVendor,
627 IWICMetadataQueryWriter **ppIQueryWriter)
629 FIXME("(%p,%s,%s,%p): stub\n", iface, debugstr_guid(guidMetadataFormat),
630 debugstr_guid(pguidVendor), ppIQueryWriter);
634 static HRESULT WINAPI ComponentFactory_CreateQueryWriterFromReader(IWICComponentFactory *iface,
635 IWICMetadataQueryReader *pIQueryReader, const GUID *pguidVendor,
636 IWICMetadataQueryWriter **ppIQueryWriter)
638 FIXME("(%p,%p,%s,%p): stub\n", iface, pIQueryReader, debugstr_guid(pguidVendor),
643 static HRESULT WINAPI ComponentFactory_CreateMetadataReader(IWICComponentFactory *iface,
644 REFGUID format, const GUID *vendor, DWORD options, IStream *stream, IWICMetadataReader **reader)
646 FIXME("%p,%s,%s,%x,%p,%p: stub\n", iface, debugstr_guid(format), debugstr_guid(vendor),
647 options, stream, reader);
651 static HRESULT WINAPI ComponentFactory_CreateMetadataReaderFromContainer(IWICComponentFactory *iface,
652 REFGUID format, const GUID *vendor, DWORD options, IStream *stream, IWICMetadataReader **reader)
654 FIXME("%p,%s,%s,%x,%p,%p: stub\n", iface, debugstr_guid(format), debugstr_guid(vendor),
655 options, stream, reader);
659 static HRESULT WINAPI ComponentFactory_CreateMetadataWriter(IWICComponentFactory *iface,
660 REFGUID format, const GUID *vendor, DWORD options, IWICMetadataWriter **writer)
662 FIXME("%p,%s,%s,%x,%p: stub\n", iface, debugstr_guid(format), debugstr_guid(vendor), options, writer);
666 static HRESULT WINAPI ComponentFactory_CreateMetadataWriterFromReader(IWICComponentFactory *iface,
667 IWICMetadataReader *reader, const GUID *vendor, IWICMetadataWriter **writer)
669 FIXME("%p,%p,%s,%p: stub\n", iface, reader, debugstr_guid(vendor), writer);
673 static HRESULT WINAPI ComponentFactory_CreateQueryReaderFromBlockReader(IWICComponentFactory *iface,
674 IWICMetadataBlockReader *block_reader, IWICMetadataQueryReader **query_reader)
676 FIXME("%p,%p,%p: stub\n", iface, block_reader, query_reader);
680 static HRESULT WINAPI ComponentFactory_CreateQueryWriterFromBlockWriter(IWICComponentFactory *iface,
681 IWICMetadataBlockWriter *block_writer, IWICMetadataQueryWriter **query_writer)
683 FIXME("%p,%p,%p: stub\n", iface, block_writer, query_writer);
687 static HRESULT WINAPI ComponentFactory_CreateEncoderPropertyBag(IWICComponentFactory *iface,
688 PROPBAG2 *options, UINT count, IPropertyBag2 **property)
690 FIXME("%p,%p,%u,%p: stub\n", iface, options, count, property);
694 static const IWICComponentFactoryVtbl ComponentFactory_Vtbl = {
695 ComponentFactory_QueryInterface,
696 ComponentFactory_AddRef,
697 ComponentFactory_Release,
698 ComponentFactory_CreateDecoderFromFilename,
699 ComponentFactory_CreateDecoderFromStream,
700 ComponentFactory_CreateDecoderFromFileHandle,
701 ComponentFactory_CreateComponentInfo,
702 ComponentFactory_CreateDecoder,
703 ComponentFactory_CreateEncoder,
704 ComponentFactory_CreatePalette,
705 ComponentFactory_CreateFormatConverter,
706 ComponentFactory_CreateBitmapScaler,
707 ComponentFactory_CreateBitmapClipper,
708 ComponentFactory_CreateBitmapFlipRotator,
709 ComponentFactory_CreateStream,
710 ComponentFactory_CreateColorContext,
711 ComponentFactory_CreateColorTransformer,
712 ComponentFactory_CreateBitmap,
713 ComponentFactory_CreateBitmapFromSource,
714 ComponentFactory_CreateBitmapFromSourceRect,
715 ComponentFactory_CreateBitmapFromMemory,
716 ComponentFactory_CreateBitmapFromHBITMAP,
717 ComponentFactory_CreateBitmapFromHICON,
718 ComponentFactory_CreateComponentEnumerator,
719 ComponentFactory_CreateFastMetadataEncoderFromDecoder,
720 ComponentFactory_CreateFastMetadataEncoderFromFrameDecode,
721 ComponentFactory_CreateQueryWriter,
722 ComponentFactory_CreateQueryWriterFromReader,
723 ComponentFactory_CreateMetadataReader,
724 ComponentFactory_CreateMetadataReaderFromContainer,
725 ComponentFactory_CreateMetadataWriter,
726 ComponentFactory_CreateMetadataWriterFromReader,
727 ComponentFactory_CreateQueryReaderFromBlockReader,
728 ComponentFactory_CreateQueryWriterFromBlockWriter,
729 ComponentFactory_CreateEncoderPropertyBag
732 HRESULT ComponentFactory_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
734 ComponentFactory *This;
737 TRACE("(%p,%s,%p)\n", pUnkOuter, debugstr_guid(iid), ppv);
741 if (pUnkOuter) return CLASS_E_NOAGGREGATION;
743 This = HeapAlloc(GetProcessHeap(), 0, sizeof(ComponentFactory));
744 if (!This) return E_OUTOFMEMORY;
746 This->IWICComponentFactory_iface.lpVtbl = &ComponentFactory_Vtbl;
749 ret = IWICComponentFactory_QueryInterface(&This->IWICComponentFactory_iface, iid, ppv);
750 IWICComponentFactory_Release(&This->IWICComponentFactory_iface);