Please add a test showing that some builtin metadata handler implements this interface.
On Thu, May 24, 2012 at 4:39 AM, Dmitry Timoshkov dmitry@baikal.ru wrote:
dlls/windowscodecs/metadatahandler.c | 69 ++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+)
diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c index afcff21..ffe6763 100644 --- a/dlls/windowscodecs/metadatahandler.c +++ b/dlls/windowscodecs/metadatahandler.c @@ -39,6 +39,7 @@ typedef struct MetadataHandler { IWICMetadataWriter IWICMetadataWriter_iface; LONG ref; IWICPersistStream IWICPersistStream_iface;
- IWICMetadataBlockReader IWICMetadataBlockReader_iface;
const MetadataHandlerVtbl *vtable; MetadataItem *items; DWORD item_count; @@ -55,6 +56,11 @@ static inline MetadataHandler *impl_from_IWICPersistStream(IWICPersistStream *if return CONTAINING_RECORD(iface, MetadataHandler, IWICPersistStream_iface); }
+static inline MetadataHandler *impl_from_IWICMetadataBlockReader(IWICMetadataBlockReader *iface) +{
- return CONTAINING_RECORD(iface, MetadataHandler, IWICMetadataBlockReader_iface);
+}
static void MetadataHandler_FreeItems(MetadataHandler *This) { int i; @@ -92,6 +98,10 @@ static HRESULT WINAPI MetadataHandler_QueryInterface(IWICMetadataWriter *iface, { *ppv = &This->IWICPersistStream_iface; }
- else if (IsEqualIID(&IID_IWICMetadataBlockReader, iid))
- {
- *ppv = &This->IWICMetadataBlockReader_iface;
- }
else { *ppv = NULL; @@ -317,6 +327,64 @@ static const IWICPersistStreamVtbl MetadataHandler_PersistStream_Vtbl = { MetadataHandler_SaveEx };
+static HRESULT WINAPI MetadataHandler_MetadataBlockReader_QueryInterface(IWICMetadataBlockReader *iface,
- REFIID iid, void **ppv)
+{
- MetadataHandler *This = impl_from_IWICMetadataBlockReader(iface);
- return IWICMetadataWriter_QueryInterface(&This->IWICMetadataWriter_iface, iid, ppv);
+}
+static ULONG WINAPI MetadataHandler_MetadataBlockReader_AddRef(IWICMetadataBlockReader *iface) +{
- MetadataHandler *This = impl_from_IWICMetadataBlockReader(iface);
- return IWICMetadataWriter_AddRef(&This->IWICMetadataWriter_iface);
+}
+static ULONG WINAPI MetadataHandler_MetadataBlockReader_Release(IWICMetadataBlockReader *iface) +{
- MetadataHandler *This = impl_from_IWICMetadataBlockReader(iface);
- return IWICMetadataWriter_Release(&This->IWICMetadataWriter_iface);
+}
+static HRESULT WINAPI MetadataHandler_MetadataBlockReader_GetContainerFormat(
- IWICMetadataBlockReader *iface, GUID *guid)
+{
- FIXME("(%p,%p): stub\n", iface, guid);
- return E_NOTIMPL;
+}
+static HRESULT WINAPI MetadataHandler_MetadataBlockReader_GetCount(
- IWICMetadataBlockReader *iface, UINT *count)
+{
- FIXME("(%p,%p): stub\n", iface, count);
- return E_NOTIMPL;
+}
+static HRESULT WINAPI MetadataHandler_MetadataBlockReader_GetReaderByIndex(
- IWICMetadataBlockReader *iface, UINT index, IWICMetadataReader **reader)
+{
- FIXME("(%p,%u,%p): stub\n", iface, index, reader);
- return E_NOTIMPL;
+}
+static HRESULT WINAPI MetadataHandler_MetadataBlockReader_GetEnumerator(
- IWICMetadataBlockReader *iface, IEnumUnknown **enum_metadata)
+{
- FIXME("(%p,%p): stub\n", iface, enum_metadata);
- return E_NOTIMPL;
+}
+static const IWICMetadataBlockReaderVtbl MetadataHandler_MetadataBlockReader_Vtbl = +{
- MetadataHandler_MetadataBlockReader_QueryInterface,
- MetadataHandler_MetadataBlockReader_AddRef,
- MetadataHandler_MetadataBlockReader_Release,
- MetadataHandler_MetadataBlockReader_GetContainerFormat,
- MetadataHandler_MetadataBlockReader_GetCount,
- MetadataHandler_MetadataBlockReader_GetReaderByIndex,
- MetadataHandler_MetadataBlockReader_GetEnumerator
+};
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, IUnknown *pUnkOuter, REFIID iid, void** ppv) { MetadataHandler *This; @@ -333,6 +401,7 @@ HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, IUnknown *pUnkO
This->IWICMetadataWriter_iface.lpVtbl = &MetadataHandler_Vtbl; This->IWICPersistStream_iface.lpVtbl = &MetadataHandler_PersistStream_Vtbl;
- This->IWICMetadataBlockReader_iface.lpVtbl = &MetadataHandler_MetadataBlockReader_Vtbl;
This->ref = 1; This->vtable = vtable; This->items = NULL; -- 1.7.10.1