mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 09:50:43 +00:00
- Fix a bug in timedate.cpl, where an incorrect color was passed.
- Add bounds checking for GetSystemMetrics both in user32 and in kernel counterpart. - Based on a patch from bug 3316. See issue #3316 for more details. svn path=/trunk/; revision=33947
This commit is contained in:
parent
57da8d9f18
commit
cb467b55e9
3 changed files with 12 additions and 3 deletions
|
@ -504,7 +504,7 @@ MonthCalPaint(IN PMONTHCALWND infoPtr,
|
|||
if (crOldCtrlText == CLR_INVALID)
|
||||
{
|
||||
crOldCtrlText = SetTextColor(hDC,
|
||||
infoPtr->Enabled ? MONTHCAL_CTRLFG : MONTHCAL_DISABLED_CTRLFG);
|
||||
GetSysColor(infoPtr->Enabled ? MONTHCAL_CTRLFG : MONTHCAL_DISABLED_CTRLFG));
|
||||
}
|
||||
|
||||
for (x = prcUpdate->left / infoPtr->CellSize.cx;
|
||||
|
|
|
@ -100,9 +100,11 @@ int STDCALL
|
|||
GetSystemMetrics(int nIndex)
|
||||
{
|
||||
// FIXME("Global Sever Data -> %x\n",g_psi);
|
||||
if (g_psi) return g_psi->SystemMetrics[nIndex];
|
||||
if (nIndex < 0 || nIndex >= SM_CMETRICS) return 0;
|
||||
if (g_psi)
|
||||
return g_psi->SystemMetrics[nIndex];
|
||||
else
|
||||
return(NtUserGetSystemMetrics(nIndex));
|
||||
return(NtUserGetSystemMetrics(nIndex));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -278,6 +278,13 @@ UserGetSystemMetrics(ULONG Index)
|
|||
ULONG Width, Height, Result;
|
||||
|
||||
// DPRINT1("UserGetSystemMetrics -> %d\n",Index);
|
||||
|
||||
if (Index >= SM_CMETRICS)
|
||||
{
|
||||
DPRINT1("UserGetSystemMetrics() called with invalid index %d\n", Index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (gpsi && Setup)
|
||||
return gpsi->SystemMetrics[Index];
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue