Commit 9f58bef1 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Add WICIfdMetadataReader registration.

parent 781113f4
......@@ -1290,18 +1290,43 @@ static struct regsvr_converter const converter_list[] = {
{ NULL } /* list terminator */
};
static const BYTE no_magic[1] = { 0 };
static const BYTE no_mask[1] = { 0 };
static const struct metadata_pattern ifd_metadata_pattern[] = {
{ 0, 1, no_magic, no_mask, 0 },
{ 0 }
};
static const struct reader_containers ifd_containers[] = {
{
&GUID_ContainerFormatTiff,
ifd_metadata_pattern
},
{ NULL } /* list terminator */
};
static struct regsvr_metadatareader const metadatareader_list[] = {
{ &CLSID_WICUnknownMetadataReader,
"The Wine Project",
"Unknown Metadata Reader",
"1.0.0.0",
"1.0.0.0",
&GUID_VendorMicrosoft,
&GUID_MetadataFormatUnknown,
0,
0,
0,
NULL
"The Wine Project",
"Unknown Metadata Reader",
"1.0.0.0",
"1.0.0.0",
&GUID_VendorMicrosoft,
&GUID_MetadataFormatUnknown,
0, 0, 0,
NULL
},
{
&CLSID_WICIfdMetadataReader,
"The Wine Project",
"Ifd Reader",
"1.0.0.0",
"1.0.0.0",
&GUID_VendorMicrosoft,
&GUID_MetadataFormatIfd,
1, 1, 0,
ifd_containers
},
{ NULL } /* list terminator */
};
......
......@@ -364,8 +364,7 @@ static void test_metadata_IFD(void)
hr = CoCreateInstance(&CLSID_WICIfdMetadataReader, NULL, CLSCTX_INPROC_SERVER,
&IID_IWICMetadataReader, (void**)&reader);
todo_wine ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
if (FAILED(hr)) return;
ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
hr = IWICMetadataReader_GetCount(reader, NULL);
ok(hr == E_INVALIDARG, "GetCount error %#x\n", hr);
......@@ -378,6 +377,7 @@ static void test_metadata_IFD(void)
hr = IWICMetadataReader_GetCount(reader, &count);
ok(hr == S_OK, "GetCount error %#x\n", hr);
todo_wine
ok(count == 6, "unexpected count %u\n", count);
hr = IWICMetadataReader_GetEnumerator(reader, NULL);
......@@ -410,14 +410,22 @@ static void test_metadata_IFD(void)
IWICEnumMetadataItem_Release(enumerator);
hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
todo_wine
ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
todo_wine
ok(IsEqualGUID(&format, &GUID_MetadataFormatIfd), "unexpected format %s\n", debugstr_guid(&format));
hr = IWICMetadataReader_GetMetadataFormat(reader, NULL);
ok(hr == E_INVALIDARG, "GetMetadataFormat should fail\n");
hr = IWICMetadataReader_GetValueByIndex(reader, 0, NULL, NULL, NULL);
todo_wine
ok(hr == S_OK, "GetValueByIndex error %#x\n", hr);
if (FAILED(hr))
{
IWICMetadataReader_Release(reader);
return;
}
hr = IWICMetadataReader_GetValueByIndex(reader, count - 1, NULL, NULL, NULL);
ok(hr == S_OK, "GetValueByIndex error %#x\n", hr);
......
......@@ -128,3 +128,10 @@ coclass WineTgaDecoder { interface IWICBitmapDecoder; }
uuid(699745c2-5066-4b82-a8e3-d40478dbec8c)
]
coclass WICUnknownMetadataReader { interface IWICMetadataReader; }
[
helpstring("WIC Ifd Metadata Reader"),
threading(both),
uuid(8f914656-9d0a-4eb2-9019-0bf96d8a9ee6)
]
coclass WICIfdMetadataReader { interface IWICIfdMetadataReader; }
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