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

This commit is contained in:
Nikolay Sivov 2009-12-29 19:27:14 +03:00 committed by Alexandre Julliard
parent 697955c922
commit 385b8dcb95
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}

View File

@ -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