From 7baf4ecd064a0c226ce3ceb2b83182a70328d65e Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 22 Nov 2012 18:27:22 +0800 Subject: [PATCH] windowscodecs: Implement QueryCapability in the GIF decoder. --- dlls/windowscodecs/gifformat.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index eb8a37be4f1..d87a6e76f96 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -1064,11 +1064,22 @@ static ULONG WINAPI GifDecoder_Release(IWICBitmapDecoder *iface) return ref; } -static HRESULT WINAPI GifDecoder_QueryCapability(IWICBitmapDecoder *iface, IStream *pIStream, - DWORD *pdwCapability) +static HRESULT WINAPI GifDecoder_QueryCapability(IWICBitmapDecoder *iface, IStream *stream, + DWORD *capability) { - FIXME("(%p,%p,%p): stub\n", iface, pIStream, pdwCapability); - return E_NOTIMPL; + HRESULT hr; + + TRACE("(%p,%p,%p)\n", iface, stream, capability); + + if (!stream || !capability) return E_INVALIDARG; + + hr = IWICBitmapDecoder_Initialize(iface, stream, WICDecodeMetadataCacheOnDemand); + if (hr != S_OK) return hr; + + *capability = WICBitmapDecoderCapabilityCanDecodeAllImages | + WICBitmapDecoderCapabilityCanDecodeSomeImages | + WICBitmapDecoderCapabilityCanEnumerateMetadata; + return S_OK; } static int _gif_inputfunc(GifFileType *gif, GifByteType *data, int len) {