windowscodecs: Implement IWICComponentInfo::GetCLSID.

This commit is contained in:
Vincent Povirk 2010-09-05 22:22:52 -05:00 committed by Alexandre Julliard
parent a53a57b79e
commit 06c35e8b75
2 changed files with 35 additions and 6 deletions

View File

@ -132,8 +132,15 @@ static HRESULT WINAPI BitmapDecoderInfo_GetComponentType(IWICBitmapDecoderInfo *
static HRESULT WINAPI BitmapDecoderInfo_GetCLSID(IWICBitmapDecoderInfo *iface, CLSID *pclsid) static HRESULT WINAPI BitmapDecoderInfo_GetCLSID(IWICBitmapDecoderInfo *iface, CLSID *pclsid)
{ {
FIXME("(%p,%p): stub\n", iface, pclsid); BitmapDecoderInfo *This = (BitmapDecoderInfo*)iface;
return E_NOTIMPL; 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) 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) static HRESULT WINAPI BitmapEncoderInfo_GetCLSID(IWICBitmapEncoderInfo *iface, CLSID *pclsid)
{ {
FIXME("(%p,%p): stub\n", iface, pclsid); BitmapEncoderInfo *This = (BitmapEncoderInfo*)iface;
return E_NOTIMPL; 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) 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) static HRESULT WINAPI FormatConverterInfo_GetCLSID(IWICFormatConverterInfo *iface, CLSID *pclsid)
{ {
FIXME("(%p,%p): stub\n", iface, pclsid); FormatConverterInfo *This = (FormatConverterInfo*)iface;
return E_NOTIMPL; 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) static HRESULT WINAPI FormatConverterInfo_GetSigningStatus(IWICFormatConverterInfo *iface, DWORD *pStatus)

View File

@ -35,6 +35,7 @@ static void test_decoder_info(void)
ULONG len; ULONG len;
WCHAR value[256]; WCHAR value[256];
const WCHAR expected_mimetype[] = {'i','m','a','g','e','/','b','m','p',0}; const WCHAR expected_mimetype[] = {'i','m','a','g','e','/','b','m','p',0};
CLSID clsid;
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
&IID_IWICImagingFactory, (void**)&factory); &IID_IWICImagingFactory, (void**)&factory);
@ -47,6 +48,13 @@ static void test_decoder_info(void)
hr = IWICComponentInfo_QueryInterface(info, &IID_IWICBitmapDecoderInfo, (void**)&decoder_info); hr = IWICComponentInfo_QueryInterface(info, &IID_IWICBitmapDecoderInfo, (void**)&decoder_info);
ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr); 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); hr = IWICBitmapDecoderInfo_GetMimeTypes(decoder_info, 0, NULL, NULL);
ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%x\n", hr); ok(hr == E_INVALIDARG, "GetMimeType failed, hr=%x\n", hr);