[PATCH 3/4] windowscodecs: Use IWICComponentFactory_CreateQueryReaderFromBlockReader in GetMetadataQueryReader.
Esme Povirk (they/them)
esme at codeweavers.com
Thu Jan 21 18:50:11 CST 2021
This should probably initialize factory. I don't know if
create_instance will or not.
On Wed, Jan 20, 2021 at 3:30 AM Rémi Bernon <rbernon at codeweavers.com> wrote:
>
> Instead of MetadataQueryReader_CreateInstance.
>
> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
> ---
> dlls/windowscodecs/decoder.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/windowscodecs/decoder.c b/dlls/windowscodecs/decoder.c
> index b05d50dfea9..b64793b0dbe 100644
> --- a/dlls/windowscodecs/decoder.c
> +++ b/dlls/windowscodecs/decoder.c
> @@ -433,6 +433,8 @@ static HRESULT WINAPI CommonDecoderFrame_GetMetadataQueryReader(IWICBitmapFrameD
> IWICMetadataQueryReader **ppIMetadataQueryReader)
> {
> CommonDecoderFrame *This = impl_from_IWICBitmapFrameDecode(iface);
> + IWICComponentFactory* factory;
> + HRESULT hr;
>
> TRACE("(%p,%p)\n", iface, ppIMetadataQueryReader);
>
> @@ -442,7 +444,17 @@ static HRESULT WINAPI CommonDecoderFrame_GetMetadataQueryReader(IWICBitmapFrameD
> if (!(This->parent->file_info.flags & WICBitmapDecoderCapabilityCanEnumerateMetadata))
> return WINCODEC_ERR_UNSUPPORTEDOPERATION;
>
> - return MetadataQueryReader_CreateInstance(&This->IWICMetadataBlockReader_iface, NULL, ppIMetadataQueryReader);
> + hr = create_instance(&CLSID_WICImagingFactory, &IID_IWICComponentFactory, (void**)&factory);
> +
> + if (SUCCEEDED(hr))
> + hr = IWICComponentFactory_CreateQueryReaderFromBlockReader(factory, &This->IWICMetadataBlockReader_iface, ppIMetadataQueryReader);
> +
> + if (factory) IWICComponentFactory_Release(factory);
> +
> + if (FAILED(hr))
> + *ppIMetadataQueryReader = NULL;
> +
> + return hr;
> }
>
> static HRESULT WINAPI CommonDecoderFrame_GetColorContexts(IWICBitmapFrameDecode *iface,
> --
> 2.30.0
>
>
More information about the wine-devel
mailing list