Ziqing Hui : windowscodecs: Implement global property functions for DdsDecoder.

Alexandre Julliard julliard at winehq.org
Tue Apr 21 15:59:47 CDT 2020


Module: wine
Branch: master
Commit: f634aa28364da8d0315f9262d7f67fc48f8b2686
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f634aa28364da8d0315f9262d7f67fc48f8b2686

Author: Ziqing Hui <zhui at codeweavers.com>
Date:   Mon Apr 20 12:00:03 2020 +0800

windowscodecs: Implement global property functions for DdsDecoder.

Signed-off-by: Ziqing Hui <zhui at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/windowscodecs/ddsformat.c       | 20 +++++++++++---------
 dlls/windowscodecs/tests/ddsformat.c |  6 +-----
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/dlls/windowscodecs/ddsformat.c b/dlls/windowscodecs/ddsformat.c
index ac832e2116..a5036f23d6 100644
--- a/dlls/windowscodecs/ddsformat.c
+++ b/dlls/windowscodecs/ddsformat.c
@@ -208,15 +208,17 @@ static HRESULT WINAPI DdsDecoder_GetDecoderInfo(IWICBitmapDecoder *iface,
 static HRESULT WINAPI DdsDecoder_CopyPalette(IWICBitmapDecoder *iface,
                                              IWICPalette *pIPalette)
 {
-    FIXME("(%p,%p): stub.\n", iface, pIPalette);
+    TRACE("(%p,%p)\n", iface, pIPalette);
 
-    return E_NOTIMPL;
+    return WINCODEC_ERR_PALETTEUNAVAILABLE;
 }
 
 static HRESULT WINAPI DdsDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface,
                                                         IWICMetadataQueryReader **ppIMetadataQueryReader)
 {
-    FIXME("(%p,%p): stub.\n", iface, ppIMetadataQueryReader);
+    if (!ppIMetadataQueryReader) return E_INVALIDARG;
+
+    FIXME("(%p,%p)\n", iface, ppIMetadataQueryReader);
 
     return E_NOTIMPL;
 }
@@ -224,25 +226,25 @@ static HRESULT WINAPI DdsDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface
 static HRESULT WINAPI DdsDecoder_GetPreview(IWICBitmapDecoder *iface,
                                             IWICBitmapSource **ppIBitmapSource)
 {
-    FIXME("(%p,%p): stub.\n", iface, ppIBitmapSource);
+    TRACE("(%p,%p)\n", iface, ppIBitmapSource);
 
-    return E_NOTIMPL;
+    return WINCODEC_ERR_UNSUPPORTEDOPERATION;
 }
 
 static HRESULT WINAPI DdsDecoder_GetColorContexts(IWICBitmapDecoder *iface,
                                                   UINT cCount, IWICColorContext **ppDdslorContexts, UINT *pcActualCount)
 {
-    FIXME("(%p,%u,%p,%p): stub.\n", iface, cCount, ppDdslorContexts, pcActualCount);
+    TRACE("(%p,%u,%p,%p)\n", iface, cCount, ppDdslorContexts, pcActualCount);
 
-    return E_NOTIMPL;
+    return WINCODEC_ERR_UNSUPPORTEDOPERATION;
 }
 
 static HRESULT WINAPI DdsDecoder_GetThumbnail(IWICBitmapDecoder *iface,
                                               IWICBitmapSource **ppIThumbnail)
 {
-    FIXME("(%p,%p): stub.\n", iface, ppIThumbnail);
+    TRACE("(%p,%p)\n", iface, ppIThumbnail);
 
-    return E_NOTIMPL;
+    return WINCODEC_ERR_CODECNOTHUMBNAIL;
 }
 
 static HRESULT WINAPI DdsDecoder_GetFrameCount(IWICBitmapDecoder *iface,
diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c
index de109b8299..0d8e728abc 100644
--- a/dlls/windowscodecs/tests/ddsformat.c
+++ b/dlls/windowscodecs/tests/ddsformat.c
@@ -154,17 +154,14 @@ static void test_dds_decoder_global_properties(IWICBitmapDecoder *decoder)
     hr = IWICImagingFactory_CreatePalette(factory, &pallette);
     ok (hr == S_OK, "CreatePalette failed, hr=%x\n", hr);
     if (hr == S_OK) {
-        todo_wine {
         hr = IWICBitmapDecoder_CopyPalette(decoder, pallette);
         ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Expected hr=WINCODEC_ERR_PALETTEUNAVAILABLE, got %x\n", hr);
         hr = IWICBitmapDecoder_CopyPalette(decoder, NULL);
         ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "Expected hr=WINCODEC_ERR_PALETTEUNAVAILABLE, got %x\n", hr);
-        };
     }
 
-    todo_wine {
     hr = IWICBitmapDecoder_GetMetadataQueryReader(decoder, &metadata_reader);
-    ok (hr == S_OK, "Expected hr=S_OK, got %x\n", hr);
+    todo_wine ok (hr == S_OK, "Expected hr=S_OK, got %x\n", hr);
     hr = IWICBitmapDecoder_GetMetadataQueryReader(decoder, NULL);
     ok (hr == E_INVALIDARG, "Expected hr=E_INVALIDARG, got %x\n", hr);
 
@@ -182,7 +179,6 @@ static void test_dds_decoder_global_properties(IWICBitmapDecoder *decoder)
     ok (hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "Expected hr=WINCODEC_ERR_CODECNOTHUMBNAIL, got %x\n", hr);
     hr = IWICBitmapDecoder_GetThumbnail(decoder, NULL);
     ok (hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "Expected hr=WINCODEC_ERR_CODECNOTHUMBNAIL, got %x\n", hr);
-    };
 
     if (pallette) IWICPalette_Release(pallette);
     if (metadata_reader) IWICMetadataQueryReader_Release(metadata_reader);




More information about the wine-cvs mailing list