Commit fa455f59 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

windowscodecs: Add fallback to unknown metadata reader.

parent 1dee3734
......@@ -1050,7 +1050,30 @@ start:
IEnumUnknown_Release(enumreaders);
if (!*reader && !(options & WICMetadataCreationFailUnknown))
FIXME("create unknown metadata reader\n");
{
hr = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
if (SUCCEEDED(hr))
hr = UnknownMetadataReader_CreateInstance(&IID_IWICMetadataReader, (void**)reader);
if (SUCCEEDED(hr))
{
hr = IWICMetadataReader_QueryInterface(*reader, &IID_IWICPersistStream, (void**)&wicpersiststream);
if (SUCCEEDED(hr))
{
hr = IWICPersistStream_LoadEx(wicpersiststream, stream, NULL, options & WICPersistOptionsMask);
IWICPersistStream_Release(wicpersiststream);
}
if (FAILED(hr))
{
IWICMetadataReader_Release(*reader);
*reader = NULL;
}
}
}
if (*reader)
return S_OK;
......
......@@ -876,7 +876,7 @@ static void test_create_reader(void)
hr = IWICComponentFactory_CreateMetadataReaderFromContainer(factory,
&GUID_ContainerFormatWmp, NULL, WICPersistOptionsDefault,
stream, &reader);
todo_wine ok(hr == S_OK, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
ok(hr == S_OK, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
if (SUCCEEDED(hr))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment