Author: dchapyshev
Date: Fri Sep 9 23:03:42 2016
New Revision: 72639
URL:
http://svn.reactos.org/svn/reactos?rev=72639&view=rev
Log:
[NtUser]
- Initialize cbSize filed for HIGHCONTRASTW
- SOUNDSENTRY -> SOUNDSENTRYW
- Add checks of size for SPI_GETHIGHCONTRAST and SPI_SETHIGHCONTRAST
Modified:
trunk/reactos/win32ss/user/ntuser/sysparams.c
Modified: trunk/reactos/win32ss/user/ntuser/sysparams.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/syspar…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/sysparams.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/sysparams.c [iso-8859-1] Fri Sep 9 23:03:42 2016
@@ -310,7 +310,8 @@
gspv.mousekeys.cbSize = sizeof(MOUSEKEYS);
gspv.stickykeys.cbSize = sizeof(STICKYKEYS);
gspv.serialkeys.cbSize = sizeof(SERIALKEYS);
- gspv.soundsentry.cbSize = sizeof(SOUNDSENTRY);
+ gspv.soundsentry.cbSize = sizeof(SOUNDSENTRYW);
+ gspv.highcontrast.cbSize = sizeof(HIGHCONTRASTW);
/* Make sure we don't use broken values */
SpiFixupValues();
@@ -1103,6 +1104,7 @@
if (!SpiSet(&gspv.filterkeys, pvParam, sizeof(FILTERKEYS), fl))
return 0;
+
if (fl & SPIF_UPDATEINIFILE)
{
// FIXME: What to do?
@@ -1287,28 +1289,28 @@
case SPI_GETSOUNDSENTRY:
{
- LPSOUNDSENTRY SoundsEntry = (LPSOUNDSENTRY)pvParam;
-
- if (uiParam != 0 && uiParam != sizeof(SOUNDSENTRY))
- return 0;
-
- if (!SoundsEntry || SoundsEntry->cbSize != sizeof(SOUNDSENTRY))
- return 0;
-
- return SpiGet(pvParam, &gspv.soundsentry, sizeof(SOUNDSENTRY), fl);
+ LPSOUNDSENTRYW SoundsEntry = (LPSOUNDSENTRYW)pvParam;
+
+ if (uiParam != 0 && uiParam != sizeof(SOUNDSENTRYW))
+ return 0;
+
+ if (!SoundsEntry || SoundsEntry->cbSize != sizeof(SOUNDSENTRYW))
+ return 0;
+
+ return SpiGet(pvParam, &gspv.soundsentry, sizeof(SOUNDSENTRYW), fl);
}
case SPI_SETSOUNDSENTRY:
{
- LPSOUNDSENTRY SoundsEntry = (LPSOUNDSENTRY)pvParam;
-
- if (uiParam != 0 && uiParam != sizeof(SOUNDSENTRY))
- return 0;
-
- if (!SoundsEntry || SoundsEntry->cbSize != sizeof(SOUNDSENTRY))
- return 0;
-
- if (!SpiSet(&gspv.soundsentry, pvParam, sizeof(SOUNDSENTRY), fl))
+ LPSOUNDSENTRYW SoundsEntry = (LPSOUNDSENTRYW)pvParam;
+
+ if (uiParam != 0 && uiParam != sizeof(SOUNDSENTRYW))
+ return 0;
+
+ if (!SoundsEntry || SoundsEntry->cbSize != sizeof(SOUNDSENTRYW))
+ return 0;
+
+ if (!SpiSet(&gspv.soundsentry, pvParam, sizeof(SOUNDSENTRYW), fl))
return 0;
if (fl & SPIF_UPDATEINIFILE)
@@ -1319,16 +1321,37 @@
}
case SPI_GETHIGHCONTRAST:
- return SpiGet(pvParam, &gspv.highcontrast, sizeof(HIGHCONTRAST), fl);
+ {
+ LPHIGHCONTRASTW highcontrast = (LPHIGHCONTRASTW)pvParam;
+
+ if (uiParam != 0 && uiParam != sizeof(HIGHCONTRASTW))
+ return 0;
+
+ if (!highcontrast || highcontrast->cbSize != sizeof(HIGHCONTRASTW))
+ return 0;
+
+ return SpiGet(pvParam, &gspv.highcontrast, sizeof(HIGHCONTRASTW), fl);
+ }
case SPI_SETHIGHCONTRAST:
- if (!SpiSet(&gspv.highcontrast, pvParam, sizeof(HIGHCONTRAST), fl))
- return 0;
+ {
+ LPHIGHCONTRASTW highcontrast = (LPHIGHCONTRASTW)pvParam;
+
+ if (uiParam != 0 && uiParam != sizeof(HIGHCONTRASTW))
+ return 0;
+
+ if (!highcontrast || highcontrast->cbSize != sizeof(HIGHCONTRASTW))
+ return 0;
+
+ if (!SpiSet(&gspv.highcontrast, pvParam, sizeof(HIGHCONTRASTW), fl))
+ return 0;
+
if (fl & SPIF_UPDATEINIFILE)
{
// FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
+ }
case SPI_GETKEYBOARDPREF:
return SpiGetInt(pvParam, &gspv.bKbdPref, fl);
@@ -1881,7 +1904,7 @@
break;
case SPI_GETICONMETRICS:
- cbSize = sizeof(ICONMETRICS);
+ cbSize = sizeof(ICONMETRICSW);
break;
case SPI_GETWORKAREA:
@@ -1913,11 +1936,11 @@
break;
case SPI_GETSOUNDSENTRY:
- cbSize = sizeof(SOUNDSENTRY);
+ cbSize = sizeof(SOUNDSENTRYW);
break;
case SPI_GETHIGHCONTRAST:
- cbSize = sizeof(HIGHCONTRAST);
+ cbSize = sizeof(HIGHCONTRASTW);
break;
case SPI_GETANIMATION:
@@ -1995,12 +2018,12 @@
break;
case SPI_SETSOUNDSENTRY:
- cbSize = sizeof(SOUNDSENTRY);
+ cbSize = sizeof(SOUNDSENTRYW);
bToUser = FALSE;
break;
case SPI_SETHIGHCONTRAST:
- cbSize = sizeof(HIGHCONTRAST);
+ cbSize = sizeof(HIGHCONTRASTW);
bToUser = FALSE;
break;