From 6df268cc276db358c58d1f0fdf31f5a5a6050069 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sun, 5 Sep 2010 22:22:52 -0500 Subject: [PATCH 5/5] windowscodecs: Implement IWICComponentInfo::GetCLSID. --- dlls/windowscodecs/info.c | 33 +++++++++++++++++++++++++++------ dlls/windowscodecs/tests/info.c | 8 ++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c index 877ac4a..569b1a8 100644 --- a/dlls/windowscodecs/info.c +++ b/dlls/windowscodecs/info.c @@ -132,8 +132,15 @@ static HRESULT WINAPI BitmapDecoderInfo_GetComponentType(IWICBitmapDecoderInfo * static HRESULT WINAPI BitmapDecoderInfo_GetCLSID(IWICBitmapDecoderInfo *iface, CLSID *pclsid) { - FIXME("(%p,%p): stub\n", iface, pclsid); - return E_NOTIMPL; + BitmapDecoderInfo *This = (BitmapDecoderInfo*)iface; + TRACE("(%p,%p)\n", iface, pclsid); + + if (!pclsid) + return E_INVALIDARG; + + memcpy(pclsid, &This->clsid, sizeof(CLSID)); + + return S_OK; } static HRESULT WINAPI BitmapDecoderInfo_GetSigningStatus(IWICBitmapDecoderInfo *iface, DWORD *pStatus) @@ -564,8 +571,15 @@ static HRESULT WINAPI BitmapEncoderInfo_GetComponentType(IWICBitmapEncoderInfo * static HRESULT WINAPI BitmapEncoderInfo_GetCLSID(IWICBitmapEncoderInfo *iface, CLSID *pclsid) { - FIXME("(%p,%p): stub\n", iface, pclsid); - return E_NOTIMPL; + BitmapEncoderInfo *This = (BitmapEncoderInfo*)iface; + TRACE("(%p,%p)\n", iface, pclsid); + + if (!pclsid) + return E_INVALIDARG; + + memcpy(pclsid, &This->clsid, sizeof(CLSID)); + + return S_OK; } static HRESULT WINAPI BitmapEncoderInfo_GetSigningStatus(IWICBitmapEncoderInfo *iface, DWORD *pStatus) @@ -821,8 +835,15 @@ static HRESULT WINAPI FormatConverterInfo_GetComponentType(IWICFormatConverterIn static HRESULT WINAPI FormatConverterInfo_GetCLSID(IWICFormatConverterInfo *iface, CLSID *pclsid) { - FIXME("(%p,%p): stub\n", iface, pclsid); - return E_NOTIMPL; + FormatConverterInfo *This = (FormatConverterInfo*)iface; + TRACE("(%p,%p)\n", iface, pclsid); + + if (!pclsid) + return E_INVALIDARG; + + memcpy(pclsid, &This->clsid, sizeof(CLSID)); + + return S_OK; } static HRESULT WINAPI FormatConverterInfo_GetSigningStatus(IWICFormatConverterInfo *iface, DWORD *pStatus) diff --git a/dlls/windowscodecs/tests/info.c b/dlls/windowscodecs/tests/info.c index 74d2748..de2dd32 100644 --- a/dlls/windowscodecs/tests/info.c +++ b/dlls/windowscodecs/tests/info.c @@ -35,6 +35,7 @@ static void test_decoder_info(void) ULONG len; WCHAR value[256]; const WCHAR expected_mimetype[] = {'i','m','a','g','e','/','b','m','p',0}; + CLSID clsid; hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void**)&factory); @@ -47,6 +48,13 @@ static void test_decoder_info(void) hr = IWICComponentInfo_QueryInterface(info, &IID_IWICBitmapDecoderInfo, (void**)&decoder_info); ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr); + hr = IWICBitmapDecoderInfo_GetCLSID(decoder_info, NULL); + ok(hr == E_INVALIDARG, "GetCLSID failed, hr=%x\n", hr); + + hr = IWICBitmapDecoderInfo_GetCLSID(decoder_info, &clsid); + ok(hr == S_OK, "GetCLSID failed, hr=%x\n", hr); + ok(IsEqualGUID(&CLSID_WICBmpDecoder, &clsid), "GetCLSID returned wrong result\n"); + hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 0, NULL, NULL); ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%x\n", hr); -- 1.6.3.3