Zhiyi Zhang : uxtheme: Handle BT_NONE in GetThemeBackgroundRegion().

Alexandre Julliard julliard at winehq.org
Mon Jun 27 16:12:51 CDT 2022


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

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Wed Jun  1 16:57:39 2022 +0800

uxtheme: Handle BT_NONE in GetThemeBackgroundRegion().

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 55242d92559..3286d70d4d1 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");
 




More information about the wine-cvs mailing list