[1/5] windowscodecs: Report missing component info strings as zero-length.

Vincent Povirk madewokherd at gmail.com
Wed Jun 20 08:00:51 CDT 2012


-------------- next part --------------
From 3a299f4d7d0483d87d1e45e732b0ffc5e5b6420d Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Mon, 16 Apr 2012 15:25:37 -0500
Subject: [PATCH 01/17] windowscodecs: Report missing component info strings
 as zero-length.

---
 dlls/windowscodecs/info.c       |    6 ++++++
 dlls/windowscodecs/tests/info.c |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
index 5632bf1..766391d 100644
--- a/dlls/windowscodecs/info.c
+++ b/dlls/windowscodecs/info.c
@@ -56,6 +56,12 @@ static HRESULT ComponentInfo_GetStringValue(HKEY classkey, LPCWSTR value,
     ret = RegGetValueW(classkey, NULL, value, RRF_RT_REG_SZ|RRF_NOEXPAND, NULL,
         buffer, &cbdata);
 
+    if (ret == ERROR_FILE_NOT_FOUND)
+    {
+        *actual_size = 0;
+        return S_OK;
+    }
+
     if (ret == 0 || ret == ERROR_MORE_DATA)
         *actual_size = cbdata/sizeof(WCHAR);
 
diff --git a/dlls/windowscodecs/tests/info.c b/dlls/windowscodecs/tests/info.c
index 1e31fcc..75131a3 100644
--- a/dlls/windowscodecs/tests/info.c
+++ b/dlls/windowscodecs/tests/info.c
@@ -214,8 +214,8 @@ static void test_pixelformat_info(void)
 
     len = 0xdeadbeef;
     hr = IWICComponentInfo_GetVersion(info, 0, NULL, &len);
-    todo_wine ok(hr == S_OK, "GetVersion failed, hr=%x\n", hr);
-    todo_wine ok(len == 0, "invalid length 0x%x\n", len); /* version does not apply to pixel formats */
+    ok(hr == S_OK, "GetVersion failed, hr=%x\n", hr);
+    ok(len == 0, "invalid length 0x%x\n", len); /* version does not apply to pixel formats */
 
     IWICComponentInfo_Release(info);
 }
-- 
1.7.9.5


More information about the wine-patches mailing list