Author: rharabien
Date: Mon Mar 21 14:52:08 2011
New Revision: 51110
URL:
http://svn.reactos.org/svn/reactos?rev=51110&view=rev
Log:
Fix gdi32:SetSysColors apitest
Modified:
trunk/reactos/subsystems/win32/win32k/include/intgdi.h
trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
trunk/reactos/subsystems/win32/win32k/objects/stockobj.c
Modified: trunk/reactos/subsystems/win32/win32k/include/intgdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/intgdi.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/intgdi.h [iso-8859-1] Mon Mar 21
14:52:08 2011
@@ -156,8 +156,8 @@
/* Stock objects */
-BOOL FASTCALL
-IntSetSysColors(UINT nColors, INT *Elements, COLORREF *Colors);
+VOID FASTCALL
+IntSetSysColors(UINT nColors, CONST INT *Elements, CONST COLORREF *Colors);
HGDIOBJ FASTCALL
IntGetSysColorBrush(INT Object);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] Mon Mar 21
14:52:08 2011
@@ -538,36 +538,40 @@
IN CONST COLORREF *lpaRgbValues,
FLONG Flags)
{
- DWORD Ret = FALSE;
- NTSTATUS Status = STATUS_SUCCESS;
- UserEnterExclusive();
- _SEH2_TRY
- {
- ProbeForRead(lpaElements,
+ DWORD Ret = TRUE;
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ if (cElements == 0)
+ return TRUE;
+
+ UserEnterExclusive();
+ _SEH2_TRY
+ {
+ ProbeForRead(lpaElements,
sizeof(INT),
1);
- ProbeForRead(lpaRgbValues,
- sizeof(INT),
+ ProbeForRead(lpaRgbValues,
+ sizeof(COLORREF),
1);
// Developers: We are thread locked and calling gdi.
- Ret = IntSetSysColors(cElements, (INT*)lpaElements, (COLORREF*)lpaRgbValues);
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
+ IntSetSysColors(cElements, lpaElements, lpaRgbValues);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
Status = _SEH2_GetExceptionCode();
- }
- _SEH2_END;
- if (!NT_SUCCESS(Status))
- {
+ }
+ _SEH2_END;
+ if (!NT_SUCCESS(Status))
+ {
SetLastNtError(Status);
Ret = FALSE;
- }
- if (Ret)
- {
- UserSendNotifyMessage(HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0);
- }
- UserLeave();
- return Ret;
+ }
+ if (Ret)
+ {
+ UserSendNotifyMessage(HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0);
+ }
+ UserLeave();
+ return Ret;
}
DWORD
Modified: trunk/reactos/subsystems/win32/win32k/objects/stockobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/stockobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/stockobj.c [iso-8859-1] Mon Mar 21
14:52:08 2011
@@ -216,8 +216,8 @@
return ((Object < 0) || (NB_STOCK_OBJECTS <= Object)) ? NULL :
StockObjects[Object];
}
-BOOL FASTCALL
-IntSetSysColors(UINT nColors, INT *Elements, COLORREF *Colors)
+VOID FASTCALL
+IntSetSysColors(UINT nColors, CONST INT *Elements, CONST COLORREF *Colors)
{
UINT i;
@@ -234,7 +234,6 @@
Elements++;
Colors++;
}
- return nColors > 0;
}
HGDIOBJ FASTCALL