Nikolay Sivov : user32/sysparams: Return NULL from GetSysColorBrush() for invalid index.

Alexandre Julliard julliard at winehq.org
Wed Dec 30 10:18:15 CST 2009


Module: wine
Branch: master
Commit: 385b8dcb95b2853d452ec95d140ea5fa0c05aeef
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=385b8dcb95b2853d452ec95d140ea5fa0c05aeef

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Tue Dec 29 19:27:14 2009 +0300

user32/sysparams: Return NULL from GetSysColorBrush() for invalid index.

---

 dlls/user32/sysparams.c       |    2 +-
 dlls/user32/tests/sysparams.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index 09e7eb5..08dde39 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -3028,7 +3028,7 @@ HBRUSH WINAPI GetSysColorBrush( INT index )
 {
     if (0 <= index && index < NUM_SYS_COLORS) return SysColorBrushes[index];
     WARN("Unknown index(%d)\n", index );
-    return GetStockObject(LTGRAY_BRUSH);
+    return NULL;
 }
 
 
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index a9b79fa..ba1c802 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -2770,7 +2770,7 @@ static void test_GetSysColorBrush(void)
 
     SetLastError(0xdeadbeef);
     hbr = GetSysColorBrush(-1);
-    todo_wine ok(hbr == NULL, "Expected NULL brush\n");
+    ok(hbr == NULL, "Expected NULL brush\n");
     ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError());
     /* greater than max index */
     hbr = GetSysColorBrush(COLOR_MENUBAR);
@@ -2778,7 +2778,7 @@ static void test_GetSysColorBrush(void)
     {
         SetLastError(0xdeadbeef);
         hbr = GetSysColorBrush(COLOR_MENUBAR + 1);
-        todo_wine ok(hbr == NULL, "Expected NULL brush\n");
+        ok(hbr == NULL, "Expected NULL brush\n");
         ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError());
     }
     else




More information about the wine-cvs mailing list