windowscodecs: Return correct error codes from BmpFrameEncode_GetMetadataQueryWriter().

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2021-01-27 20:33:51 +03:00 committed by Alexandre Julliard
parent 7f88d691ad
commit 79d143973b
2 changed files with 11 additions and 5 deletions

View File

@ -397,10 +397,16 @@ static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface)
}
static HRESULT WINAPI BmpFrameEncode_GetMetadataQueryWriter(IWICBitmapFrameEncode *iface,
IWICMetadataQueryWriter **ppIMetadataQueryWriter)
IWICMetadataQueryWriter **query_writer)
{
FIXME("(%p, %p): stub\n", iface, ppIMetadataQueryWriter);
return E_NOTIMPL;
BmpFrameEncode *encoder = impl_from_IWICBitmapFrameEncode(iface);
TRACE("iface %p, query_writer %p.\n", iface, query_writer);
if (!encoder->initialized)
return WINCODEC_ERR_NOTINITIALIZED;
return WINCODEC_ERR_UNSUPPORTEDOPERATION;
}
static const IWICBitmapFrameEncodeVtbl BmpFrameEncode_Vtbl = {

View File

@ -3106,7 +3106,7 @@ static void test_metadata_writer(void)
ok(hr == (tests[i].metadata_supported ? S_OK : E_INVALIDARG), "Got unexpected hr %#x, i %u.\n", hr, i);
hr = IWICBitmapFrameEncode_GetMetadataQueryWriter(frameencode, &querywriter2);
todo_wine_if(!i) ok(hr == (tests[i].succeeds_unitialized ? S_OK : WINCODEC_ERR_NOTINITIALIZED),
ok(hr == (tests[i].succeeds_unitialized ? S_OK : WINCODEC_ERR_NOTINITIALIZED),
"Got unexpected hr %#x, i %u.\n", hr, i);
if (hr == S_OK)
IWICMetadataQueryWriter_Release(querywriter2);
@ -3115,7 +3115,7 @@ static void test_metadata_writer(void)
ok(hr == S_OK, "Got unexpected hr %#x, i %u.\n", hr, i);
hr = IWICBitmapFrameEncode_GetMetadataQueryWriter(frameencode, &querywriter2);
todo_wine_if(!i) ok(hr == (tests[i].metadata_supported ? S_OK : WINCODEC_ERR_UNSUPPORTEDOPERATION),
ok(hr == (tests[i].metadata_supported ? S_OK : WINCODEC_ERR_UNSUPPORTEDOPERATION),
"Got unexpected hr %#x, i %u.\n", hr, i);
if (tests[i].metadata_supported)