2 * Copyright 2016 Andrew Eikum for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wincodecs_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(wincodecs
);
36 IWICMetadataQueryReader IWICMetadataQueryReader_iface
;
40 IWICMetadataBlockReader
*block
;
43 static inline QueryReader
*impl_from_IWICMetadataQueryReader(IWICMetadataQueryReader
*iface
)
45 return CONTAINING_RECORD(iface
, QueryReader
, IWICMetadataQueryReader_iface
);
48 static HRESULT WINAPI
mqr_QueryInterface(IWICMetadataQueryReader
*iface
, REFIID riid
,
51 QueryReader
*This
= impl_from_IWICMetadataQueryReader(iface
);
53 TRACE("(%p,%s,%p)\n", This
, debugstr_guid(riid
), ppvObject
);
55 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
56 IsEqualGUID(riid
, &IID_IWICMetadataQueryReader
))
57 *ppvObject
= &This
->IWICMetadataQueryReader_iface
;
63 IUnknown_AddRef((IUnknown
*)*ppvObject
);
70 static ULONG WINAPI
mqr_AddRef(IWICMetadataQueryReader
*iface
)
72 QueryReader
*This
= impl_from_IWICMetadataQueryReader(iface
);
73 ULONG ref
= InterlockedIncrement(&This
->ref
);
74 TRACE("(%p) refcount=%u\n", This
, ref
);
78 static ULONG WINAPI
mqr_Release(IWICMetadataQueryReader
*iface
)
80 QueryReader
*This
= impl_from_IWICMetadataQueryReader(iface
);
81 ULONG ref
= InterlockedDecrement(&This
->ref
);
82 TRACE("(%p) refcount=%u\n", This
, ref
);
85 IWICMetadataBlockReader_Release(This
->block
);
86 HeapFree(GetProcessHeap(), 0, This
);
91 static HRESULT WINAPI
mqr_GetContainerFormat(IWICMetadataQueryReader
*iface
,
92 GUID
*pguidContainerFormat
)
94 QueryReader
*This
= impl_from_IWICMetadataQueryReader(iface
);
95 FIXME("(%p,%p)\n", This
, pguidContainerFormat
);
99 static HRESULT WINAPI
mqr_GetLocation(IWICMetadataQueryReader
*iface
,
100 UINT cchMaxLength
, WCHAR
*wzNamespace
, UINT
*pcchActualLength
)
102 QueryReader
*This
= impl_from_IWICMetadataQueryReader(iface
);
103 FIXME("(%p,%u,%p,%p)\n", This
, cchMaxLength
, wzNamespace
, pcchActualLength
);
107 static HRESULT WINAPI
mqr_GetMetadataByName(IWICMetadataQueryReader
*iface
,
108 LPCWSTR wzName
, PROPVARIANT
*pvarValue
)
110 QueryReader
*This
= impl_from_IWICMetadataQueryReader(iface
);
111 FIXME("(%p,%s,%p)\n", This
, wine_dbgstr_w(wzName
), pvarValue
);
115 static HRESULT WINAPI
mqr_GetEnumerator(IWICMetadataQueryReader
*iface
,
116 IEnumString
**ppIEnumString
)
118 QueryReader
*This
= impl_from_IWICMetadataQueryReader(iface
);
119 FIXME("(%p,%p)\n", This
, ppIEnumString
);
123 static IWICMetadataQueryReaderVtbl mqr_vtbl
= {
127 mqr_GetContainerFormat
,
129 mqr_GetMetadataByName
,
133 HRESULT
MetadataQueryReader_CreateInstance(IWICMetadataBlockReader
*mbr
, IWICMetadataQueryReader
**out
)
137 obj
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*obj
));
139 return E_OUTOFMEMORY
;
141 obj
->IWICMetadataQueryReader_iface
.lpVtbl
= &mqr_vtbl
;
144 IWICMetadataBlockReader_AddRef(mbr
);
147 *out
= &obj
->IWICMetadataQueryReader_iface
;