From 9f157e5bfaccb895c969ab656c8b06575169f066 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 16 Apr 2012 15:25:37 -0500 Subject: [PATCH] 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 a2cc1a7143f..5b8170297f0 100644 --- a/dlls/windowscodecs/info.c +++ b/dlls/windowscodecs/info.c @@ -59,6 +59,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 eda21a69bb0..e923999b194 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); }