[PATCH 6/6] uxtheme: Handle BT_NONE in GetThemeBackgroundRegion().

Zhiyi Zhang wine at gitlab.winehq.org
Mon Jun 27 01:35:07 CDT 2022


From: Zhiyi Zhang <zzhang at codeweavers.com>

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/uxtheme/draw.c         | 6 +++++-
 dlls/uxtheme/tests/system.c | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c
index 2f5a161c988..0d5f05a9f6a 100644
--- a/dlls/uxtheme/draw.c
+++ b/dlls/uxtheme/draw.c
@@ -2063,8 +2063,12 @@ HRESULT WINAPI GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc, int iPartId,
         if(!*pRegion)
             hr = HRESULT_FROM_WIN32(GetLastError());
     }
+    else if (bgtype == BT_NONE)
+    {
+        hr = E_UNEXPECTED;
+    }
     else {
-        FIXME("Unknown background type\n");
+        FIXME("Unknown background type %d\n", bgtype);
         /* This should never happen, and hence I don't know what to return */
         hr = E_FAIL;
     }
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index e9c91c62638..aa566f554ff 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -2425,7 +2425,6 @@ static void test_GetThemeBackgroundRegion(void)
     SetRect(&rect, 0, 0, 10, 10);
     region = (HRGN)0xdeadbeef;
     hr = GetThemeBackgroundRegion(htheme, NULL, RP_BAND, 0, &rect, &region);
-    todo_wine
     ok(hr == E_UNEXPECTED || broken(hr == S_OK) /* < Win10 */, "Got unexpected hr %#lx.\n", hr);
     ok(region == (HRGN)0xdeadbeef, "Got unexpected region.\n");
 
-- 
GitLab

https://gitlab.winehq.org/wine/wine/-/merge_requests/317



More information about the wine-devel mailing list