From 67eafab883e9a9c5c22aa990806d35154d4e9dec Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 23 Nov 2012 11:49:23 +0800 Subject: [PATCH] windowscodecs: Implement QueryCapability of the JPEG decoder. --- dlls/windowscodecs/jpegformat.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index e9c722e5197..57f1b55e4fa 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -220,11 +220,22 @@ static ULONG WINAPI JpegDecoder_Release(IWICBitmapDecoder *iface) return ref; } -static HRESULT WINAPI JpegDecoder_QueryCapability(IWICBitmapDecoder *iface, IStream *pIStream, - DWORD *pdwCapability) +static HRESULT WINAPI JpegDecoder_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; + /* FIXME: WICBitmapDecoderCapabilityCanEnumerateMetadata */ + return S_OK; } static void source_mgr_init_source(j_decompress_ptr cinfo)