ReactOS  0.4.13-dev-73-gcfe54aa
sysparams.c File Reference
#include <win32k.h>
Include dependency graph for sysparams.c:

Go to the source code of this file.

Macros

#define dpi   96
 
#define REG2METRIC(reg)   (reg > 0 ? reg : ((-(reg) * dpi + 720) / 1440))
 
#define METRIC2REG(met)   (-((((met) * 1440)- 0) / dpi))
 
#define REQ_INTERACTIVE_WINSTA(err)
 

Functions

 DBG_DEFAULT_CHANNEL (UserSysparams)
 
static INT SpiLoadDWord (PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
 
static INT SpiLoadInt (PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
 
static DWORD SpiLoadUserPrefMask (DWORD dValue)
 
static DWORD SpiLoadTimeOut (VOID)
 
static INT SpiLoadMouse (PCWSTR pwszValue, INT iValue)
 
static INT SpiLoadMetric (PCWSTR pwszValue, INT iValue)
 
static VOID SpiLoadFont (PLOGFONTW plfOut, LPWSTR pwszValueName, PLOGFONTW plfDefault)
 
static VOID SpiFixupValues (VOID)
 
static VOID SpiUpdatePerUserSystemParameters (VOID)
 
BOOL InitSysParams (VOID)
 
BOOL APIENTRY NtUserUpdatePerUserSystemParameters (DWORD dwReserved, BOOL bEnable)
 
static VOID SpiStoreDWord (PCWSTR pwszKey, PCWSTR pwszValue, DWORD Value)
 
static VOID SpiStoreSz (PCWSTR pwszKey, PCWSTR pwszValue, PCWSTR pwsz)
 
static VOID SpiStoreSzInt (PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
 
static VOID SpiStoreMetric (LPCWSTR pwszValue, INT iValue)
 
static VOID SpiStoreFont (PCWSTR pwszValue, LOGFONTW *plogfont)
 
static UINT_PTR SpiMemCopy (PVOID pvDst, PVOID pvSrc, ULONG cbSize, BOOL bProtect)
 
static UINT_PTR SpiGet (PVOID pvParam, PVOID pvData, ULONG cbSize, FLONG fl)
 
static UINT_PTR SpiSet (PVOID pvData, PVOID pvParam, ULONG cbSize, FLONG fl)
 
static UINT_PTR SpiGetEx (PVOID pvParam, PVOID pvData, ULONG cbSize, FLONG fl)
 
static UINT_PTR SpiGetInt (PVOID pvParam, PVOID piValue, FLONG fl)
 
static UINT_PTR SpiSetYesNo (BOOL *pbData, BOOL bValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
 
static UINT_PTR SpiSetBool (BOOL *pbData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
 
static UINT_PTR SpiSetDWord (PVOID pvData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
 
static UINT_PTR SpiSetInt (PVOID pvData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
 
static UINT_PTR SpiSetMetric (PVOID pvData, INT iValue, PCWSTR pwszValue, FLONG fl)
 
static UINT_PTR SpiSetUserPref (DWORD dwMask, PVOID pvValue, FLONG fl)
 
static UINT_PTR SpiGetUserPref (DWORD dwMask, PVOID pvParam, FLONG fl)
 
static UINT_PTR SpiSetWallpaper (PVOID pvParam, FLONG fl)
 
static BOOL SpiNotifyNCMetricsChanged (VOID)
 
static UINT_PTR SpiGetSet (UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
 
static BOOL SpiGetSetProbeBuffer (UINT uiAction, UINT uiParam, PVOID pvParam)
 
BOOL FASTCALL UserSystemParametersInfo (UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
 
BOOL APIENTRY NtUserSystemParametersInfo (UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
 

Variables

SPIVALUES gspv
 
BOOL gbSpiInitialized = FALSE
 
BOOL g_PaintDesktopVersion = FALSE
 
static const WCHARKEY_MOUSE = L"Control Panel\\Mouse"
 
static const WCHARVAL_MOUSE1 = L"MouseThreshold1"
 
static const WCHARVAL_MOUSE2 = L"MouseThreshold2"
 
static const WCHARVAL_MOUSE3 = L"MouseSpeed"
 
static const WCHARVAL_MOUSETRAILS = L"MouseTrails"
 
static const WCHARVAL_DBLCLKWIDTH = L"DoubleClickWidth"
 
static const WCHARVAL_DBLCLKHEIGHT = L"DoubleClickHeight"
 
static const WCHARVAL_DBLCLKTIME = L"DoubleClickSpeed"
 
static const WCHARVAL_SNAPDEFBTN = L"SnapToDefaultButton"
 
static const WCHARVAL_SWAP = L"SwapMouseButtons"
 
static const WCHARVAL_HOVERTIME = L"MouseHoverTime"
 
static const WCHARVAL_HOVERWIDTH = L"MouseHoverWidth"
 
static const WCHARVAL_HOVERHEIGHT = L"MouseHoverHeight"
 
static const WCHARVAL_SENSITIVITY = L"MouseSensitivity"
 
static const WCHARKEY_DESKTOP = L"Control Panel\\Desktop"
 
static const WCHARVAL_SCRTO = L"ScreenSaveTimeOut"
 
static const WCHARVAL_SCRNSV = L"SCRNSAVE.EXE"
 
static const WCHARVAL_SCRACT = L"ScreenSaveActive"
 
static const WCHARVAL_GRID = L"GridGranularity"
 
static const WCHARVAL_DRAG = L"DragFullWindows"
 
static const WCHARVAL_DRAGHEIGHT = L"DragHeight"
 
static const WCHARVAL_DRAGWIDTH = L"DragWidth"
 
static const WCHARVAL_FONTSMOOTHING = L"FontSmoothing"
 
static const WCHARVAL_FONTSMOOTHINGTYPE = L"FontSmoothingType"
 
static const WCHARVAL_FONTSMOOTHINGCONTRAST = L"FontSmoothingGamma"
 
static const WCHARVAL_FONTSMOOTHINGORIENTATION = L"FontSmoothingOrientation"
 
static const WCHARVAL_SCRLLLINES = L"WheelScrollLines"
 
static const WCHARVAL_CLICKLOCKTIME = L"ClickLockTime"
 
static const WCHARVAL_PAINTDESKVER = L"PaintDesktopVersion"
 
static const WCHARVAL_CARETRATE = L"CursorBlinkRate"
 
static const WCHARVAL_USERPREFMASK = L"UserPreferencesMask"
 
static const WCHARKEY_MDALIGN = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
 
static const WCHARVAL_MDALIGN = L"MenuDropAlignment"
 
static const WCHARKEY_METRIC = L"Control Panel\\Desktop\\WindowMetrics"
 
static const WCHARVAL_BORDER = L"BorderWidth"
 
static const WCHARVAL_ICONSPC = L"IconSpacing"
 
static const WCHARVAL_ICONVSPC = L"IconVerticalspacing"
 
static const WCHARVAL_ITWRAP = L"IconTitleWrap"
 
static const WCHARKEY_SOUND = L"Control Panel\\Sound"
 
static const WCHARVAL_BEEP = L"Beep"
 
static const WCHARKEY_KBD = L"Control Panel\\Keyboard"
 
static const WCHARVAL_KBDSPD = L"KeyboardSpeed"
 
static const WCHARVAL_KBDDELAY = L"KeyboardDelay"
 
static const WCHARKEY_SHOWSNDS = L"Control Panel\\Accessibility\\ShowSounds"
 
static const WCHARKEY_KDBPREF = L"Control Panel\\Accessibility\\Keyboard Preference"
 
static const WCHARKEY_SCRREAD = L"Control Panel\\Accessibility\\Blind Access"
 
static const WCHARVAL_ON = L"On"
 

Macro Definition Documentation

◆ dpi

#define dpi   96

Definition at line 22 of file sysparams.c.

◆ METRIC2REG

#define METRIC2REG (   met)    (-((((met) * 1440)- 0) / dpi))

Definition at line 25 of file sysparams.c.

◆ REG2METRIC

#define REG2METRIC (   reg)    (reg > 0 ? reg : ((-(reg) * dpi + 720) / 1440))

Definition at line 24 of file sysparams.c.

◆ REQ_INTERACTIVE_WINSTA

#define REQ_INTERACTIVE_WINSTA (   err)
Value:
do { \
if (GetW32ProcessInfo()->prpwinsta != InputWindowStation) \
{ \
if (GetW32ProcessInfo()->prpwinsta == NULL) \
{ \
ERR("NtUserSystemParametersInfo called without active window station, and it requires an interactive one\n"); \
} \
else \
{ \
ERR("NtUserSystemParametersInfo requires interactive window station (current is '%wZ')\n", \
} \
EngSetLastError(err); \
return 0; \
} \
} while (0)
PWINSTATION_OBJECT InputWindowStation
Definition: winsta.c:21
#define OBJECT_HEADER_TO_NAME_INFO(h)
Definition: obtypes.h:114
#define OBJECT_TO_OBJECT_HEADER(o)
Definition: obtypes.h:111
smooth NULL
Definition: ftsmooth.c:416
struct _PROCESSINFO * GetW32ProcessInfo(VOID)
Definition: misc.c:775
#define err(...)

Definition at line 27 of file sysparams.c.

Function Documentation

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( UserSysparams  )

◆ InitSysParams()

BOOL InitSysParams ( VOID  )

Definition at line 342 of file sysparams.c.

343 {
346  return TRUE;
347 }
#define TRUE
Definition: types.h:120
BOOL gbSpiInitialized
Definition: sysparams.c:18
static VOID SpiUpdatePerUserSystemParameters(VOID)
Definition: sysparams.c:219

Referenced by InitUserImpl(), and InitVideo().

◆ NtUserSystemParametersInfo()

BOOL APIENTRY NtUserSystemParametersInfo ( UINT  uiAction,
UINT  uiParam,
PVOID  pvParam,
UINT  fWinIni 
)

Definition at line 2129 of file sysparams.c.

2134 {
2135  BOOL bResult;
2136 
2137  TRACE("Enter NtUserSystemParametersInfo(%u)\n", uiAction);
2139 
2140  // FIXME: Get rid of the flags and only use this from um. kernel can access data directly.
2141  /* Set UM memory protection flag */
2142  fWinIni |= SPIF_PROTECT;
2143 
2144  /* Call internal function */
2145  bResult = UserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
2146 
2147  TRACE("Leave NtUserSystemParametersInfo, returning %d\n", bResult);
2148  UserLeave();
2149 
2150  return bResult;
2151 }
#define SPIF_PROTECT
Definition: sysparams.h:13
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
#define TRACE(s)
Definition: solgame.cpp:4
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2066

Referenced by DrawFocusRect(), RealSystemParametersInfoA(), RealSystemParametersInfoW(), SetDoubleClickTime(), START_TEST(), Test_NtUserSystemParametersInfo_fWinIni(), Test_NtUserSystemParametersInfo_Params(), Test_SPI_SETACCESSTIMEOUT(), Test_SPI_SETBEEP(), Test_SPI_SETBORDER(), Test_SPI_SETDESKWALLPAPER(), Test_SPI_SETFASTTASKSWITCH(), Test_SPI_SETICONMETRICS(), Test_SPI_SETICONTITLELOGFONT(), Test_SPI_SETMENUANIMATION(), Test_SPI_SETMINIMIZEDMETRICS(), Test_SPI_SETMOUSE(), Test_SPI_SETMOUSEBUTTONSWAP(), Test_SPI_SETNONCLIENTMETRICS(), Test_SPI_SETSTICKYKEYS(), Test_SPI_SETWORKAREA(), and Test_UserPref().

◆ NtUserUpdatePerUserSystemParameters()

BOOL APIENTRY NtUserUpdatePerUserSystemParameters ( DWORD  dwReserved,
BOOL  bEnable 
)

Definition at line 352 of file sysparams.c.

355 {
356  BOOL bResult;
357 
358  TRACE("Enter NtUserUpdatePerUserSystemParameters\n");
360 
362  if(bEnable)
364  else
366  bResult = TRUE;
367 
368  TRACE("Leave NtUserUpdatePerUserSystemParameters, returning %d\n", bResult);
369  UserLeave();
370 
371  return bResult;
372 }
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:60
#define TRUE
Definition: types.h:120
static const WCHAR * VAL_PAINTDESKVER
Definition: sysparams.c:74
static INT SpiLoadDWord(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:108
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
#define TRACE(s)
Definition: solgame.cpp:4
static VOID SpiUpdatePerUserSystemParameters(VOID)
Definition: sysparams.c:219
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
_In_ BOOL bEnable
Definition: winddi.h:3426
BOOL g_PaintDesktopVersion
Definition: sysparams.c:19

Referenced by START_TEST(), UpdatePerUserSystemParameters(), and UserInitialize().

◆ SpiFixupValues()

static VOID SpiFixupValues ( VOID  )
static

Definition at line 195 of file sysparams.c.

196 {
197  /* Fixup values */
198  gspv.ncm.iCaptionWidth = max(gspv.ncm.iCaptionWidth, 8);
199  gspv.ncm.iBorderWidth = max(gspv.ncm.iBorderWidth, 1);
200  gspv.ncm.iScrollWidth = max(gspv.ncm.iScrollWidth, 8);
201  gspv.ncm.iScrollHeight = max(gspv.ncm.iScrollHeight, 8);
202 // gspv.ncm.iMenuHeight = max(gspv.ncm.iMenuHeight, gspv.tmMenuFont.tmHeight);
203 // gspv.ncm.iMenuHeight = max(gspv.ncm.iMenuHeight,
204 // 2 + gspv.tmMenuFont.tmHeight +
205 // gspv.tmMenuFont.tmExternalLeading);
206  if (gspv.iDblClickTime == 0) gspv.iDblClickTime = 500;
207 
208  // FIXME: Hack!!!
209  gspv.tmMenuFont.tmHeight = 11;
211 
214 
215 }
#define max(a, b)
Definition: svc.c:63
LONG tmExternalLeading
Definition: wingdi.h:2365
NONCLIENTMETRICSW ncm
Definition: sysparams.h:51
INT iDblClickTime
Definition: sysparams.h:90
TEXTMETRICW tmCaptionFont
Definition: sysparams.h:139
SPIVALUES gspv
Definition: sysparams.c:17
TEXTMETRICW tmMenuFont
Definition: sysparams.h:138
LONG tmHeight
Definition: wingdi.h:2361

Referenced by SpiUpdatePerUserSystemParameters(), and UserSystemParametersInfo().

◆ SpiGet()

static UINT_PTR SpiGet ( PVOID  pvParam,
PVOID  pvData,
ULONG  cbSize,
FLONG  fl 
)
inlinestatic

Definition at line 469 of file sysparams.c.

470 {
472  return SpiMemCopy(pvParam, pvData, cbSize, fl & SPIF_PROTECT);
473 }
#define SPIF_PROTECT
Definition: sysparams.h:13
_In_ FLONG fl
Definition: winddi.h:1279
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
static UINT_PTR SpiMemCopy(PVOID pvDst, PVOID pvSrc, ULONG cbSize, BOOL bProtect)
Definition: sysparams.c:437
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27

Referenced by SpiGetEx(), SpiGetInt(), and SpiGetSet().

◆ SpiGetEx()

static UINT_PTR SpiGetEx ( PVOID  pvParam,
PVOID  pvData,
ULONG  cbSize,
FLONG  fl 
)
inlinestatic

Definition at line 485 of file sysparams.c.

486 {
488  /* Get the cbSite member from UM memory */
489  if (!SpiSet(&cbBufSize, pvParam, sizeof(ULONG), fl))
490  return 0;
491  /* Verify the correct size */
492  if (cbBufSize != cbSize)
493  return 0;
494  return SpiGet(pvParam, pvData, cbSize, fl);
495 }
static UINT_PTR SpiSet(PVOID pvData, PVOID pvParam, ULONG cbSize, FLONG fl)
Definition: sysparams.c:477
_In_ FLONG fl
Definition: winddi.h:1279
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
_In_ DWORD _In_ DWORD cbBufSize
Definition: winsvc.h:424
unsigned int ULONG
Definition: retypes.h:1
static UINT_PTR SpiGet(PVOID pvParam, PVOID pvData, ULONG cbSize, FLONG fl)
Definition: sysparams.c:469

Referenced by SpiGetSet().

◆ SpiGetInt()

static UINT_PTR SpiGetInt ( PVOID  pvParam,
PVOID  piValue,
FLONG  fl 
)
inlinestatic

Definition at line 499 of file sysparams.c.

500 {
501  return SpiGet(pvParam, piValue, sizeof(INT), fl);
502 }
int32_t INT
Definition: typedefs.h:56
_In_ FLONG fl
Definition: winddi.h:1279
static UINT_PTR SpiGet(PVOID pvParam, PVOID pvData, ULONG cbSize, FLONG fl)
Definition: sysparams.c:469

Referenced by SpiGetSet(), and SpiGetUserPref().

◆ SpiGetSet()

static UINT_PTR SpiGetSet ( UINT  uiAction,
UINT  uiParam,
PVOID  pvParam,
FLONG  fl 
)
static

Definition at line 794 of file sysparams.c.

795 {
796  switch (uiAction)
797  {
798  case SPI_GETBEEP:
799  return SpiGetInt(pvParam, &gspv.bBeep, fl);
800 
801  case SPI_SETBEEP:
802  return SpiSetYesNo(&gspv.bBeep, uiParam, KEY_SOUND, VAL_BEEP, fl);
803 
804  case SPI_GETMOUSE:
805  return SpiGet(pvParam, &gspv.caiMouse, 3 * sizeof(INT), fl);
806 
807  case SPI_SETMOUSE:
808  if (!SpiSet(&gspv.caiMouse, pvParam, 3 * sizeof(INT), fl))
809  return 0;
810  if (fl & SPIF_UPDATEINIFILE)
811  {
815  }
816  return (UINT_PTR)KEY_MOUSE;
817 
818  case SPI_GETBORDER:
819  return SpiGetInt(pvParam, &gspv.ncm.iBorderWidth, fl);
820 
821  case SPI_SETBORDER:
822  uiParam = max(uiParam, 1);
823  return SpiSetInt(&gspv.ncm.iBorderWidth, uiParam, KEY_METRIC, VAL_BORDER, fl);
824 
826  return SpiGetInt(pvParam, &gspv.dwKbdSpeed, fl);
827 
829  return SpiSetInt(&gspv.dwKbdSpeed, uiParam, KEY_KBD, VAL_KBDSPD, fl);
830 
831  case SPI_LANGDRIVER:
832  ERR("SPI_LANGDRIVER is unimplemented\n");
833  break;
834 
836  return SpiGetInt(pvParam, &gspv.iScrSaverTimeout, fl);
837 
839  return SpiSetInt(&gspv.iScrSaverTimeout, uiParam, KEY_DESKTOP, VAL_SCRTO, fl);
840 
842  return SpiGetInt(pvParam, &gspv.bScrSaverActive, fl);
843 
845  return SpiSetInt(&gspv.bScrSaverActive, uiParam, KEY_DESKTOP, VAL_SCRACT, fl);
846 
848  return SpiGetInt(pvParam, &gspv.uiGridGranularity, fl);
849 
851  return SpiSetInt(&gspv.uiGridGranularity, uiParam, KEY_DESKTOP, VAL_GRID, fl);
852 
854  uiParam = min(uiParam, gspv.ustrWallpaper.Length + 1UL);
855  return SpiGet(pvParam, gspv.awcWallpaper, uiParam, fl);
856 
858  return SpiSetWallpaper(pvParam, fl);
859 
860  case SPI_SETDESKPATTERN:
861  ERR("SPI_SETDESKPATTERN is unimplemented\n");
862  break;
863 
865  return SpiGetInt(pvParam, &gspv.iKbdDelay, fl);
866 
868  return SpiSetInt(&gspv.iKbdDelay, uiParam, KEY_KBD, VAL_KBDDELAY, fl);
869 
871  if (pvParam)
872  {
873  return SpiGetInt(pvParam, &gspv.im.iHorzSpacing, fl);
874  }
875  uiParam = max(uiParam, 32);
876  return SpiSetMetric(&gspv.im.iHorzSpacing, uiParam, VAL_ICONSPC, fl);
877 
879  if (pvParam)
880  {
881  return SpiGetInt(pvParam, &gspv.im.iVertSpacing, fl);
882  }
883  uiParam = max(uiParam, 32);
884  return SpiSetMetric(&gspv.im.iVertSpacing, uiParam, VAL_ICONVSPC, fl);
885 
887  return SpiGetInt(pvParam, &gspv.im.iTitleWrap, fl);
888 
890  return SpiSetInt(&gspv.im.iTitleWrap, uiParam, KEY_METRIC, VAL_ITWRAP, fl);
891 
893  return SpiGetInt(pvParam, &gspv.bMenuDropAlign, fl);
894 
897 
900 
903 
905  return SpiGet(pvParam, &gspv.im.lfFont, sizeof(LOGFONTW), fl);
906 
908  if (!SpiSet(&gspv.im.lfFont, pvParam, sizeof(LOGFONTW), fl))
909  return 0;
910  if (fl & SPIF_UPDATEINIFILE)
911  {
912  SpiStoreFont(L"IconFont", &gspv.im.lfFont);
913  }
914  return (UINT_PTR)KEY_METRIC;
915 
917  return SpiSetInt(&gspv.iDblClickTime, uiParam, KEY_MOUSE, VAL_DBLCLKTIME, fl);
918 
920  return SpiSetInt(&gspv.bMouseBtnSwap, uiParam, KEY_MOUSE, VAL_SWAP, fl);
921 
923  return SpiGetInt(pvParam, &gspv.bFastTaskSwitch, fl);
924 
926  /* According to Winetest this one is unimplemented */
927  return 1;
928 
929  case SPI_GETDRAGFULLWINDOWS:
930  return SpiGetInt(pvParam, &gspv.bDragFullWindows, fl);
931 
932  case SPI_SETDRAGFULLWINDOWS:
933  return SpiSetInt(&gspv.bDragFullWindows, uiParam, KEY_DESKTOP, VAL_DRAG, fl);
934 
935  case SPI_GETNONCLIENTMETRICS:
936  {
937  return SpiGet(pvParam, &gspv.ncm, sizeof(NONCLIENTMETRICSW), fl);
938  }
939 
940  case SPI_SETNONCLIENTMETRICS:
941  {
942  LPNONCLIENTMETRICSW metrics = (LPNONCLIENTMETRICSW)pvParam;
943 
944  /* Fixup user's structure size */
945  metrics->cbSize = sizeof(NONCLIENTMETRICSW);
946 
947  if (!SpiSet(&gspv.ncm, metrics, sizeof(NONCLIENTMETRICSW), fl))
948  return 0;
949 
950  if (fl & SPIF_UPDATEINIFILE)
951  {
952  SpiStoreMetric(VAL_BORDER, gspv.ncm.iBorderWidth);
953  SpiStoreMetric(L"ScrollWidth", gspv.ncm.iScrollWidth);
954  SpiStoreMetric(L"ScrollHeight", gspv.ncm.iScrollHeight);
955  SpiStoreMetric(L"CaptionWidth", gspv.ncm.iCaptionWidth);
956  SpiStoreMetric(L"CaptionHeight", gspv.ncm.iCaptionHeight);
957  SpiStoreMetric(L"SmCaptionWidth", gspv.ncm.iSmCaptionWidth);
958  SpiStoreMetric(L"SmCaptionHeight", gspv.ncm.iSmCaptionHeight);
959  SpiStoreMetric(L"MenuWidth", gspv.ncm.iMenuWidth);
960  SpiStoreMetric(L"MenuHeight", gspv.ncm.iMenuHeight);
961 #if (WINVER >= 0x0600)
962  SpiStoreMetric(L"PaddedBorderWidth", gspv.ncm.iPaddedBorderWidth);
963 #endif
964  SpiStoreFont(L"CaptionFont", &gspv.ncm.lfCaptionFont);
965  SpiStoreFont(L"SmCaptionFont", &gspv.ncm.lfSmCaptionFont);
966  SpiStoreFont(L"MenuFont", &gspv.ncm.lfMenuFont);
967  SpiStoreFont(L"StatusFont", &gspv.ncm.lfStatusFont);
968  SpiStoreFont(L"MessageFont", &gspv.ncm.lfMessageFont);
969  }
970 
972  return 0;
973 
974  return (UINT_PTR)KEY_METRIC;
975  }
976 
977  case SPI_GETMINIMIZEDMETRICS:
978  {
979  return SpiGet(pvParam, &gspv.mm, sizeof(MINIMIZEDMETRICS), fl);
980  }
981 
982  case SPI_SETMINIMIZEDMETRICS:
983  {
985 
986  /* Fixup user's structure size */
987  metrics->cbSize = sizeof(MINIMIZEDMETRICS);
988 
989  if (!SpiSet(&gspv.mm, metrics, sizeof(MINIMIZEDMETRICS), fl))
990  return 0;
991 
992  gspv.mm.iWidth = max(0, gspv.mm.iWidth);
995  gspv.mm.iArrange = gspv.mm.iArrange & 0xf;
996 
997  if (fl & SPIF_UPDATEINIFILE)
998  {
999  SpiStoreMetric(L"MinWidth", gspv.mm.iWidth);
1000  SpiStoreMetric(L"MinHorzGap", gspv.mm.iHorzGap);
1001  SpiStoreMetric(L"MinVertGap", gspv.mm.iVertGap);
1002  SpiStoreMetric(L"MinArrange", gspv.mm.iArrange);
1003  }
1004 
1005  return (UINT_PTR)KEY_METRIC;
1006  }
1007 
1008  case SPI_GETICONMETRICS:
1009  {
1010  return SpiGet(pvParam, &gspv.im, sizeof(ICONMETRICSW), fl);
1011  }
1012 
1013  case SPI_SETICONMETRICS:
1014  {
1015  LPICONMETRICSW metrics = (LPICONMETRICSW)pvParam;
1016 
1017  /* Fixup user's structure size */
1018  metrics->cbSize = sizeof(ICONMETRICSW);
1019 
1020  if (!SpiSet(&gspv.im, metrics, sizeof(ICONMETRICSW), fl))
1021  return 0;
1022 
1023  if (fl & SPIF_UPDATEINIFILE)
1024  {
1025  SpiStoreMetric(VAL_ICONSPC, gspv.im.iHorzSpacing);
1026  SpiStoreMetric(VAL_ICONVSPC, gspv.im.iVertSpacing);
1027  SpiStoreMetric(VAL_ITWRAP, gspv.im.iTitleWrap);
1028  SpiStoreFont(L"IconFont", &gspv.im.lfFont);
1029  }
1030  return (UINT_PTR)KEY_METRIC;
1031  }
1032 
1033  case SPI_GETWORKAREA:
1034  {
1035  PMONITOR pmonitor = UserGetPrimaryMonitor();
1036 
1037  if(!pmonitor)
1038  return 0;
1039 
1040  return SpiGet(pvParam, &pmonitor->rcWork, sizeof(RECTL), fl);
1041  }
1042 
1043  case SPI_SETWORKAREA:
1044  {
1045  /* FIXME: We should set the work area of the monitor
1046  that contains the specified rectangle */
1047  PMONITOR pmonitor = UserGetPrimaryMonitor();
1048  RECT rcWorkArea;
1049 
1050  if(!pmonitor)
1051  return 0;
1052 
1053  if (!SpiSet(&rcWorkArea, pvParam, sizeof(RECTL), fl))
1054  return 0;
1055 
1056  /* Verify the new values */
1057  if (rcWorkArea.left < 0 ||
1058  rcWorkArea.top < 0 ||
1059  rcWorkArea.right > gpsi->aiSysMet[SM_CXSCREEN] ||
1060  rcWorkArea.bottom > gpsi->aiSysMet[SM_CYSCREEN] ||
1061  rcWorkArea.right <= rcWorkArea.left ||
1062  rcWorkArea.bottom <= rcWorkArea.top)
1063  return 0;
1064 
1065  pmonitor->rcWork = rcWorkArea;
1066  if (fl & SPIF_UPDATEINIFILE)
1067  {
1068  // FIXME: What to do?
1069  }
1070  return (UINT_PTR)KEY_DESKTOP;
1071  }
1072 
1073  case SPI_SETPENWINDOWS:
1074  ERR("SPI_SETPENWINDOWS is unimplemented\n");
1075  break;
1076 
1077  case SPI_GETFILTERKEYS:
1078  {
1079  LPFILTERKEYS FilterKeys = (LPFILTERKEYS)pvParam;
1080 
1081  if (uiParam != 0 && uiParam != sizeof(FILTERKEYS))
1082  return 0;
1083 
1084  if (!FilterKeys || FilterKeys->cbSize != sizeof(FILTERKEYS))
1085  return 0;
1086 
1087  return SpiGet(pvParam, &gspv.filterkeys, sizeof(FILTERKEYS), fl);
1088  }
1089 
1090  case SPI_SETFILTERKEYS:
1091  {
1092  LPFILTERKEYS FilterKeys = (LPFILTERKEYS)pvParam;
1093 
1094  if (uiParam != 0 && uiParam != sizeof(FILTERKEYS))
1095  return 0;
1096 
1097  if (!FilterKeys || FilterKeys->cbSize != sizeof(FILTERKEYS))
1098  return 0;
1099 
1100  if (!SpiSet(&gspv.filterkeys, pvParam, sizeof(FILTERKEYS), fl))
1101  return 0;
1102 
1103  if (fl & SPIF_UPDATEINIFILE)
1104  {
1105  // FIXME: What to do?
1106  }
1107  return (UINT_PTR)KEY_DESKTOP;
1108  }
1109 
1110  case SPI_GETTOGGLEKEYS:
1111  {
1112  LPTOGGLEKEYS ToggleKeys = (LPTOGGLEKEYS)pvParam;
1113 
1114  if (uiParam != 0 && uiParam != sizeof(TOGGLEKEYS))
1115  return 0;
1116 
1117  if (!ToggleKeys || ToggleKeys->cbSize != sizeof(TOGGLEKEYS))
1118  return 0;
1119 
1120  return SpiGet(pvParam, &gspv.togglekeys, sizeof(TOGGLEKEYS), fl);
1121  }
1122 
1123  case SPI_SETTOGGLEKEYS:
1124  {
1125  LPTOGGLEKEYS ToggleKeys = (LPTOGGLEKEYS)pvParam;
1126 
1127  if (uiParam != 0 && uiParam != sizeof(TOGGLEKEYS))
1128  return 0;
1129 
1130  if (!ToggleKeys || ToggleKeys->cbSize != sizeof(TOGGLEKEYS))
1131  return 0;
1132 
1133  if (!SpiSet(&gspv.togglekeys, pvParam, sizeof(TOGGLEKEYS), fl))
1134  return 0;
1135 
1136  if (fl & SPIF_UPDATEINIFILE)
1137  {
1138  // FIXME: What to do?
1139  }
1140  return (UINT_PTR)KEY_DESKTOP;
1141  }
1142 
1143  case SPI_GETMOUSEKEYS:
1144  {
1145  LPMOUSEKEYS MouseKeys = (LPMOUSEKEYS)pvParam;
1146 
1147  if (uiParam != 0 && uiParam != sizeof(MOUSEKEYS))
1148  return 0;
1149 
1150  if (!MouseKeys || MouseKeys->cbSize != sizeof(MOUSEKEYS))
1151  return 0;
1152 
1153  return SpiGet(pvParam, &gspv.mousekeys, sizeof(MOUSEKEYS), fl);
1154  }
1155 
1156  case SPI_SETMOUSEKEYS:
1157  {
1158  LPMOUSEKEYS MouseKeys = (LPMOUSEKEYS)pvParam;
1159 
1160  if (uiParam != 0 && uiParam != sizeof(MOUSEKEYS))
1161  return 0;
1162 
1163  if (!MouseKeys || MouseKeys->cbSize != sizeof(MOUSEKEYS))
1164  return 0;
1165 
1166  if (!SpiSet(&gspv.mousekeys, pvParam, sizeof(MOUSEKEYS), fl))
1167  return 0;
1168 
1169  if (fl & SPIF_UPDATEINIFILE)
1170  {
1171  // FIXME: What to do?
1172  }
1173  return (UINT_PTR)KEY_DESKTOP;
1174  }
1175 
1176  case SPI_GETSHOWSOUNDS:
1177  return SpiGetInt(pvParam, &gspv.bShowSounds, fl);
1178 
1179  case SPI_SETSHOWSOUNDS:
1180  return SpiSetBool(&gspv.bShowSounds, uiParam, KEY_SHOWSNDS, VAL_ON, fl);
1181 
1182  case SPI_GETSTICKYKEYS:
1183  {
1184  LPSTICKYKEYS StickyKeys = (LPSTICKYKEYS)pvParam;
1185 
1186  if (uiParam != 0 && uiParam != sizeof(STICKYKEYS))
1187  return 0;
1188 
1189  if (!StickyKeys || StickyKeys->cbSize != sizeof(STICKYKEYS))
1190  return 0;
1191 
1192  return SpiGetEx(pvParam, &gspv.stickykeys, sizeof(STICKYKEYS), fl);
1193  }
1194 
1195  case SPI_SETSTICKYKEYS:
1196  {
1197  LPSTICKYKEYS StickyKeys = (LPSTICKYKEYS)pvParam;
1198 
1199  if (uiParam != 0 && uiParam != sizeof(STICKYKEYS))
1200  return 0;
1201 
1202  if (!StickyKeys || StickyKeys->cbSize != sizeof(STICKYKEYS))
1203  return 0;
1204 
1205  if (!SpiSet(&gspv.stickykeys, pvParam, sizeof(STICKYKEYS), fl))
1206  return 0;
1207 
1208  if (fl & SPIF_UPDATEINIFILE)
1209  {
1210  // FIXME: What to do?
1211  }
1212  return (UINT_PTR)KEY_DESKTOP;
1213  }
1214 
1215  case SPI_GETACCESSTIMEOUT:
1216  {
1217  LPACCESSTIMEOUT AccessTimeout = (LPACCESSTIMEOUT)pvParam;
1218 
1219  if (uiParam != 0 && uiParam != sizeof(ACCESSTIMEOUT))
1220  return 0;
1221 
1222  if (!AccessTimeout || AccessTimeout->cbSize != sizeof(ACCESSTIMEOUT))
1223  return 0;
1224 
1225  return SpiGetEx(pvParam, &gspv.accesstimeout, sizeof(ACCESSTIMEOUT), fl);
1226  }
1227 
1228  case SPI_SETACCESSTIMEOUT:
1229  {
1230  LPACCESSTIMEOUT AccessTimeout = (LPACCESSTIMEOUT)pvParam;
1231 
1232  if (uiParam != 0 && uiParam != sizeof(ACCESSTIMEOUT))
1233  {
1234  return 0;
1235  }
1236 
1237  if (!AccessTimeout || AccessTimeout->cbSize != sizeof(ACCESSTIMEOUT))
1238  {
1239  return 0;
1240  }
1241 
1242  if (!SpiSet(&gspv.accesstimeout, pvParam, sizeof(ACCESSTIMEOUT), fl))
1243  return 0;
1244 
1245  if (fl & SPIF_UPDATEINIFILE)
1246  {
1247  // FIXME: What to do?
1248  }
1249  return (UINT_PTR)KEY_DESKTOP;
1250  }
1251 
1252  case SPI_GETSERIALKEYS:
1253  {
1254  LPSERIALKEYS SerialKeys = (LPSERIALKEYS)pvParam;
1255 
1256  if (uiParam != 0 && uiParam != sizeof(SERIALKEYS))
1257  return 0;
1258 
1259  if (!SerialKeys || SerialKeys->cbSize != sizeof(SERIALKEYS))
1260  return 0;
1261 
1262  return SpiGet(pvParam, &gspv.serialkeys, sizeof(SERIALKEYS), fl);
1263  }
1264 
1265  case SPI_SETSERIALKEYS:
1266  {
1267  LPSERIALKEYS SerialKeys = (LPSERIALKEYS)pvParam;
1268 
1269  if (uiParam != 0 && uiParam != sizeof(SERIALKEYS))
1270  return 0;
1271 
1272  if (!SerialKeys || SerialKeys->cbSize != sizeof(SERIALKEYS))
1273  return 0;
1274 
1275  if (!SpiSet(&gspv.serialkeys, pvParam, sizeof(SERIALKEYS), fl))
1276  return 0;
1277 
1278  if (fl & SPIF_UPDATEINIFILE)
1279  {
1280  // FIXME: What to do?
1281  }
1282  return (UINT_PTR)KEY_DESKTOP;
1283  }
1284 
1285  case SPI_GETSOUNDSENTRY:
1286  {
1287  LPSOUNDSENTRYW SoundsEntry = (LPSOUNDSENTRYW)pvParam;
1288 
1289  if (uiParam != 0 && uiParam != sizeof(SOUNDSENTRYW))
1290  return 0;
1291 
1292  if (!SoundsEntry || SoundsEntry->cbSize != sizeof(SOUNDSENTRYW))
1293  return 0;
1294 
1295  return SpiGet(pvParam, &gspv.soundsentry, sizeof(SOUNDSENTRYW), fl);
1296  }
1297 
1298  case SPI_SETSOUNDSENTRY:
1299  {
1300  LPSOUNDSENTRYW SoundsEntry = (LPSOUNDSENTRYW)pvParam;
1301 
1302  if (uiParam != 0 && uiParam != sizeof(SOUNDSENTRYW))
1303  return 0;
1304 
1305  if (!SoundsEntry || SoundsEntry->cbSize != sizeof(SOUNDSENTRYW))
1306  return 0;
1307 
1308  if (!SpiSet(&gspv.soundsentry, pvParam, sizeof(SOUNDSENTRYW), fl))
1309  return 0;
1310 
1311  if (fl & SPIF_UPDATEINIFILE)
1312  {
1313  // FIXME: What to do?
1314  }
1315  return (UINT_PTR)KEY_DESKTOP;
1316  }
1317 
1318  case SPI_GETHIGHCONTRAST:
1319  {
1320  LPHIGHCONTRASTW highcontrast = (LPHIGHCONTRASTW)pvParam;
1321 
1322  if (uiParam != 0 && uiParam != sizeof(HIGHCONTRASTW))
1323  return 0;
1324 
1325  if (!highcontrast || highcontrast->cbSize != sizeof(HIGHCONTRASTW))
1326  return 0;
1327 
1328  return SpiGet(pvParam, &gspv.highcontrast, sizeof(HIGHCONTRASTW), fl);
1329  }
1330 
1331  case SPI_SETHIGHCONTRAST:
1332  {
1333  LPHIGHCONTRASTW highcontrast = (LPHIGHCONTRASTW)pvParam;
1334 
1335  if (uiParam != 0 && uiParam != sizeof(HIGHCONTRASTW))
1336  return 0;
1337 
1338  if (!highcontrast || highcontrast->cbSize != sizeof(HIGHCONTRASTW))
1339  return 0;
1340 
1341  if (!SpiSet(&gspv.highcontrast, pvParam, sizeof(HIGHCONTRASTW), fl))
1342  return 0;
1343 
1344  if (fl & SPIF_UPDATEINIFILE)
1345  {
1346  // FIXME: What to do?
1347  }
1348  return (UINT_PTR)KEY_DESKTOP;
1349  }
1350 
1351  case SPI_GETKEYBOARDPREF:
1352  return SpiGetInt(pvParam, &gspv.bKbdPref, fl);
1353 
1354  case SPI_SETKEYBOARDPREF:
1355  return SpiSetBool(&gspv.bKbdPref, uiParam, KEY_KDBPREF, VAL_ON, fl);
1356 
1357  case SPI_GETSCREENREADER:
1358  return SpiGetInt(pvParam, &gspv.bScreenReader, fl);
1359 
1360  case SPI_SETSCREENREADER:
1361  return SpiSetBool(&gspv.bScreenReader, uiParam, KEY_SCRREAD, VAL_ON, fl);
1362 
1363  case SPI_GETANIMATION:
1364  return SpiGet(pvParam, &gspv.animationinfo, sizeof(ANIMATIONINFO), fl);
1365 
1366  case SPI_SETANIMATION:
1367  if (!SpiSet(&gspv.animationinfo, pvParam, sizeof(ANIMATIONINFO), fl))
1368  return 0;
1369  if (fl & SPIF_UPDATEINIFILE)
1370  {
1371  // FIXME: What to do?
1372  }
1373  return (UINT_PTR)KEY_DESKTOP;
1374 
1375  case SPI_GETFONTSMOOTHING:
1376  return SpiGetInt(pvParam, &gspv.bFontSmoothing, fl);
1377 
1378  case SPI_SETFONTSMOOTHING:
1379  gspv.bFontSmoothing = (uiParam == 2);
1380  if (fl & SPIF_UPDATEINIFILE)
1381  {
1382  SpiStoreSz(KEY_DESKTOP, VAL_FONTSMOOTHING, (uiParam == 2) ? L"2" : L"0");
1383  }
1384  return (UINT_PTR)KEY_DESKTOP;
1385 
1386  case SPI_SETDRAGWIDTH:
1387  return SpiSetInt(&gspv.iDragWidth, uiParam, KEY_DESKTOP, VAL_DRAGWIDTH, fl);
1388 
1389  case SPI_SETDRAGHEIGHT:
1390  return SpiSetInt(&gspv.iDragHeight, uiParam, KEY_DESKTOP, VAL_DRAGHEIGHT, fl);
1391 
1392  case SPI_SETHANDHELD:
1393  return SpiSetBool(&gspv.bHandHeld, uiParam, KEY_DESKTOP, L"HandHeld", fl);
1394 
1395  case SPI_GETLOWPOWERTIMEOUT:
1396  return SpiGetInt(pvParam, &gspv.iLowPwrTimeout, fl);
1397 
1398  case SPI_GETPOWEROFFTIMEOUT:
1399  return SpiGetInt(pvParam, &gspv.iPwrOffTimeout, fl);
1400 
1401  case SPI_SETLOWPOWERTIMEOUT:
1402  return SpiSetInt(&gspv.iLowPwrTimeout, uiParam, KEY_DESKTOP, L"LowPowerTimeOut", fl);
1403 
1404  case SPI_SETPOWEROFFTIMEOUT:
1405  return SpiSetInt(&gspv.iPwrOffTimeout, uiParam, KEY_DESKTOP, L"PowerOffTimeOut", fl);
1406 
1407  case SPI_GETLOWPOWERACTIVE:
1408  return SpiGetInt(pvParam, &gspv.iPwrOffTimeout, fl);
1409 
1410  case SPI_GETPOWEROFFACTIVE:
1411  return SpiGetInt(pvParam, &gspv.bPwrOffActive, fl);
1412 
1413  case SPI_SETLOWPOWERACTIVE:
1414  return SpiSetBool(&gspv.bLowPwrActive, uiParam, KEY_DESKTOP, L"LowPowerActive", fl);
1415 
1416  case SPI_SETPOWEROFFACTIVE:
1417  return SpiSetBool(&gspv.bPwrOffActive, uiParam, KEY_DESKTOP, L"PowerOffActive", fl);
1418 
1419  case SPI_SETCURSORS:
1420  ERR("SPI_SETCURSORS is unimplemented\n");
1421  break;
1422 
1423  case SPI_SETICONS:
1424  ERR("SPI_SETICONS is unimplemented\n");
1425  break;
1426 
1427  case SPI_GETDEFAULTINPUTLANG:
1428  if (!gspklBaseLayout)
1429  return FALSE;
1430 
1431  return SpiGet(pvParam, &gspklBaseLayout->hkl, sizeof(HKL), fl);
1432 
1433  case SPI_SETDEFAULTINPUTLANG:
1434  {
1435  HKL hkl;
1436 
1437  /* Note: SPIF_UPDATEINIFILE is not supported */
1438  if ((fl & SPIF_UPDATEINIFILE) || !SpiSet(&hkl, pvParam, sizeof(hkl), fl))
1439  return FALSE;
1440 
1441  return UserSetDefaultInputLang(hkl);
1442  }
1443 
1444  case SPI_SETLANGTOGGLE:
1446  return gdwLanguageToggleKey;
1447  break;
1448 
1449  case SPI_GETWINDOWSEXTENSION:
1450  ERR("SPI_GETWINDOWSEXTENSION is unimplemented\n");
1451  break;
1452 
1453  case SPI_GETMOUSETRAILS:
1454  return SpiGetInt(pvParam, &gspv.iMouseTrails, fl);
1455 
1456  case SPI_SETMOUSETRAILS:
1457  return SpiSetInt(&gspv.iMouseTrails, uiParam, KEY_MOUSE, VAL_MOUSETRAILS, fl);
1458 
1459  case SPI_GETSNAPTODEFBUTTON:
1460  return SpiGetInt(pvParam, &gspv.bSnapToDefBtn, fl);
1461 
1462  case SPI_SETSNAPTODEFBUTTON:
1463  return SpiSetBool(&gspv.bSnapToDefBtn, uiParam, KEY_MOUSE, VAL_SNAPDEFBTN, fl);
1464 
1465  case SPI_GETMOUSEHOVERWIDTH:
1466  return SpiGetInt(pvParam, &gspv.iMouseHoverWidth, fl);
1467 
1468  case SPI_SETMOUSEHOVERWIDTH:
1470 
1471  case SPI_GETMOUSEHOVERHEIGHT:
1472  return SpiGetInt(pvParam, &gspv.iMouseHoverHeight, fl);
1473 
1474  case SPI_SETMOUSEHOVERHEIGHT:
1476 
1477  case SPI_GETMOUSEHOVERTIME:
1478  return SpiGetInt(pvParam, &gspv.iMouseHoverTime, fl);
1479 
1480  case SPI_SETMOUSEHOVERTIME:
1481  /* See http://msdn2.microsoft.com/en-us/library/ms724947.aspx
1482  * copy text from it, if some agument why xp and 2003 behovir diffent
1483  * only if they do not have SP install
1484  * " Windows Server 2003 and Windows XP: The operating system does not
1485  * enforce the use of USER_TIMER_MAXIMUM and USER_TIMER_MINIMUM until
1486  * Windows Server 2003 SP1 and Windows XP SP2 "
1487  */
1488  return SpiSetInt(&gspv.iMouseHoverTime, uiParam, KEY_MOUSE, VAL_HOVERTIME, fl);
1489 
1490  case SPI_GETWHEELSCROLLLINES:
1491  return SpiGetInt(pvParam, &gspv.iWheelScrollLines, fl);
1492 
1495 
1496  case SPI_GETMENUSHOWDELAY:
1497  return SpiGetInt(pvParam, &gspv.dwMenuShowDelay, fl);
1498 
1499  case SPI_SETMENUSHOWDELAY:
1500  return SpiSetInt(&gspv.dwMenuShowDelay, uiParam, KEY_DESKTOP, L"MenuShowDelay", fl);
1501 
1502 #if (_WIN32_WINNT >= 0x0600)
1503  case SPI_GETWHEELSCROLLCHARS:
1504  return SpiGetInt(pvParam, &gspv.uiWheelScrollChars, fl);
1505 
1506  case SPI_SETWHEELSCROLLCHARS:
1507  return SpiSetInt(&gspv.uiWheelScrollChars, uiParam, KEY_DESKTOP, VAL_SCRLLCHARS, fl);
1508 #endif
1509  case SPI_GETSHOWIMEUI:
1510  return SpiGetInt(pvParam, &gspv.bShowImeUi, fl);
1511 
1512  case SPI_SETSHOWIMEUI:
1513  return SpiSetBool(&gspv.bShowImeUi, uiParam, KEY_DESKTOP, L"", fl);
1514 
1515  case SPI_GETMOUSESPEED:
1516  return SpiGetInt(pvParam, &gspv.iMouseSpeed, fl);
1517 
1518  case SPI_SETMOUSESPEED:
1519  {
1520  /* Allowed range is [1:20] */
1521  if ((INT_PTR)pvParam < 1 || (INT_PTR)pvParam > 20)
1522  return 0;
1523  else
1525  }
1526 
1527  case SPI_GETSCREENSAVERRUNNING:
1528  return SpiGetInt(pvParam, &gspv.bScrSaverRunning, fl);
1529 
1530  case SPI_SETSCREENSAVERRUNNING:
1531  // FIXME: also return value?
1532  return SpiSetBool(&gspv.bScrSaverRunning, uiParam, KEY_MOUSE, L"", fl);
1533 
1534 #if(WINVER >= 0x0600)
1535  case SPI_GETAUDIODESCRIPTION:
1536  return SpiGet(pvParam, &gspv.audiodescription, sizeof(AUDIODESCRIPTION), fl);
1537 
1538  case SPI_SETAUDIODESCRIPTION:
1539  ERR("SPI_SETAUDIODESCRIPTION is unimplemented\n");
1540  break;
1541 
1542  case SPI_GETSCREENSAVESECURE:
1543  return SpiGetInt(pvParam, &gspv.bScrSaverSecure, fl);
1544 
1545  case SPI_SETSCREENSAVESECURE:
1546  return SpiSetBool(&gspv.bScrSaverSecure, uiParam, KEY_DESKTOP, L"ScreenSaverIsSecure", fl);
1547 #endif
1548 
1549  case SPI_GETACTIVEWINDOWTRACKING:
1550  return SpiGetUserPref(UPM_ACTIVEWINDOWTRACKING, pvParam, fl);
1551 
1552  case SPI_SETACTIVEWINDOWTRACKING:
1553  return SpiSetUserPref(UPM_ACTIVEWINDOWTRACKING, pvParam, fl);
1554 
1555  case SPI_GETMENUANIMATION:
1556  return SpiGetUserPref(UPM_MENUANIMATION, pvParam, fl);
1557 
1558  case SPI_SETMENUANIMATION:
1559  return SpiSetUserPref(UPM_MENUANIMATION, pvParam, fl);
1560 
1561  case SPI_GETCOMBOBOXANIMATION:
1562  return SpiGetUserPref(UPM_COMBOBOXANIMATION, pvParam, fl);
1563 
1564  case SPI_SETCOMBOBOXANIMATION:
1565  return SpiSetUserPref(UPM_COMBOBOXANIMATION, pvParam, fl);
1566 
1567  case SPI_GETLISTBOXSMOOTHSCROLLING:
1568  return SpiGetUserPref(UPM_LISTBOXSMOOTHSCROLLING, pvParam, fl);
1569 
1570  case SPI_SETLISTBOXSMOOTHSCROLLING:
1571  return SpiSetUserPref(UPM_LISTBOXSMOOTHSCROLLING, pvParam, fl);
1572 
1573  case SPI_GETGRADIENTCAPTIONS:
1574  return SpiGetUserPref(UPM_GRADIENTCAPTIONS, pvParam, fl);
1575 
1576  case SPI_SETGRADIENTCAPTIONS:
1577  return SpiSetUserPref(UPM_GRADIENTCAPTIONS, pvParam, fl);
1578 
1579  case SPI_GETKEYBOARDCUES:
1580  return SpiGetUserPref(UPM_KEYBOARDCUES, pvParam, fl);
1581 
1582  case SPI_SETKEYBOARDCUES:
1583  return SpiSetUserPref(UPM_KEYBOARDCUES, pvParam, fl);
1584 
1585  case SPI_GETACTIVEWNDTRKZORDER:
1586  return SpiGetUserPref(UPM_ACTIVEWNDTRKZORDER, pvParam, fl);
1587 
1588  case SPI_SETACTIVEWNDTRKZORDER:
1589  return SpiSetUserPref(UPM_ACTIVEWNDTRKZORDER, pvParam, fl);
1590 
1591  case SPI_GETHOTTRACKING:
1592  return SpiGetUserPref(UPM_HOTTRACKING, pvParam, fl);
1593 
1594  case SPI_SETHOTTRACKING:
1595  return SpiSetUserPref(UPM_HOTTRACKING, pvParam, fl);
1596 
1597  case SPI_GETMENUFADE:
1598  return SpiGetUserPref(UPM_MENUFADE, pvParam, fl);
1599 
1600  case SPI_SETMENUFADE:
1601  return SpiSetUserPref(UPM_MENUFADE, pvParam, fl);
1602 
1603  case SPI_GETSELECTIONFADE:
1604  return SpiGetUserPref(UPM_SELECTIONFADE, pvParam, fl);
1605 
1606  case SPI_SETSELECTIONFADE:
1607  return SpiSetUserPref(UPM_SELECTIONFADE, pvParam, fl);
1608 
1609  case SPI_GETTOOLTIPANIMATION:
1610  return SpiGetUserPref(UPM_TOOLTIPANIMATION, pvParam, fl);
1611 
1612  case SPI_SETTOOLTIPANIMATION:
1613  return SpiSetUserPref(UPM_TOOLTIPANIMATION, pvParam, fl);
1614 
1615  case SPI_GETTOOLTIPFADE:
1616  return SpiGetUserPref(UPM_TOOLTIPFADE, pvParam, fl);
1617 
1618  case SPI_SETTOOLTIPFADE:
1619  return SpiSetUserPref(UPM_TOOLTIPFADE, pvParam, fl);
1620 
1621  case SPI_GETCURSORSHADOW:
1622  return SpiGetUserPref(UPM_CURSORSHADOW, pvParam, fl);
1623 
1624  case SPI_SETCURSORSHADOW:
1625  gspv.bMouseCursorShadow = PtrToUlong(pvParam);
1626  return SpiSetUserPref(UPM_CURSORSHADOW, pvParam, fl);
1627 
1628  case SPI_GETUIEFFECTS:
1629  return SpiGetUserPref(UPM_UIEFFECTS, pvParam, fl);
1630 
1631  case SPI_SETUIEFFECTS:
1632  return SpiSetUserPref(UPM_UIEFFECTS, pvParam, fl);
1633 
1634  case SPI_GETMOUSESONAR:
1635  return SpiGetInt(pvParam, &gspv.bMouseSonar, fl);
1636 
1637  case SPI_SETMOUSESONAR:
1638  return SpiSetBool(&gspv.bMouseSonar, uiParam, KEY_MOUSE, L"", fl);
1639 
1640  case SPI_GETMOUSECLICKLOCK:
1641  return SpiGetUserPref(UPM_CLICKLOCK, pvParam, fl);
1642 
1643  case SPI_SETMOUSECLICKLOCK:
1644  gspv.bMouseClickLock = PtrToUlong(pvParam);
1645  return SpiSetUserPref(UPM_CLICKLOCK, pvParam, fl);
1646 
1647  case SPI_GETMOUSEVANISH:
1648  return SpiGetInt(pvParam, &gspv.bMouseVanish, fl);
1649 
1650  case SPI_SETMOUSEVANISH:
1651  return SpiSetBool(&gspv.bMouseVanish, uiParam, KEY_MOUSE, L"", fl);
1652 
1653  case SPI_GETFLATMENU:
1654  return SpiGetUserPref(UPM_FLATMENU, pvParam, fl);
1655 
1656  case SPI_SETFLATMENU:
1657  return SpiSetUserPref(UPM_FLATMENU, pvParam, fl);
1658 
1659  case SPI_GETDROPSHADOW:
1660  return SpiGetUserPref(UPM_DROPSHADOW, pvParam, fl);
1661 
1662  case SPI_SETDROPSHADOW:
1663  return SpiSetUserPref(UPM_DROPSHADOW, pvParam, fl);
1664 
1665  case SPI_GETBLOCKSENDINPUTRESETS:
1666  return SpiGetInt(pvParam, &gspv.bBlockSendInputResets, fl);
1667 
1668  case SPI_SETBLOCKSENDINPUTRESETS:
1669  return SpiSetBool(&gspv.bBlockSendInputResets, uiParam, KEY_MOUSE, L"", fl);
1670 
1671 #if(_WIN32_WINNT >= 0x0600)
1672  case SPI_GETDISABLEOVERLAPPEDCONTENT:
1673  return SpiGetInt(pvParam, &gspv.bDisableOverlappedContent, fl);
1674 
1675  case SPI_SETDISABLEOVERLAPPEDCONTENT:
1676  return SpiSetBool(&gspv.bDisableOverlappedContent, uiParam, KEY_MOUSE, L"", fl);
1677 
1678  case SPI_GETCLIENTAREAANIMATION:
1679  return SpiGetInt(pvParam, &gspv.bClientAreaAnimation, fl);
1680 
1681  case SPI_SETCLIENTAREAANIMATION:
1682  return SpiSetBool(&gspv.bClientAreaAnimation, uiParam, KEY_MOUSE, L"", fl);
1683 
1684  case SPI_GETCLEARTYPE:
1685  return SpiGetInt(pvParam, &gspv.bClearType, fl);
1686 
1687  case SPI_SETCLEARTYPE:
1688  return SpiSetBool(&gspv.bClearType, uiParam, KEY_MOUSE, L"", fl);
1689 
1690  case SPI_GETSPEECHRECOGNITION:
1691  return SpiGetInt(pvParam, &gspv.bSpeechRecognition, fl);
1692 
1693  case SPI_SETSPEECHRECOGNITION:
1694  return SpiSetBool(&gspv.bSpeechRecognition, uiParam, KEY_MOUSE, L"", fl);
1695 #endif
1696 
1697  case SPI_GETFOREGROUNDLOCKTIMEOUT:
1698  return SpiGetInt(pvParam, &gspv.dwForegroundLockTimeout, fl);
1699 
1700  case SPI_SETFOREGROUNDLOCKTIMEOUT:
1701  return SpiSetInt(&gspv.dwForegroundLockTimeout, uiParam, KEY_MOUSE, L"", fl);
1702 
1703  case SPI_GETACTIVEWNDTRKTIMEOUT:
1704  return SpiGetInt(pvParam, &gspv.dwActiveTrackingTimeout, fl);
1705 
1706  case SPI_SETACTIVEWNDTRKTIMEOUT:
1707  return SpiSetInt(&gspv.dwActiveTrackingTimeout, uiParam, KEY_MOUSE, L"", fl);
1708 
1709  case SPI_GETFOREGROUNDFLASHCOUNT:
1710  return SpiGetInt(pvParam, &gspv.dwForegroundFlashCount, fl);
1711 
1712  case SPI_SETFOREGROUNDFLASHCOUNT:
1713  return SpiSetInt(&gspv.dwForegroundFlashCount, uiParam, KEY_MOUSE, L"", fl);
1714 
1715  case SPI_GETCARETWIDTH:
1716  return SpiGetInt(pvParam, &gspv.dwCaretWidth, fl);
1717 
1718  case SPI_SETCARETWIDTH:
1719  return SpiSetInt(&gspv.dwCaretWidth, uiParam, KEY_MOUSE, L"", fl);
1720 
1721  case SPI_GETMOUSECLICKLOCKTIME:
1722  return SpiGetInt(pvParam, &gspv.dwMouseClickLockTime, fl);
1723 
1724  case SPI_SETMOUSECLICKLOCKTIME:
1726 
1727  case SPI_GETFONTSMOOTHINGTYPE:
1728  return SpiGetInt(pvParam, &gspv.uiFontSmoothingType, fl);
1729 
1730  case SPI_SETFONTSMOOTHINGTYPE:
1732 
1733  case SPI_GETFONTSMOOTHINGCONTRAST:
1734  return SpiGetInt(pvParam, &gspv.uiFontSmoothingContrast, fl);
1735 
1736  case SPI_SETFONTSMOOTHINGCONTRAST:
1738 
1739  case SPI_GETFOCUSBORDERWIDTH:
1740  return SpiGetInt(pvParam, &gspv.uiFocusBorderWidth, fl);
1741 
1742  case SPI_SETFOCUSBORDERWIDTH:
1743  return SpiSetInt(&gspv.uiFocusBorderWidth, uiParam, KEY_MOUSE, L"", fl);
1744 
1745  case SPI_GETFOCUSBORDERHEIGHT:
1746  return SpiGetInt(pvParam, &gspv.uiFocusBorderHeight, fl);
1747 
1748  case SPI_SETFOCUSBORDERHEIGHT:
1749  return SpiSetInt(&gspv.uiFocusBorderHeight, uiParam, KEY_MOUSE, L"", fl);
1750 
1751  case SPI_GETFONTSMOOTHINGORIENTATION:
1752  return SpiGetInt(pvParam, &gspv.uiFontSmoothingOrientation, fl);
1753 
1754  case SPI_SETFONTSMOOTHINGORIENTATION:
1756 
1757  /* The following are undocumented, but valid SPI values */
1758  case 0x1010:
1759  case 0x1011:
1760  case 0x1028:
1761  case 0x1029:
1762  case 0x102A:
1763  case 0x102B:
1764  case 0x102C:
1765  case 0x102D:
1766  case 0x102E:
1767  case 0x102F:
1768  case 0x1030:
1769  case 0x1031:
1770  case 0x1032:
1771  case 0x1033:
1772  case 0x1034:
1773  case 0x1035:
1774  case 0x1036:
1775  case 0x1037:
1776  case 0x1038:
1777  case 0x1039:
1778  case 0x103A:
1779  case 0x103B:
1780  case 0x103C:
1781  case 0x103D:
1782  ERR("Undocumented SPI value %x is unimplemented\n", uiAction);
1783  break;
1784 
1785  default:
1786  ERR("Invalid SPI value: %u\n", uiAction);
1788  return 0;
1789  }
1790 
1791  return 0;
1792 }
static UINT_PTR SpiSetWallpaper(PVOID pvParam, FLONG fl)
Definition: sysparams.c:619
static const WCHAR * VAL_HOVERTIME
Definition: sysparams.c:55
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
SOUNDSENTRYW soundsentry
Definition: sysparams.h:70
#define SPI_SETMENUDROPALIGNMENT
Definition: winuser.h:1359
#define SPI_GETSTICKYKEYS
Definition: winuser.h:1389
MOUSEKEYS mousekeys
Definition: sysparams.h:76
#define max(a, b)
Definition: svc.c:63
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:60
struct tagMINIMIZEDMETRICS MINIMIZEDMETRICS
UINT uiFocusBorderHeight
Definition: sysparams.h:55
DWORD dwMenuShowDelay
Definition: sysparams.h:131
FILTERKEYS filterkeys
Definition: sysparams.h:100
BOOL NTAPI UserSetDefaultInputLang(HKL hKl)
Definition: kbdlayout.c:395
DWORD dwKbdSpeed
Definition: sysparams.h:104
#define SPI_SETMOUSEKEYS
Definition: winuser.h:1386
#define SPI_SETMOUSEBUTTONSWAP
Definition: winuser.h:1364
#define SPI_GETKEYBOARDSPEED
Definition: winuser.h:1341
static const WCHAR * VAL_FONTSMOOTHING
Definition: sysparams.c:68
DWORD dwCaretWidth
Definition: sysparams.h:158
static UINT_PTR SpiSetBool(BOOL *pbData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:519
static const WCHAR * VAL_ICONVSPC
Definition: sysparams.c:87
static UINT_PTR SpiGetEx(PVOID pvParam, PVOID pvData, ULONG cbSize, FLONG fl)
Definition: sysparams.c:485
#define SPI_SETTOGGLEKEYS
Definition: winuser.h:1384
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
#define SPI_GETMOUSEKEYS
Definition: winuser.h:1385
WCHAR awcWallpaper[MAX_PATH+1]
Definition: sysparams.h:146
#define SPI_ICONHORIZONTALSPACING
Definition: winuser.h:1344
static const WCHAR * VAL_BEEP
Definition: sysparams.c:91
static const WCHAR * VAL_CLICKLOCKTIME
Definition: sysparams.c:73
BOOL bMouseBtnSwap
Definition: sysparams.h:82
#define SPI_SETDESKWALLPAPER
Definition: winuser.h:1351
BOOL bDragFullWindows
Definition: sysparams.h:129
static VOID SpiStoreFont(PCWSTR pwszValue, LOGFONTW *plogfont)
Definition: sysparams.c:422
struct tagMOUSEKEYS * LPMOUSEKEYS
#define SPI_LANGDRIVER
Definition: winuser.h:1343
DWORD dwForegroundFlashCount
Definition: sysparams.h:157
static const WCHAR * VAL_MOUSETRAILS
Definition: sysparams.c:49
#define SPI_SETWHEELSCROLLLINES
Definition: zmouse.h:30
INT iMouseSpeed
Definition: sysparams.h:84
#define SPI_SETACCESSTIMEOUT
Definition: winuser.h:1392
static const WCHAR * VAL_KBDSPD
Definition: sysparams.c:94
#define SPI_GETSCREENSAVETIMEOUT
Definition: winuser.h:1345
UINT uiFontSmoothingType
Definition: sysparams.h:126
NONCLIENTMETRICSW ncm
Definition: sysparams.h:51
static const WCHAR * KEY_MDALIGN
Definition: sysparams.c:81
ANIMATIONINFO animationinfo
Definition: sysparams.h:152
INT iScrSaverTimeout
Definition: sysparams.h:110
struct tagTOGGLEKEYS * LPTOGGLEKEYS
LONG top
Definition: windef.h:292
#define SPI_SETDOUBLECLKWIDTH
Definition: winuser.h:1360
BOOL bPwrOffActive
Definition: sysparams.h:121
INT iWheelScrollLines
Definition: sysparams.h:94
DWORD dwMouseClickLockTime
Definition: sysparams.h:79
#define SPI_SETMOUSE
Definition: winuser.h:1338
ACCESSTIMEOUT accesstimeout
Definition: sysparams.h:58
DWORD dwForegroundLockTimeout
Definition: sysparams.h:155
BOOL bScrSaverActive
Definition: sysparams.h:111
#define SPI_SETFILTERKEYS
Definition: winuser.h:1382
#define SPI_SETDESKPATTERN
Definition: winuser.h:1352
static const WCHAR * VAL_ITWRAP
Definition: sysparams.c:88
LONG left
Definition: windef.h:291
int32_t INT_PTR
Definition: typedefs.h:62
#define SPI_SETBEEP
Definition: winuser.h:1336
INT iLowPwrTimeout
Definition: sysparams.h:118
LONG right
Definition: windef.h:293
INT iMouseHoverHeight
Definition: sysparams.h:86
UINT uiFontSmoothingContrast
Definition: sysparams.h:127
BOOL bScrSaverRunning
Definition: sysparams.h:112
PSERVERINFO gpsi
Definition: main.c:27
int32_t INT
Definition: typedefs.h:56
UINT uiFocusBorderWidth
Definition: sysparams.h:54
static const WCHAR * VAL_KBDDELAY
Definition: sysparams.c:95
static const WCHAR * KEY_KBD
Definition: sysparams.c:93
static const WCHAR * VAL_SENSITIVITY
Definition: sysparams.c:58
RECT rcWork
Definition: monitor.h:19
INT iKbdDelay
Definition: sysparams.h:107
static const WCHAR * VAL_MOUSE3
Definition: sysparams.c:48
static const WCHAR * VAL_DBLCLKTIME
Definition: sysparams.c:52
INT iMouseHoverWidth
Definition: sysparams.h:85
BOOL bMouseClickLock
Definition: sysparams.h:77
#define SPI_SETFASTTASKSWITCH
Definition: winuser.h:1367
struct tagSOUNDSENTRYW * LPSOUNDSENTRYW
static const WCHAR * VAL_DRAG
Definition: sysparams.c:65
DWORD cbSize
Definition: winuser.h:3476
#define SM_CXSCREEN
Definition: winuser.h:949
static const WCHAR * VAL_MOUSE1
Definition: sysparams.c:46
#define SPI_SETKEYBOARDDELAY
Definition: winuser.h:1354
static UINT_PTR SpiSet(PVOID pvData, PVOID pvParam, ULONG cbSize, FLONG fl)
Definition: sysparams.c:477
#define SPI_GETSOUNDSENTRY
Definition: winuser.h:1397
static const WCHAR * VAL_FONTSMOOTHINGORIENTATION
Definition: sysparams.c:71
INT iDblClickTime
Definition: sysparams.h:90
static UINT_PTR SpiSetMetric(PVOID pvData, INT iValue, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:558
_In_ FLONG fl
Definition: winddi.h:1279
INT iDragHeight
Definition: sysparams.h:92
static const WCHAR * VAL_FONTSMOOTHINGCONTRAST
Definition: sysparams.c:70
struct tagSTICKYKEYS * LPSTICKYKEYS
static UINT_PTR SpiGetInt(PVOID pvParam, PVOID piValue, FLONG fl)
Definition: sysparams.c:499
BOOL bSnapToDefBtn
Definition: sysparams.h:153
#define SPI_GETMOUSE
Definition: winuser.h:1337
static const WCHAR * VAL_MDALIGN
Definition: sysparams.c:82
#define SPI_GETSHOWSOUNDS
Definition: winuser.h:1387
SERIALKEYS serialkeys
Definition: sysparams.h:101
BOOL bShowImeUi
Definition: sysparams.h:154
#define SPI_GETACCESSTIMEOUT
Definition: winuser.h:1391
INT iDragWidth
Definition: sysparams.h:91
#define SPI_SETBORDER
Definition: winuser.h:1340
static const WCHAR * VAL_FONTSMOOTHINGTYPE
Definition: sysparams.c:69
#define PtrToUlong(u)
Definition: config.h:107
BOOL bMouseCursorShadow
Definition: sysparams.h:78
#define SPI_GETGRIDGRANULARITY
Definition: winuser.h:1349
static const WCHAR * VAL_SCRACT
Definition: sysparams.c:63
struct tagHIGHCONTRASTW * LPHIGHCONTRASTW
BOOL bBlockSendInputResets
Definition: sysparams.h:132
#define SM_CYSCREEN
Definition: winuser.h:950
#define SPI_GETKEYBOARDDELAY
Definition: winuser.h:1353
static const WCHAR * VAL_SCRTO
Definition: sysparams.c:61
static const WCHAR * VAL_SCRLLLINES
Definition: sysparams.c:72
#define SPI_SETKEYBOARDSPEED
Definition: winuser.h:1342
static const WCHAR * VAL_DRAGHEIGHT
Definition: sysparams.c:66
UINT uiFontSmoothingOrientation
Definition: sysparams.h:128
BOOL bMouseVanish
Definition: sysparams.h:81
#define SPI_GETICONTITLEWRAP
Definition: winuser.h:1356
HKL hkl
Definition: input.h:32
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
DWORD dwActiveTrackingTimeout
Definition: sysparams.h:156
SPIVALUES gspv
Definition: sysparams.c:17
BOOL bMouseSonar
Definition: sysparams.h:80
static const WCHAR * VAL_ON
Definition: sysparams.c:100
BOOL bShowSounds
Definition: sysparams.h:71
TOGGLEKEYS togglekeys
Definition: sysparams.h:103
static const WCHAR * KEY_SCRREAD
Definition: sysparams.c:99
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define SPI_SETSOUNDSENTRY
Definition: winuser.h:1398
static const WCHAR * VAL_ICONSPC
Definition: sysparams.c:86
static const WCHAR * VAL_DBLCLKHEIGHT
Definition: sysparams.c:51
#define SPI_SETSCREENSAVEACTIVE
Definition: winuser.h:1348
struct tagACCESSTIMEOUT * LPACCESSTIMEOUT
static const WCHAR L[]
Definition: oid.c:1250
DWORD cbSize
Definition: winuser.h:3471
static BOOL SpiNotifyNCMetricsChanged(VOID)
Definition: sysparams.c:758
INT iMouseHoverTime
Definition: sysparams.h:87
#define SPI_GETFILTERKEYS
Definition: winuser.h:1381
UNICODE_STRING ustrWallpaper
Definition: sysparams.h:145
BOOL bMenuDropAlign
Definition: sysparams.h:130
static UINT_PTR SpiSetInt(PVOID pvData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:545
static const WCHAR * KEY_MOUSE
Definition: sysparams.c:45
UINT_PTR HKL
Definition: msctf.idl:101
BOOL bScreenReader
Definition: sysparams.h:60
#define SPI_GETBORDER
Definition: winuser.h:1339
static const WCHAR * VAL_DRAGWIDTH
Definition: sysparams.c:67
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1363
BOOL bHandHeld
Definition: sysparams.h:148
BOOL bKbdPref
Definition: sysparams.h:105
static const WCHAR * VAL_SNAPDEFBTN
Definition: sysparams.c:53
STICKYKEYS stickykeys
Definition: sysparams.h:102
#define ERR(fmt,...)
Definition: debug.h:109
#define SPI_SETICONTITLELOGFONT
Definition: winuser.h:1365
static UINT_PTR SpiSetYesNo(BOOL *pbData, BOOL bValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:506
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static const WCHAR * VAL_MOUSE2
Definition: sysparams.c:47
static UINT_PTR SpiSetUserPref(DWORD dwMask, PVOID pvValue, FLONG fl)
Definition: sysparams.c:571
HKL hkl
Definition: msctf.idl:611
#define SPI_GETFASTTASKSWITCH
Definition: winuser.h:1366
INT iDblClickHeight
Definition: sysparams.h:89
static const WCHAR * VAL_HOVERHEIGHT
Definition: sysparams.c:57
ICONMETRICSW im
Definition: sysparams.h:53
static const WCHAR * KEY_METRIC
Definition: sysparams.c:84
static const WCHAR * VAL_DBLCLKWIDTH
Definition: sysparams.c:50
static const WCHAR * VAL_GRID
Definition: sysparams.c:64
BOOL bFontSmoothing
Definition: sysparams.h:125
#define SPI_GETTOGGLEKEYS
Definition: winuser.h:1383
#define SPI_GETMENUDROPALIGNMENT
Definition: winuser.h:1358
#define min(a, b)
Definition: monoChain.cc:55
static UINT_PTR SpiSetDWord(PVOID pvData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:532
static UINT_PTR SpiGetUserPref(DWORD dwMask, PVOID pvParam, FLONG fl)
Definition: sysparams.c:611
BOOL bFastTaskSwitch
Definition: sysparams.h:149
#define SPI_SETSTICKYKEYS
Definition: winuser.h:1390
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1362
static VOID SpiStoreSzInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:401
HIGHCONTRASTW highcontrast
Definition: sysparams.h:59
static VOID SpiStoreSz(PCWSTR pwszKey, PCWSTR pwszValue, PCWSTR pwsz)
Definition: sysparams.c:390
#define SPI_GETSCREENSAVEACTIVE
Definition: winuser.h:1347
PMONITOR NTAPI UserGetPrimaryMonitor(VOID)
Definition: monitor.c:102
UINT cbSize
Definition: winuser.h:3353
#define SPI_GETDESKWALLPAPER
Definition: sysparams.c:40
#define SPI_SETICONTITLEWRAP
Definition: winuser.h:1357
INT iMouseTrails
Definition: sysparams.h:93
LONG bottom
Definition: windef.h:294
static UINT_PTR SpiGet(PVOID pvParam, PVOID pvData, ULONG cbSize, FLONG fl)
Definition: sysparams.c:469
INT iDblClickWidth
Definition: sysparams.h:88
struct tagFILTERKEYS * LPFILTERKEYS
#define SPI_SETDOUBLECLKHEIGHT
Definition: winuser.h:1361
static const WCHAR * KEY_SHOWSNDS
Definition: sysparams.c:97
#define SPI_GETBEEP
Definition: winuser.h:1335
#define SPI_SETGRIDGRANULARITY
Definition: winuser.h:1350
INT iPwrOffTimeout
Definition: sysparams.h:119
static VOID SpiStoreMetric(LPCWSTR pwszValue, INT iValue)
Definition: sysparams.c:415
DWORD FASTCALL UserGetLanguageToggle(VOID)
Definition: misc.c:80
#define SPI_SETSHOWSOUNDS
Definition: winuser.h:1388
#define UL
Definition: tui.h:70
static const WCHAR * VAL_BORDER
Definition: sysparams.c:85
BOOL bBeep
Definition: sysparams.h:72
BOOL bLowPwrActive
Definition: sysparams.h:120
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define SPI_SETSCREENSAVETIMEOUT
Definition: winuser.h:1346
SERIALKEYSA * LPSERIALKEYS
Definition: winuser.h:5590
PKL gspklBaseLayout
Definition: kbdlayout.c:20
UINT uiGridGranularity
Definition: sysparams.h:150
static const WCHAR * KEY_KDBPREF
Definition: sysparams.c:98
static const WCHAR * VAL_SWAP
Definition: sysparams.c:54
static const WCHAR * KEY_SOUND
Definition: sysparams.c:90
MINIMIZEDMETRICS mm
Definition: sysparams.h:52
DWORD gdwLanguageToggleKey
Definition: keyboard.c:19
struct tagMINIMIZEDMETRICS * LPMINIMIZEDMETRICS
static const WCHAR * VAL_HOVERWIDTH
Definition: sysparams.c:56
CURSORACCELERATION_INFO caiMouse
Definition: sysparams.h:75

Referenced by UserSystemParametersInfo().

◆ SpiGetSetProbeBuffer()

static BOOL SpiGetSetProbeBuffer ( UINT  uiAction,
UINT  uiParam,
PVOID  pvParam 
)
static

Definition at line 1795 of file sysparams.c.

1796 {
1797  BOOL bToUser = TRUE;
1798  ULONG cbSize = 0;
1799 
1800  switch (uiAction)
1801  {
1802  case SPI_GETBEEP:
1803  case SPI_GETBORDER:
1804  case SPI_GETKEYBOARDSPEED:
1808  case SPI_GETKEYBOARDDELAY:
1809  case SPI_GETICONTITLEWRAP:
1811  case SPI_GETFASTTASKSWITCH:
1812  case SPI_GETDRAGFULLWINDOWS:
1813  case SPI_GETSHOWSOUNDS:
1814  case SPI_GETKEYBOARDPREF:
1815  case SPI_GETSCREENREADER:
1816  case SPI_GETFONTSMOOTHING:
1817  case SPI_GETLOWPOWERTIMEOUT:
1818  case SPI_GETPOWEROFFTIMEOUT:
1819  case SPI_GETLOWPOWERACTIVE:
1820  case SPI_GETPOWEROFFACTIVE:
1821  case SPI_GETMOUSETRAILS:
1822  case SPI_GETSNAPTODEFBUTTON:
1823  case SPI_GETMOUSEHOVERWIDTH:
1824  case SPI_GETMOUSEHOVERHEIGHT:
1825  case SPI_GETMOUSEHOVERTIME:
1826  case SPI_GETWHEELSCROLLLINES:
1827  case SPI_GETMENUSHOWDELAY:
1828 #if (_WIN32_WINNT >= 0x0600)
1829  case SPI_GETWHEELSCROLLCHARS:
1830 #endif
1831  case SPI_GETSHOWIMEUI:
1832  case SPI_GETMOUSESPEED:
1833  case SPI_GETSCREENSAVERRUNNING:
1834 #if(WINVER >= 0x0600)
1835  case SPI_GETSCREENSAVESECURE:
1836 #endif
1837  case SPI_GETACTIVEWINDOWTRACKING:
1838  case SPI_GETMENUANIMATION:
1839  case SPI_GETCOMBOBOXANIMATION:
1840  case SPI_GETLISTBOXSMOOTHSCROLLING:
1841  case SPI_GETGRADIENTCAPTIONS:
1842  case SPI_GETKEYBOARDCUES:
1843  case SPI_GETACTIVEWNDTRKZORDER:
1844  case SPI_GETHOTTRACKING:
1845  case SPI_GETMENUFADE:
1846  case SPI_GETSELECTIONFADE:
1847  case SPI_GETTOOLTIPANIMATION:
1848  case SPI_GETTOOLTIPFADE:
1849  case SPI_GETCURSORSHADOW:
1850  case SPI_GETUIEFFECTS:
1851  case SPI_GETMOUSESONAR:
1852  case SPI_GETMOUSECLICKLOCK:
1853  case SPI_GETMOUSEVANISH:
1854  case SPI_GETFLATMENU:
1855  case SPI_GETDROPSHADOW:
1856  case SPI_GETBLOCKSENDINPUTRESETS:
1857 #if(_WIN32_WINNT >= 0x0600)
1858  case SPI_GETDISABLEOVERLAPPEDCONTENT:
1859  case SPI_GETCLIENTAREAANIMATION:
1860  case SPI_GETCLEARTYPE:
1861  case SPI_GETSPEECHRECOGNITION:
1862 #endif
1863  case SPI_GETFOREGROUNDLOCKTIMEOUT:
1864  case SPI_GETACTIVEWNDTRKTIMEOUT:
1865  case SPI_GETFOREGROUNDFLASHCOUNT:
1866  case SPI_GETCARETWIDTH:
1867  case SPI_GETMOUSECLICKLOCKTIME:
1868  case SPI_GETFONTSMOOTHINGTYPE:
1869  case SPI_GETFONTSMOOTHINGCONTRAST:
1870  case SPI_GETFOCUSBORDERWIDTH:
1871  case SPI_GETFOCUSBORDERHEIGHT:
1872  case SPI_GETFONTSMOOTHINGORIENTATION:
1873  cbSize = sizeof(INT);
1874  break;
1875 
1878  if (pvParam) cbSize = sizeof(INT);
1879  break;
1880 
1881  case SPI_GETMOUSE:
1882  cbSize = 3 * sizeof(INT);
1883  break;
1884 
1885  case SPI_GETDESKWALLPAPER:
1886  cbSize = min(uiParam, gspv.ustrWallpaper.Length + 1UL);
1887  break;
1888 
1890  cbSize = sizeof(LOGFONTW);
1891  break;
1892 
1893  case SPI_GETNONCLIENTMETRICS:
1894  cbSize = sizeof(NONCLIENTMETRICSW);
1895  break;
1896 
1897  case SPI_GETMINIMIZEDMETRICS:
1898  cbSize = sizeof(MINIMIZEDMETRICS);
1899  break;
1900 
1901  case SPI_GETICONMETRICS:
1902  cbSize = sizeof(ICONMETRICSW);
1903  break;
1904 
1905  case SPI_GETWORKAREA:
1906  cbSize = sizeof(RECTL);
1907  break;
1908 
1909  case SPI_GETFILTERKEYS:
1910  cbSize = sizeof(FILTERKEYS);
1911  break;
1912 
1913  case SPI_GETTOGGLEKEYS:
1914  cbSize = sizeof(TOGGLEKEYS);
1915  break;
1916 
1917  case SPI_GETMOUSEKEYS:
1918  cbSize = sizeof(MOUSEKEYS);
1919  break;
1920 
1921  case SPI_GETSTICKYKEYS:
1922  cbSize = sizeof(STICKYKEYS);
1923  break;
1924 
1925  case SPI_GETACCESSTIMEOUT:
1926  cbSize = sizeof(ACCESSTIMEOUT);
1927  break;
1928 
1929  case SPI_GETSERIALKEYS:
1930  cbSize = sizeof(SERIALKEYS);
1931  break;
1932 
1933  case SPI_GETSOUNDSENTRY:
1934  cbSize = sizeof(SOUNDSENTRYW);
1935  break;
1936 
1937  case SPI_GETHIGHCONTRAST:
1938  cbSize = sizeof(HIGHCONTRASTW);
1939  break;
1940 
1941  case SPI_GETANIMATION:
1942  cbSize = sizeof(ANIMATIONINFO);
1943  break;
1944 
1945  case SPI_GETDEFAULTINPUTLANG:
1946  cbSize = sizeof(HKL);
1947  break;
1948 
1949 #if(WINVER >= 0x0600)
1950  case SPI_GETAUDIODESCRIPTION:
1951  cbSize = sizeof(AUDIODESCRIPTION);
1952  break;
1953 #endif
1954 
1955  case SPI_SETMOUSE:
1956  cbSize = 3 * sizeof(INT);
1957  bToUser = FALSE;
1958  break;
1959 
1961  cbSize = sizeof(LOGFONTW);
1962  bToUser = FALSE;
1963  break;
1964 
1965  case SPI_SETNONCLIENTMETRICS:
1966  cbSize = sizeof(NONCLIENTMETRICSW);
1967  bToUser = FALSE;
1968  break;
1969 
1970  case SPI_SETMINIMIZEDMETRICS:
1971  cbSize = sizeof(MINIMIZEDMETRICS);
1972  bToUser = FALSE;
1973  break;
1974 
1975  case SPI_SETICONMETRICS:
1976  cbSize = sizeof(ICONMETRICSW);
1977  bToUser = FALSE;
1978  break;
1979 
1980  case SPI_SETWORKAREA:
1981  cbSize = sizeof(RECTL);
1982  bToUser = FALSE;
1983  break;
1984 
1985  case SPI_SETFILTERKEYS:
1986  cbSize = sizeof(FILTERKEYS);
1987  bToUser = FALSE;
1988  break;
1989 
1990  case SPI_SETTOGGLEKEYS:
1991  cbSize = sizeof(TOGGLEKEYS);
1992  bToUser = FALSE;
1993  break;
1994 
1995  case SPI_SETMOUSEKEYS:
1996  cbSize = sizeof(MOUSEKEYS);
1997  bToUser = FALSE;
1998  break;
1999 
2000  case SPI_SETSTICKYKEYS:
2001  cbSize = sizeof(STICKYKEYS);
2002  bToUser = FALSE;
2003  break;
2004 
2005  case SPI_SETACCESSTIMEOUT:
2006  cbSize = sizeof(ACCESSTIMEOUT);
2007  bToUser = FALSE;
2008  break;
2009 
2010  case SPI_SETSERIALKEYS:
2011  cbSize = sizeof(SERIALKEYS);
2012  bToUser = FALSE;
2013  break;
2014 
2015  case SPI_SETSOUNDSENTRY:
2016  cbSize = sizeof(SOUNDSENTRYW);
2017  bToUser = FALSE;
2018  break;
2019 
2020  case SPI_SETHIGHCONTRAST:
2021  cbSize = sizeof(HIGHCONTRASTW);
2022  bToUser = FALSE;
2023  break;
2024 
2025  case SPI_SETANIMATION:
2026  cbSize = sizeof(ANIMATIONINFO);
2027  bToUser = FALSE;
2028  break;
2029 
2030  case SPI_SETDEFAULTINPUTLANG:
2031  cbSize = sizeof(HKL);
2032  bToUser = FALSE;
2033  break;
2034 
2035  case SPI_SETMOUSESPEED:
2036  cbSize = sizeof(INT);
2037  bToUser = FALSE;
2038  break;
2039  }
2040 
2041  if (cbSize)
2042  {
2043  _SEH2_TRY
2044  {
2045  if (bToUser)
2046  {
2047  ProbeForWrite(pvParam, cbSize, sizeof(UCHAR));
2048  }
2049  else
2050  {
2051  ProbeForRead(pvParam, cbSize, sizeof(UCHAR));
2052  }
2053  }
2055  {
2056  _SEH2_YIELD(return FALSE);
2057  }
2058  _SEH2_END;
2059  }
2060 
2061  return TRUE;
2062 }
#define SPI_GETSTICKYKEYS
Definition: winuser.h:1389
#define TRUE
Definition: types.h:120
struct tagMINIMIZEDMETRICS MINIMIZEDMETRICS
#define SPI_SETMOUSEKEYS
Definition: winuser.h:1386
#define SPI_GETKEYBOARDSPEED
Definition: winuser.h:1341
#define SPI_SETTOGGLEKEYS
Definition: winuser.h:1384
#define SPI_GETMOUSEKEYS
Definition: winuser.h:1385
#define SPI_ICONHORIZONTALSPACING
Definition: winuser.h:1344
#define SPI_SETACCESSTIMEOUT
Definition: winuser.h:1392
#define INT
Definition: polytest.cpp:20
#define SPI_GETSCREENSAVETIMEOUT
Definition: winuser.h:1345
#define SPI_SETMOUSE
Definition: winuser.h:1338
SERIALKEYSA SERIALKEYS
Definition: winuser.h:5590
#define SPI_SETFILTERKEYS
Definition: winuser.h:1382
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
_SEH2_TRY
Definition: create.c:4250
struct tagHIGHCONTRASTW HIGHCONTRASTW
#define SPI_GETSOUNDSENTRY
Definition: winuser.h:1397
struct tagANIMATIONINFO ANIMATIONINFO
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define SPI_GETMOUSE
Definition: winuser.h:1337
#define SPI_GETSHOWSOUNDS
Definition: winuser.h:1387
struct tagSTICKYKEYS STICKYKEYS
#define SPI_GETACCESSTIMEOUT
Definition: winuser.h:1391
#define SPI_GETGRIDGRANULARITY
Definition: winuser.h:1349
struct tagMOUSEKEYS MOUSEKEYS
#define SPI_GETKEYBOARDDELAY
Definition: winuser.h:1353
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
struct tagLOGFONTW LOGFONTW
#define SPI_GETICONTITLEWRAP
Definition: winuser.h:1356
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
SPIVALUES gspv
Definition: sysparams.c:17
#define SPI_SETSOUNDSENTRY
Definition: winuser.h:1398
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
#define SPI_GETFILTERKEYS
Definition: winuser.h:1381
UNICODE_STRING ustrWallpaper
Definition: sysparams.h:145
UINT_PTR HKL
Definition: msctf.idl:101
#define SPI_GETBORDER
Definition: winuser.h:1339
#define SPI_SETICONTITLELOGFONT
Definition: winuser.h:1365
_SEH2_END
Definition: create.c:4424
#define SPI_GETFASTTASKSWITCH
Definition: winuser.h:1366
#define SPI_GETTOGGLEKEYS
Definition: winuser.h:1383
#define SPI_GETMENUDROPALIGNMENT
Definition: winuser.h:1358
#define min(a, b)
Definition: monoChain.cc:55
#define SPI_SETSTICKYKEYS
Definition: winuser.h:1390
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1362
#define SPI_GETSCREENSAVEACTIVE
Definition: winuser.h:1347
#define SPI_GETDESKWALLPAPER
Definition: sysparams.c:40
unsigned int ULONG
Definition: retypes.h:1
struct tagTOGGLEKEYS TOGGLEKEYS
struct RECTL RECTL
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define SPI_GETBEEP
Definition: winuser.h:1335
struct tagACCESSTIMEOUT ACCESSTIMEOUT
#define UL
Definition: tui.h:70
struct tagSOUNDSENTRYW SOUNDSENTRYW
struct tagFILTERKEYS FILTERKEYS

Referenced by UserSystemParametersInfo().

◆ SpiGetUserPref()

static UINT_PTR SpiGetUserPref ( DWORD  dwMask,
PVOID  pvParam,
FLONG  fl 
)
inlinestatic

Definition at line 611 of file sysparams.c.

612 {
613  INT iValue = gspv.dwUserPrefMask & dwMask ? 1 : 0;
614  return SpiGetInt(pvParam, &iValue, fl);
615 }
int32_t INT
Definition: typedefs.h:56
_In_ FLONG fl
Definition: winddi.h:1279
static UINT_PTR SpiGetInt(PVOID pvParam, PVOID piValue, FLONG fl)
Definition: sysparams.c:499
SPIVALUES gspv
Definition: sysparams.c:17
DWORD dwUserPrefMask
Definition: sysparams.h:124

Referenced by SpiGetSet().

◆ SpiLoadDWord()

static INT SpiLoadDWord ( PCWSTR  pwszKey,
PCWSTR  pwszValue,
INT  iValue 
)
static

Loading the settings

Definition at line 108 of file sysparams.c.

109 {
110  DWORD Result;
111  if (!RegReadUserSetting(pwszKey, pwszValue, REG_DWORD, &Result, sizeof(Result)))
112  {
113  return iValue;
114  }
115  return Result;
116 }
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
unsigned long DWORD
Definition: ntddk_ex.h:95
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by NtUserUpdatePerUserSystemParameters(), and SpiUpdatePerUserSystemParameters().

◆ SpiLoadFont()

static VOID SpiLoadFont ( PLOGFONTW  plfOut,
LPWSTR  pwszValueName,
PLOGFONTW  plfDefault 
)
static

Definition at line 180 of file sysparams.c.

181 {
182  BOOL bResult;
183 
184  bResult = RegReadUserSetting(KEY_METRIC,
186  REG_BINARY,
187  plfOut,
188  sizeof(LOGFONTW));
189  if (!bResult)
190  *plfOut = *plfDefault;
191 }
#define REG_BINARY
Definition: nt_native.h:1496
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_z_ PCWSTR pwszValueName
Definition: ntuser.h:36
static const WCHAR * KEY_METRIC
Definition: sysparams.c:84

Referenced by SpiUpdatePerUserSystemParameters().

◆ SpiLoadInt()

static INT SpiLoadInt ( PCWSTR  pwszKey,
PCWSTR  pwszValue,
INT  iValue 
)
static

Definition at line 120 of file sysparams.c.

121 {
122  WCHAR awcBuffer[12];
123  ULONG cbSize;
124 
125  cbSize = sizeof(awcBuffer);
126  if (!RegReadUserSetting(pwszKey, pwszValue, REG_SZ, awcBuffer, cbSize))
127  {
128  return iValue;
129  }
130  return _wtoi(awcBuffer);
131 }
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned int ULONG
Definition: retypes.h:1
#define REG_SZ
Definition: layer.c:22

Referenced by SpiLoadMetric(), SpiLoadMouse(), SpiLoadTimeOut(), SpiSetWallpaper(), and SpiUpdatePerUserSystemParameters().

◆ SpiLoadMetric()

static INT SpiLoadMetric ( PCWSTR  pwszValue,
INT  iValue 
)
static

Definition at line 168 of file sysparams.c.

169 {
170  INT iRegVal;
171 
172  iRegVal = SpiLoadInt(KEY_METRIC, pwszValue, METRIC2REG(iValue));
173  TRACE("Loaded metric setting '%S', iValue=%d(reg:%d), ret=%d(reg:%d)\n",
174  pwszValue, iValue, METRIC2REG(iValue), REG2METRIC(iRegVal), iRegVal);
175  return REG2METRIC(iRegVal);
176 }
#define METRIC2REG(met)
Definition: sysparams.c:25
int32_t INT
Definition: typedefs.h:56
#define TRACE(s)
Definition: solgame.cpp:4
#define REG2METRIC(reg)
Definition: sysparams.c:24
static const WCHAR * KEY_METRIC
Definition: sysparams.c:84
static INT SpiLoadInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:120

Referenced by SpiUpdatePerUserSystemParameters().

◆ SpiLoadMouse()

static INT SpiLoadMouse ( PCWSTR  pwszValue,
INT  iValue 
)
static

Definition at line 161 of file sysparams.c.

162 {
163  return SpiLoadInt(KEY_MOUSE, pwszValue, iValue);
164 }
static const WCHAR * KEY_MOUSE
Definition: sysparams.c:45
static INT SpiLoadInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:120

Referenced by SpiUpdatePerUserSystemParameters().

◆ SpiLoadTimeOut()

static DWORD SpiLoadTimeOut ( VOID  )
static

Definition at line 147 of file sysparams.c.

148 { // Must have the string!
149  WCHAR szApplicationName[MAX_PATH];
150  RtlZeroMemory(&szApplicationName, sizeof(szApplicationName));
151  if (!RegReadUserSetting(KEY_DESKTOP, VAL_SCRNSV, REG_SZ, &szApplicationName, sizeof(szApplicationName)))
152  {
153  return 0;
154  }
155  if (wcslen(szApplicationName) == 0) return 0;
156  return SpiLoadInt(KEY_DESKTOP, VAL_SCRTO, 0);
157 }
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:60
static const WCHAR * VAL_SCRNSV
Definition: sysparams.c:62
static const WCHAR * VAL_SCRTO
Definition: sysparams.c:61
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static INT SpiLoadInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:120
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_SZ
Definition: layer.c:22

Referenced by SpiUpdatePerUserSystemParameters().

◆ SpiLoadUserPrefMask()

static DWORD SpiLoadUserPrefMask ( DWORD  dValue)
static

Definition at line 135 of file sysparams.c.

136 {
137  DWORD Result;
138  if (!RegReadUserSetting(KEY_DESKTOP, VAL_USERPREFMASK, REG_BINARY, &Result, sizeof(Result)))
139  {
140  return dValue;
141  }
142  return Result;
143 }
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:60
#define REG_BINARY
Definition: nt_native.h:1496
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR * VAL_USERPREFMASK
Definition: sysparams.c:79

Referenced by SpiUpdatePerUserSystemParameters().

◆ SpiMemCopy()

static UINT_PTR SpiMemCopy ( PVOID  pvDst,
PVOID  pvSrc,
ULONG  cbSize,
BOOL  bProtect 
)
static

Get/Set value

Definition at line 437 of file sysparams.c.

438 {
440 
441  if (bProtect)
442  {
443  _SEH2_TRY
444  {
445  RtlCopyMemory(pvDst, pvSrc, cbSize);
446  }
448  {
450  }
451  _SEH2_END;
452  }
453  else
454  {
455  RtlCopyMemory(pvDst, pvSrc, cbSize);
456  }
457 
458  if (!NT_SUCCESS(Status))
459  {
461  ERR("SpiMemCopy failed, pvDst=%p, pvSrc=%p, bProtect=%d\n", pvDst, pvSrc, bProtect);
462  }
463 
464  return NT_SUCCESS(Status);
465 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
LONG NTSTATUS
Definition: precomp.h:26
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
_SEH2_END
Definition: create.c:4424
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2725

Referenced by SpiGet(), SpiSet(), and SpiSetWallpaper().

◆ SpiNotifyNCMetricsChanged()

static BOOL SpiNotifyNCMetricsChanged ( VOID  )
static

Definition at line 758 of file sysparams.c.

759 {
760  PWND pwndDesktop, pwndCurrent;
761  HWND *ahwnd;
763  int i;
764 
765  pwndDesktop = UserGetDesktopWindow();
766  ASSERT(pwndDesktop);
767 
768  ahwnd = IntWinListChildren(pwndDesktop);
769  if(!ahwnd)
770  return FALSE;
771 
772  for (i = 0; ahwnd[i]; i++)
773  {
774  pwndCurrent = UserGetWindowObject(ahwnd[i]);
775  if(!pwndCurrent)
776  continue;
777 
778  UserRefObjectCo(pwndCurrent, &Ref);
779  co_WinPosSetWindowPos(pwndCurrent, 0, pwndCurrent->rcWindow.left,pwndCurrent->rcWindow.top,
780  pwndCurrent->rcWindow.right-pwndCurrent->rcWindow.left
781  ,pwndCurrent->rcWindow.bottom - pwndCurrent->rcWindow.top,
784  UserDerefObjectCo(pwndCurrent);
785  }
786 
788 
789  return TRUE;
790 }
#define TRUE
Definition: types.h:120
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1658
LONG top
Definition: windef.h:292
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:25
LONG left
Definition: windef.h:291
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:293
#define SWP_NOCOPYBITS
Definition: winuser.h:1228
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:38
Definition: object.h:3
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
#define SWP_NOACTIVATE
Definition: winuser.h:1227
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PWND FASTCALL UserGetDesktopWindow(VOID)
Definition: desktop.c:1349
#define SWP_FRAMECHANGED
Definition: winuser.h:1225
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:255
RECT rcWindow
Definition: ntuser.h:680
Definition: ntuser.h:657
#define SWP_NOREDRAW
Definition: winuser.h:1231
LONG bottom
Definition: windef.h:294
#define SWP_NOMOVE
Definition: winuser.h:1229
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define USERTAG_WINDOWLIST
Definition: tags.h:297

Referenced by SpiGetSet().

◆ SpiSet()

static UINT_PTR SpiSet ( PVOID  pvData,
PVOID  pvParam,
ULONG  cbSize,
FLONG  fl 
)
inlinestatic

Definition at line 477 of file sysparams.c.

478 {
480  return SpiMemCopy(pvData, pvParam, cbSize, fl & SPIF_PROTECT);
481 }
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
#define SPIF_PROTECT
Definition: sysparams.h:13
_In_ FLONG fl
Definition: winddi.h:1279
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
static UINT_PTR SpiMemCopy(PVOID pvDst, PVOID pvSrc, ULONG cbSize, BOOL bProtect)
Definition: sysparams.c:437
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27

Referenced by SpiGetEx(), and SpiGetSet().

◆ SpiSetBool()

static UINT_PTR SpiSetBool ( BOOL pbData,
INT  iValue,
PCWSTR  pwszKey,
PCWSTR  pwszValue,
FLONG  fl 
)
inlinestatic

Definition at line 519 of file sysparams.c.

520 {
522  *pbData = iValue ? TRUE : FALSE;
523  if (fl & SPIF_UPDATEINIFILE)
524  {
525  SpiStoreSzInt(pwszKey, pwszValue, iValue);
526  }
527  return (UINT_PTR)pwszKey;
528 }
#define TRUE
Definition: types.h:120
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
_In_ FLONG fl
Definition: winddi.h:1279
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static VOID SpiStoreSzInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:401
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_updates_bytes_to_ pdwDataLen BYTE * pbData
Definition: wincrypt.h:4201

Referenced by SpiGetSet().

◆ SpiSetDWord()

static UINT_PTR SpiSetDWord ( PVOID  pvData,
INT  iValue,
PCWSTR  pwszKey,
PCWSTR  pwszValue,
FLONG  fl 
)
inlinestatic

Definition at line 532 of file sysparams.c.

533 {
535  *(INT*)pvData = iValue;
536  if (fl & SPIF_UPDATEINIFILE)
537  {
538  SpiStoreDWord(pwszKey, pwszValue, iValue);
539  }
540  return (UINT_PTR)pwszKey;
541 }
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
int32_t INT
Definition: typedefs.h:56
_In_ FLONG fl
Definition: winddi.h:1279
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
static VOID SpiStoreDWord(PCWSTR pwszKey, PCWSTR pwszValue, DWORD Value)
Definition: sysparams.c:379
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27

Referenced by SpiGetSet().

◆ SpiSetInt()

static UINT_PTR SpiSetInt ( PVOID  pvData,
INT  iValue,
PCWSTR  pwszKey,
PCWSTR  pwszValue,
FLONG  fl 
)
inlinestatic

Definition at line 545 of file sysparams.c.

546 {
548  *(INT*)pvData = iValue;
549  if (fl & SPIF_UPDATEINIFILE)
550  {
551  SpiStoreSzInt(pwszKey, pwszValue, iValue);
552  }
553  return (UINT_PTR)pwszKey;
554 }
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
int32_t INT
Definition: typedefs.h:56
_In_ FLONG fl
Definition: winddi.h:1279
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static VOID SpiStoreSzInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:401
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27

Referenced by SpiGetSet().

◆ SpiSetMetric()

static UINT_PTR SpiSetMetric ( PVOID  pvData,
INT  iValue,
PCWSTR  pwszValue,
FLONG  fl 
)
inlinestatic

Definition at line 558 of file sysparams.c.

559 {
561  *(INT*)pvData = iValue;
562  if (fl & SPIF_UPDATEINIFILE)
563  {
564  SpiStoreMetric(pwszValue, iValue);
565  }
566  return (UINT_PTR)KEY_METRIC;
567 }
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
int32_t INT
Definition: typedefs.h:56
_In_ FLONG fl
Definition: winddi.h:1279
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static const WCHAR * KEY_METRIC
Definition: sysparams.c:84
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27
static VOID SpiStoreMetric(LPCWSTR pwszValue, INT iValue)
Definition: sysparams.c:415

Referenced by SpiGetSet().

◆ SpiSetUserPref()

static UINT_PTR SpiSetUserPref ( DWORD  dwMask,
PVOID  pvValue,
FLONG  fl 
)
inlinestatic

Definition at line 571 of file sysparams.c.

572 {
573  DWORD dwRegMask;
574  BOOL bValue = PtrToUlong(pvValue);
575 
577 
578  /* Set or clear bit according to bValue */
579  gspv.dwUserPrefMask = bValue ? gspv.dwUserPrefMask | dwMask :
580  gspv.dwUserPrefMask & ~dwMask;
581 
582  if (fl & SPIF_UPDATEINIFILE)
583  {
584  /* Read current value */
585  if (!RegReadUserSetting(KEY_DESKTOP,
587  REG_BINARY,
588  &dwRegMask,
589  sizeof(DWORD)))
590  {
591  WARN("Failed to read UserPreferencesMask setting\n");
592  dwRegMask = 0;
593  }
594 
595  /* Set or clear bit according to bValue */
596  dwRegMask = bValue ? (dwRegMask | dwMask) : (dwRegMask & ~dwMask);
597 
598  /* write back value */
599  RegWriteUserSetting(KEY_DESKTOP,
601  REG_BINARY,
602  &dwRegMask,
603  sizeof(DWORD));
604  }
605 
606  return (UINT_PTR)KEY_DESKTOP;
607 }
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:60
#define REG_BINARY
Definition: nt_native.h:1496
#define WARN(fmt,...)
Definition: debug.h:111
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
_In_ FLONG fl
Definition: winddi.h:1279
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PtrToUlong(u)
Definition: config.h:107
SPIVALUES gspv
Definition: sysparams.c:17
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
static const WCHAR * VAL_USERPREFMASK
Definition: sysparams.c:79
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27
DWORD dwUserPrefMask
Definition: sysparams.h:124

Referenced by SpiGetSet().

◆ SpiSetWallpaper()

static UINT_PTR SpiSetWallpaper ( PVOID  pvParam,
FLONG  fl 
)
static

Definition at line 619 of file sysparams.c.

620 {
621  UNICODE_STRING ustr;
622  WCHAR awc[MAX_PATH];
623  BOOL bResult;
624  HBITMAP hbmp, hOldBitmap;
625  SURFACE *psurfBmp;
626  ULONG ulTile, ulStyle;
627 
629 
630  if (!pvParam)
631  {
632  /* FIXME: Reset Wallpaper to registry value */
633  return (UINT_PTR)KEY_DESKTOP;
634  }
635 
636  /* Capture UNICODE_STRING */
637  bResult = SpiMemCopy(&ustr, pvParam, sizeof(ustr), fl & SPIF_PROTECT);
638  if (!bResult)
639  {
640  return 0;
641  }
642  if (ustr.Length > MAX_PATH * sizeof(WCHAR))
643  {
644  return 0;
645  }
646 
647  /* Copy the string buffer name */
648  bResult = SpiMemCopy(gspv.awcWallpaper, ustr.Buffer, ustr.Length, fl & SPIF_PROTECT);
649  if (!bResult)
650  {
651  return 0;
652  }
653 
654  /* Update the UNICODE_STRING */
658  gspv.awcWallpaper[ustr.Length / sizeof(WCHAR)] = 0;
659 
660  TRACE("SpiSetWallpaper, name=%S\n", gspv.awcWallpaper);
661 
662  /* Update registry */
663  if (fl & SPIF_UPDATEINIFILE)
664  {
665  SpiStoreSz(KEY_DESKTOP, L"Wallpaper", gspv.awcWallpaper);
666  }
667 
668  /* Got a filename? */
669  if (gspv.awcWallpaper[0] != 0)
670  {
671  /* Convert file name to nt file name */
672  ustr.Buffer = awc;
673  ustr.MaximumLength = MAX_PATH * sizeof(WCHAR);
674  ustr.Length = 0;
676  {
677  ERR("RtlDosPathNameToNtPathName_U failed\n");
678  return 0;
679  }
680 
681  /* Load the Bitmap */
682  hbmp = UserLoadImage(ustr.Buffer);
683  if (!hbmp)
684  {
685  ERR("UserLoadImage failed\n");
686  return 0;
687  }
688 
689  /* Try to get the size of the wallpaper */
690  if (!(psurfBmp = SURFACE_ShareLockSurface(hbmp)))
691  {
693  return 0;
694  }
695 
696  gspv.cxWallpaper = psurfBmp->SurfObj.sizlBitmap.cx;
697  gspv.cyWallpaper = psurfBmp->SurfObj.sizlBitmap.cy;
699 
700  SURFACE_ShareUnlockSurface(psurfBmp);
701 
702  /* Change the bitmap's ownership */
704 
705  /* Yes, Windows really loads the current setting from the registry. */
706  ulTile = SpiLoadInt(KEY_DESKTOP, L"TileWallpaper", 0);
707  ulStyle = SpiLoadInt(KEY_DESKTOP, L"WallpaperStyle", 0);
708  TRACE("SpiSetWallpaper: ulTile=%lu, ulStyle=%lu\n", ulTile, ulStyle);
709 
710  /* Check the values we found in the registry */
711  if (ulTile && !ulStyle)
712  {
714  }
715  else if (!ulTile && ulStyle)
716  {
717  if (ulStyle == 2)
718  {
720  }
721  else if (ulStyle == 6)
722  {
724  }
725  else if (ulStyle == 10)
726  {
728  }
729  }
730  }
731  else
732  {
733  /* Remove wallpaper */
734  gspv.cxWallpaper = 0;
735  gspv.cyWallpaper = 0;
736  hbmp = 0;
737  }
738 
739  /* Take care of the old wallpaper, if any */
740  hOldBitmap = gspv.hbmWallpaper;
741  if(hOldBitmap != NULL)
742  {
743  /* Delete the old wallpaper */
745  GreDeleteObject(hOldBitmap);
746  }
747 
748  /* Set the new wallpaper */
750 
752 
753 
754  return (UINT_PTR)KEY_DESKTOP;
755 }
HANDLE hbmWallpaper
Definition: sysparams.h:142
ULONG cyWallpaper
Definition: sysparams.h:143
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
Definition: gdiobj.c:1250
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1153
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:60
SIZEL sizlBitmap
Definition: winddi.h:1209
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
USHORT MaximumLength
Definition: env_spec_w32.h:370
WCHAR awcWallpaper[MAX_PATH+1]
Definition: sysparams.h:146
BOOL NTAPI W32kDosPathNameToNtPathName(PCWSTR, PUNICODE_STRING)
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
#define SPIF_PROTECT
Definition: sysparams.h:13
_In_ FLONG fl
Definition: winddi.h:1279
unsigned int BOOL
Definition: ntddk_ex.h:94
HWND FASTCALL UserGetShellWindow(VOID)
Definition: window.c:3476
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:319
HBITMAP hbmp
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define RDW_ERASE
Definition: winuser.h:1197
#define MAX_PATH
Definition: compat.h:26
SPIVALUES gspv
Definition: sysparams.c:17
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
HBITMAP NTAPI UserLoadImage(PCWSTR)
Definition: file.c:155
static const WCHAR L[]
Definition: oid.c:1250
UNICODE_STRING ustrWallpaper
Definition: sysparams.h:145
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
#define ERR(fmt,...)
Definition: debug.h:109
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
BOOL NTAPI NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
Definition: painting.c:1990
static UINT_PTR SpiMemCopy(PVOID pvDst, PVOID pvSrc, ULONG cbSize, BOOL bProtect)
Definition: sysparams.c:437
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
static VOID SpiStoreSz(PCWSTR pwszKey, PCWSTR pwszValue, PCWSTR pwsz)
Definition: sysparams.c:390
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27
unsigned int ULONG
Definition: retypes.h:1
static INT SpiLoadInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:120
static HBITMAP
Definition: button.c:44
LONG cy
Definition: windef.h:320
ULONG cxWallpaper
Definition: sysparams.h:143
#define RDW_INVALIDATE
Definition: winuser.h:1200
WALLPAPER_MODE WallpaperMode
Definition: sysparams.h:144

Referenced by SpiGetSet().

◆ SpiSetYesNo()

static UINT_PTR SpiSetYesNo ( BOOL pbData,
BOOL  bValue,
PCWSTR  pwszKey,
PCWSTR  pwszValue,
FLONG  fl 
)
inlinestatic

Definition at line 506 of file sysparams.c.

507 {
509  *pbData = bValue ? TRUE : FALSE;
510  if (fl & SPIF_UPDATEINIFILE)
511  {
512  SpiStoreSz(pwszKey, pwszValue, bValue ? L"Yes" : L"No");
513  }
514  return (UINT_PTR)pwszKey;
515 }
#define TRUE
Definition: types.h:120
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
_In_ FLONG fl
Definition: winddi.h:1279
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
static const WCHAR L[]
Definition: oid.c:1250
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static VOID SpiStoreSz(PCWSTR pwszKey, PCWSTR pwszValue, PCWSTR pwsz)
Definition: sysparams.c:390
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:27
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_updates_bytes_to_ pdwDataLen BYTE * pbData
Definition: wincrypt.h:4201

Referenced by SpiGetSet().

◆ SpiStoreDWord()

static VOID SpiStoreDWord ( PCWSTR  pwszKey,
PCWSTR  pwszValue,
DWORD  Value 
)
static

Storing the settings

Definition at line 379 of file sysparams.c.

380 {
381  RegWriteUserSetting(pwszKey,
382  pwszValue,
383  REG_DWORD,
384  &Value,
385  sizeof(Value));
386 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by SpiSetDWord().

◆ SpiStoreFont()

static VOID SpiStoreFont ( PCWSTR  pwszValue,
LOGFONTW plogfont 
)
static

Definition at line 422 of file sysparams.c.

423 {
424  RegWriteUserSetting(KEY_METRIC,
425  pwszValue,
426  REG_BINARY,
427  plogfont,
428  sizeof(LOGFONTW));
429 }
#define REG_BINARY
Definition: nt_native.h:1496
static const WCHAR * KEY_METRIC
Definition: sysparams.c:84

Referenced by SpiGetSet().

◆ SpiStoreMetric()

static VOID SpiStoreMetric ( LPCWSTR  pwszValue,
INT  iValue 
)
static

Definition at line 415 of file sysparams.c.

416 {
417  SpiStoreSzInt(KEY_METRIC, pwszValue, METRIC2REG(iValue));
418 }
#define METRIC2REG(met)
Definition: sysparams.c:25
static const WCHAR * KEY_METRIC
Definition: sysparams.c:84
static VOID SpiStoreSzInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:401

Referenced by SpiGetSet(), and SpiSetMetric().

◆ SpiStoreSz()

static VOID SpiStoreSz ( PCWSTR  pwszKey,
PCWSTR  pwszValue,
PCWSTR  pwsz 
)
static

Definition at line 390 of file sysparams.c.

391 {
392  RegWriteUserSetting(pwszKey,
393  pwszValue,
394  REG_SZ,
395  pwsz,
396  (wcslen(pwsz) + 1) * sizeof(WCHAR));
397 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_SZ
Definition: layer.c:22

Referenced by SpiGetSet(), SpiSetWallpaper(), and SpiSetYesNo().

◆ SpiStoreSzInt()

static VOID SpiStoreSzInt ( PCWSTR  pwszKey,
PCWSTR  pwszValue,
INT  iValue 
)
static

Definition at line 401 of file sysparams.c.

402 {
403  WCHAR awcBuffer[15];
404 
405  _itow(iValue, awcBuffer, 10);
406  RegWriteUserSetting(pwszKey,
407  pwszValue,
408  REG_SZ,
409  awcBuffer,
410  (wcslen(awcBuffer) + 1) * sizeof(WCHAR));
411 }
_CRTIMP wchar_t *__cdecl _itow(_In_ int _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
__wchar_t WCHAR
Definition: xmlstorage.h:180
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_SZ
Definition: layer.c:22

Referenced by SpiGetSet(), SpiSetBool(), SpiSetInt(), and SpiStoreMetric().

◆ SpiUpdatePerUserSystemParameters()

static VOID SpiUpdatePerUserSystemParameters ( VOID  )
static

Definition at line 219 of file sysparams.c.

220 {
221  static LOGFONTW lf1 = {-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE,
223  VARIABLE_PITCH | FF_SWISS, L"MS Sans Serif"};
224  static LOGFONTW lf2 = {-11, 0, 0, 0, FW_BOLD, FALSE, FALSE,
226  VARIABLE_PITCH | FF_SWISS, L"MS Sans Serif"};
227 
228  TRACE("Enter SpiUpdatePerUserSystemParameters\n");
229 
230  /* Clear the structure */
231  RtlZeroMemory(&gspv, sizeof(gspv));
232 
233  /* Load mouse settings */
247 
248  /* Load NONCLIENTMETRICS */
249  gspv.ncm.cbSize = sizeof(NONCLIENTMETRICSW);
250  gspv.ncm.iBorderWidth = SpiLoadMetric(VAL_BORDER, 1);
251  gspv.ncm.iScrollWidth = SpiLoadMetric(L"ScrollWidth", 16);
252  gspv.ncm.iScrollHeight = SpiLoadMetric(L"ScrollHeight", 16);
253  gspv.ncm.iCaptionWidth = SpiLoadMetric(L"CaptionWidth", 19);
254  gspv.ncm.iCaptionHeight = SpiLoadMetric(L"CaptionHeight", 19);
255  gspv.ncm.iSmCaptionWidth = SpiLoadMetric(L"SmCaptionWidth", 12);
256  gspv.ncm.iSmCaptionHeight = SpiLoadMetric(L"SmCaptionHeight", 14);
257  gspv.ncm.iMenuWidth = SpiLoadMetric(L"MenuWidth", 18);
258  gspv.ncm.iMenuHeight = SpiLoadMetric(L"MenuHeight", 18);
259 #if (WINVER >= 0x0600)
260  gspv.ncm.iPaddedBorderWidth = SpiLoadMetric(L"PaddedBorderWidth", 18);
261 #endif
262  SpiLoadFont(&gspv.ncm.lfCaptionFont, L"CaptionFont", &lf2);
263  SpiLoadFont(&gspv.ncm.lfSmCaptionFont, L"SmCaptionFont", &lf1);
264  SpiLoadFont(&gspv.ncm.lfMenuFont, L"MenuFont", &lf1);
265  SpiLoadFont(&gspv.ncm.lfStatusFont, L"StatusFont", &lf1);
266  SpiLoadFont(&gspv.ncm.lfMessageFont, L"MessageFont", &lf1);
267 
268  /* Load MINIMIZEDMETRICS */
269  gspv.mm.cbSize = sizeof(MINIMIZEDMETRICS);
270  gspv.mm.iWidth = SpiLoadMetric(L"MinWidth", 160);
271  gspv.mm.iHorzGap = SpiLoadMetric(L"MinHorzGap", 160);
272  gspv.mm.iVertGap = SpiLoadMetric(L"MinVertGap", 24);
273  gspv.mm.iArrange = SpiLoadInt(KEY_METRIC, L"MinArrange", ARW_HIDE);
274 
275  /* Load ICONMETRICS */
276  gspv.im.cbSize = sizeof(ICONMETRICSW);
277  gspv.im.iHorzSpacing = SpiLoadMetric(VAL_ICONSPC, 64);
278  gspv.im.iVertSpacing = SpiLoadMetric(VAL_ICONVSPC, 64);
279  gspv.im.iTitleWrap = SpiLoadMetric(VAL_ITWRAP, 0);
280  SpiLoadFont(&gspv.im.lfFont, L"IconFont", &lf1);
281 
282  /* Load desktop settings */
286  gpsi->dtCaretBlink = SpiLoadInt(KEY_DESKTOP, VAL_CARETRATE, 530);
294 #if (_WIN32_WINNT >= 0x0600)
295  gspv.uiWheelScrollChars = SpiLoadInt(KEY_DESKTOP, VAL_SCRLLCHARS, 3);
296 #endif
297 
298  /* Some hardcoded values for now */
299 
301  gspv.bBeep = TRUE;
304  gspv.bMenuDropAlign = 1;
305  gspv.dwMenuShowDelay = 100;
307 
311 #if(WINVER >= 0x0600)
312  gspv.bScrSaverSecure = FALSE;
313 #endif
314 
316  gspv.filterkeys.cbSize = sizeof(FILTERKEYS);
317  gspv.togglekeys.cbSize = sizeof(TOGGLEKEYS);
318  gspv.mousekeys.cbSize = sizeof(MOUSEKEYS);
319  gspv.stickykeys.cbSize = sizeof(STICKYKEYS);
320  gspv.serialkeys.cbSize = sizeof(SERIALKEYS);
324 
325  /* Make sure we don't use broken values */
326  SpiFixupValues();
327 
328  /* Update SystemMetrics */
329  InitMetrics();
330 
331  if (gbSpiInitialized && gpsi)
332  {
337  }
339 }
static const WCHAR * VAL_HOVERTIME
Definition: sysparams.c:55
SOUNDSENTRYW soundsentry
Definition: sysparams.h:70
MOUSEKEYS mousekeys
Definition: sysparams.h:76
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:60
#define TRUE
Definition: types.h:120
struct tagMINIMIZEDMETRICS MINIMIZEDMETRICS
UINT uiFocusBorderHeight
Definition: sysparams.h:55
#define VARIABLE_PITCH
Definition: wingdi.h:444
DWORD dwMenuShowDelay
Definition: sysparams.h:131
FILTERKEYS filterkeys
Definition: sysparams.h:100
#define DEFAULT_QUALITY
Definition: wingdi.h:435
static const WCHAR * VAL_FONTSMOOTHING
Definition: sysparams.c:68
static const WCHAR * VAL_ICONVSPC
Definition: sysparams.c:87
static const WCHAR * VAL_CLICKLOCKTIME
Definition: sysparams.c:73
BOOL bMouseBtnSwap
Definition: sysparams.h:82
BOOL bDragFullWindows
Definition: sysparams.h:129
DWORD dwForegroundFlashCount
Definition: sysparams.h:157
static const WCHAR * VAL_MOUSETRAILS
Definition: sysparams.c:49
LONG tmAveCharWidth
Definition: wingdi.h:2366
INT iMouseSpeed
Definition: sysparams.h:84
UINT uiFontSmoothingType
Definition: sysparams.h:126
NONCLIENTMETRICSW ncm
Definition: sysparams.h:51
ANIMATIONINFO animationinfo
Definition: sysparams.h:152
INT iScrSaverTimeout
Definition: sysparams.h:110
INT iWheelScrollLines
Definition: sysparams.h:94
DWORD dwMouseClickLockTime
Definition: sysparams.h:79
ACCESSTIMEOUT accesstimeout
Definition: sysparams.h:58
SERIALKEYSA SERIALKEYS
Definition: winuser.h:5590
BOOL bScrSaverActive
Definition: sysparams.h:111
static const WCHAR * VAL_ITWRAP
Definition: sysparams.c:88
INT iMouseHoverHeight
Definition: sysparams.h:86
UINT uiFontSmoothingContrast
Definition: sysparams.h:127
BOOL bScrSaverRunning
Definition: sysparams.h:112
PSERVERINFO gpsi
Definition: main.c:27
UINT uiFocusBorderWidth
Definition: sysparams.h:54
static const WCHAR * VAL_SENSITIVITY
Definition: sysparams.c:58
static const WCHAR * VAL_MOUSE3
Definition: sysparams.c:48
static const WCHAR * VAL_DBLCLKTIME
Definition: sysparams.c:52
INT iMouseHoverWidth
Definition: sysparams.h:85
static INT SpiLoadDWord(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:108
BOOL bMouseClickLock
Definition: sysparams.h:77
static DWORD SpiLoadTimeOut(VOID)
Definition: sysparams.c:147
static const WCHAR * VAL_DRAG
Definition: sysparams.c:65
DWORD cbSize
Definition: winuser.h:3476
struct tagHIGHCONTRASTW HIGHCONTRASTW
static const WCHAR * VAL_MOUSE1
Definition: sysparams.c:46
static const WCHAR * VAL_FONTSMOOTHINGORIENTATION
Definition: sysparams.c:71
INT iDblClickTime
Definition: sysparams.h:90
struct tagANIMATIONINFO ANIMATIONINFO
DWORD dwSRVIFlags
Definition: ntuser.h:1004
static const WCHAR * VAL_FONTSMOOTHINGCONTRAST
Definition: sysparams.c:70
#define SRVINFO_KBDPREF
Definition: ntuser.h:913
BOOL bSnapToDefBtn
Definition: sysparams.h:153
SERIALKEYS serialkeys
Definition: sysparams.h:101
struct tagSTICKYKEYS STICKYKEYS
static VOID SpiLoadFont(PLOGFONTW plfOut, LPWSTR pwszValueName, PLOGFONTW plfDefault)
Definition: sysparams.c:180
static const WCHAR * VAL_FONTSMOOTHINGTYPE
Definition: sysparams.c:69
TEXTMETRICW tmCaptionFont
Definition: sysparams.h:139
BOOL bMouseCursorShadow
Definition: sysparams.h:78
BOOL gbSpiInitialized
Definition: sysparams.c:18
struct tagMOUSEKEYS MOUSEKEYS
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR * VAL_SCRLLLINES
Definition: sysparams.c:72
UINT uiFontSmoothingOrientation
Definition: sysparams.h:128
BOOL NTAPI InitMetrics(VOID)
Definition: metric.c:19
SPIVALUES gspv
Definition: sysparams.c:17
TOGGLEKEYS togglekeys
Definition: sysparams.h:103
static const WCHAR * VAL_ICONSPC
Definition: sysparams.c:86
static const WCHAR * VAL_DBLCLKHEIGHT
Definition: sysparams.c:51
static DWORD SpiLoadUserPrefMask(DWORD dValue)
Definition: sysparams.c:135
static const WCHAR L[]
Definition: oid.c:1250
DWORD cbSize
Definition: winuser.h:3471
INT iMouseHoverTime
Definition: sysparams.h:87
BOOL bMenuDropAlign
Definition: sysparams.h:130
#define PUSIF_COMBOBOXANIMATION
Definition: ntuser.h:956
#define PUSIF_LISTBOXSMOOTHSCROLLING
Definition: ntuser.h:957
BOOL bKbdPref
Definition: sysparams.h:105
static const WCHAR * VAL_SNAPDEFBTN
Definition: sysparams.c:53
STICKYKEYS stickykeys
Definition: sysparams.h:102
#define FF_SWISS
Definition: wingdi.h:451
static const WCHAR * VAL_MOUSE2
Definition: sysparams.c:47
#define FW_BOLD
Definition: wingdi.h:377
INT iDblClickHeight
Definition: sysparams.h:89
static const WCHAR * VAL_HOVERHEIGHT
Definition: sysparams.c:57
ICONMETRICSW im
Definition: sysparams.h:53
static const WCHAR * KEY_METRIC
Definition: sysparams.c:84
static const WCHAR * VAL_DBLCLKWIDTH
Definition: sysparams.c:50
BOOL bFontSmoothing
Definition: sysparams.h:125
static INT SpiLoadMetric(PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:168
static INT SpiLoadMouse(PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:161
#define SPITESTPREF(x)
Definition: sysparams.h:195
#define FW_NORMAL
Definition: wingdi.h:372
#define PUSIF_KEYBOARDCUES
Definition: ntuser.h:958
HIGHCONTRASTW highcontrast
Definition: sysparams.h:59
UINT cbSize
Definition: winuser.h:3353
INT iMouseTrails
Definition: sysparams.h:93
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static INT SpiLoadInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:120
#define ARW_HIDE
Definition: winuser.h:1066
INT iDblClickWidth
Definition: sysparams.h:88
struct tagTOGGLEKEYS TOGGLEKEYS
#define ANSI_CHARSET
Definition: wingdi.h:382
DWORD FASTCALL UserGetLanguageToggle(VOID)
Definition: misc.c:80
static VOID SpiFixupValues(VOID)
Definition: sysparams.c:195
struct tagACCESSTIMEOUT ACCESSTIMEOUT
static const WCHAR * VAL_BORDER
Definition: sysparams.c:85
BOOL bBeep
Definition: sysparams.h:72
struct tagSOUNDSENTRYW SOUNDSENTRYW
struct tagFILTERKEYS FILTERKEYS
static const WCHAR * VAL_SWAP
Definition: sysparams.c:54
DWORD dwUserPrefMask
Definition: sysparams.h:124
static const WCHAR * VAL_CARETRATE
Definition: sysparams.c:75
MINIMIZEDMETRICS mm
Definition: sysparams.h:52
DWORD gdwLanguageToggleKey
Definition: keyboard.c:19
static const WCHAR * VAL_HOVERWIDTH
Definition: sysparams.c:56
CURSORACCELERATION_INFO caiMouse
Definition: sysparams.h:75

Referenced by InitSysParams(), and NtUserUpdatePerUserSystemParameters().

◆ UserSystemParametersInfo()

BOOL FASTCALL UserSystemParametersInfo ( UINT  uiAction,
UINT  uiParam,
PVOID  pvParam,
UINT  fWinIni 
)

Definition at line 2066 of file sysparams.c.

2071 {
2072  ULONG_PTR ulResult;
2074 
2075  ASSERT(ppi);
2076 
2077  if (!gbSpiInitialized)
2078  {
2080  //ASSERT(FALSE);
2081  return FALSE;
2082  }
2083 
2084  /* Get a pointer to the current Windowstation */
2085  if (!ppi->prpwinsta)
2086  {
2087  ERR("UserSystemParametersInfo called without active window station.\n");
2088  //ASSERT(FALSE);
2089  //return FALSE;
2090  }
2091 
2092  if ((fWinIni & SPIF_PROTECT) && !SpiGetSetProbeBuffer(uiAction, uiParam, pvParam))
2093  {
2095  return FALSE;
2096  }
2097 
2098  /* Do the actual operation */
2099  ulResult = SpiGetSet(uiAction, uiParam, pvParam, fWinIni);
2100 
2101  /* Did we change something? */
2102  if (ulResult > 1)
2103  {
2104  SpiFixupValues();
2105 
2106  /* Update system metrics */
2107  InitMetrics();
2108 
2109  /* Send notification to toplevel windows, if requested */
2110  if (fWinIni & (SPIF_SENDCHANGE | SPIF_SENDWININICHANGE))
2111  {
2112  /* Send WM_SETTINGCHANGE to all toplevel windows */
2115  (WPARAM)uiAction,
2116  (LPARAM)ulResult,
2117  SMTO_NORMAL,
2118  100,
2119  &ulResult);
2120  }
2121  ulResult = 1;
2122  }
2123 
2124  return ulResult;
2125 }
#define KeRosDumpStackFrames(Frames, Count)
Definition: gdidebug.h:11
UINT_PTR WPARAM
Definition: windef.h:207
struct _WINSTATION_OBJECT * prpwinsta
Definition: win32.h:257
#define SPIF_PROTECT
Definition: sysparams.h:13
#define WM_SETTINGCHANGE
Definition: winuser.h:1611
#define SMTO_NORMAL
Definition: winuser.h:1211
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define ERROR_NOACCESS
Definition: winerror.h:578
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
BOOL gbSpiInitialized
Definition: sysparams.c:18
#define SPIF_SENDWININICHANGE
Definition: winuser.h:1554
static UINT_PTR SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
Definition: sysparams.c:794
BOOL NTAPI InitMetrics(VOID)
Definition: metric.c:19
LRESULT FASTCALL co_IntSendMessageTimeout(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT uFlags, UINT uTimeout, ULONG_PTR *uResult)
Definition: message.c:1491
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static BOOL SpiGetSetProbeBuffer(UINT uiAction, UINT uiParam, PVOID pvParam)
Definition: sysparams.c:1795
#define ERR(fmt,...)
Definition: debug.h:109
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
#define SPIF_SENDCHANGE
Definition: winuser.h:1555
#define HWND_BROADCAST
Definition: winuser.h:1190
static VOID SpiFixupValues(VOID)
Definition: sysparams.c:195
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by DefWndDoSizeMove(), IntDefWindowProc(), IntDrawMenuBarTemp(), IntPaintDesktop(), MENU_DrawBitmapItem(), MENU_DrawMenuItem(), MENU_DrawPopupMenu(), MenuInit(), NC_DoNCPaint(), NC_HandleNCLButtonDblClk(), NtUserSystemParametersInfo(), UserDrawCaptionBar(), and UserDrawCaptionText().

Variable Documentation

◆ g_PaintDesktopVersion

BOOL g_PaintDesktopVersion = FALSE

Definition at line 19 of file sysparams.c.

Referenced by IntPaintDesktop(), and NtUserUpdatePerUserSystemParameters().

◆ gbSpiInitialized

BOOL gbSpiInitialized = FALSE

◆ gspv

◆ KEY_DESKTOP

◆ KEY_KBD

const WCHAR* KEY_KBD = L"Control Panel\\Keyboard"
static

Definition at line 93 of file sysparams.c.

Referenced by SpiGetSet().

◆ KEY_KDBPREF

const WCHAR* KEY_KDBPREF = L"Control Panel\\Accessibility\\Keyboard Preference"
static

Definition at line 98 of file sysparams.c.

Referenced by SpiGetSet().

◆ KEY_MDALIGN

const WCHAR* KEY_MDALIGN = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
static

Definition at line 81 of file sysparams.c.

Referenced by SpiGetSet().

◆ KEY_METRIC

const WCHAR* KEY_METRIC = L"Control Panel\\Desktop\\WindowMetrics"
static

◆ KEY_MOUSE

const WCHAR* KEY_MOUSE = L"Control Panel\\Mouse"
static

Definition at line 45 of file sysparams.c.

Referenced by SpiGetSet(), and SpiLoadMouse().

◆ KEY_SCRREAD

const WCHAR* KEY_SCRREAD = L"Control Panel\\Accessibility\\Blind Access"
static

Definition at line 99 of file sysparams.c.

Referenced by SpiGetSet().

◆ KEY_SHOWSNDS

const WCHAR* KEY_SHOWSNDS = L"Control Panel\\Accessibility\\ShowSounds"
static

Definition at line 97 of file sysparams.c.

Referenced by SpiGetSet().

◆ KEY_SOUND

const WCHAR* KEY_SOUND = L"Control Panel\\Sound"
static

Definition at line 90 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_BEEP

const WCHAR* VAL_BEEP = L"Beep"
static

Definition at line 91 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_BORDER

const WCHAR* VAL_BORDER = L"BorderWidth"
static

Definition at line 85 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_CARETRATE

const WCHAR* VAL_CARETRATE = L"CursorBlinkRate"
static

Definition at line 75 of file sysparams.c.

Referenced by SpiUpdatePerUserSystemParameters().

◆ VAL_CLICKLOCKTIME

const WCHAR* VAL_CLICKLOCKTIME = L"ClickLockTime"
static

Definition at line 73 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_DBLCLKHEIGHT

const WCHAR* VAL_DBLCLKHEIGHT = L"DoubleClickHeight"
static

Definition at line 51 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_DBLCLKTIME

const WCHAR* VAL_DBLCLKTIME = L"DoubleClickSpeed"
static

Definition at line 52 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_DBLCLKWIDTH

const WCHAR* VAL_DBLCLKWIDTH = L"DoubleClickWidth"
static

Definition at line 50 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_DRAG

const WCHAR* VAL_DRAG = L"DragFullWindows"
static

Definition at line 65 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_DRAGHEIGHT

const WCHAR* VAL_DRAGHEIGHT = L"DragHeight"
static

Definition at line 66 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_DRAGWIDTH

const WCHAR* VAL_DRAGWIDTH = L"DragWidth"
static

Definition at line 67 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_FONTSMOOTHING

const WCHAR* VAL_FONTSMOOTHING = L"FontSmoothing"
static

Definition at line 68 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_FONTSMOOTHINGCONTRAST

const WCHAR* VAL_FONTSMOOTHINGCONTRAST = L"FontSmoothingGamma"
static

Definition at line 70 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_FONTSMOOTHINGORIENTATION

const WCHAR* VAL_FONTSMOOTHINGORIENTATION = L"FontSmoothingOrientation"
static

Definition at line 71 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_FONTSMOOTHINGTYPE

const WCHAR* VAL_FONTSMOOTHINGTYPE = L"FontSmoothingType"
static

Definition at line 69 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_GRID

const WCHAR* VAL_GRID = L"GridGranularity"
static

Definition at line 64 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_HOVERHEIGHT

const WCHAR* VAL_HOVERHEIGHT = L"MouseHoverHeight"
static

Definition at line 57 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_HOVERTIME

const WCHAR* VAL_HOVERTIME = L"MouseHoverTime"
static

Definition at line 55 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_HOVERWIDTH

const WCHAR* VAL_HOVERWIDTH = L"MouseHoverWidth"
static

Definition at line 56 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_ICONSPC

const WCHAR* VAL_ICONSPC = L"IconSpacing"
static

Definition at line 86 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_ICONVSPC

const WCHAR* VAL_ICONVSPC = L"IconVerticalspacing"
static

Definition at line 87 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_ITWRAP

const WCHAR* VAL_ITWRAP = L"IconTitleWrap"
static

Definition at line 88 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_KBDDELAY

const WCHAR* VAL_KBDDELAY = L"KeyboardDelay"
static

Definition at line 95 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_KBDSPD

const WCHAR* VAL_KBDSPD = L"KeyboardSpeed"
static

Definition at line 94 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_MDALIGN

const WCHAR* VAL_MDALIGN = L"MenuDropAlignment"
static

Definition at line 82 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_MOUSE1

const WCHAR* VAL_MOUSE1 = L"MouseThreshold1"
static

Definition at line 46 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_MOUSE2

const WCHAR* VAL_MOUSE2 = L"MouseThreshold2"
static

Definition at line 47 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_MOUSE3

const WCHAR* VAL_MOUSE3 = L"MouseSpeed"
static

Definition at line 48 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_MOUSETRAILS

const WCHAR* VAL_MOUSETRAILS = L"MouseTrails"
static

Definition at line 49 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_ON

const WCHAR* VAL_ON = L"On"
static

Definition at line 100 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_PAINTDESKVER

const WCHAR* VAL_PAINTDESKVER = L"PaintDesktopVersion"
static

Definition at line 74 of file sysparams.c.

Referenced by NtUserUpdatePerUserSystemParameters().

◆ VAL_SCRACT

const WCHAR* VAL_SCRACT = L"ScreenSaveActive"
static

Definition at line 63 of file sysparams.c.

Referenced by SpiGetSet().

◆ VAL_SCRLLLINES

const WCHAR* VAL_SCRLLLINES = L"WheelScrollLines"
static

Definition at line 72 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_SCRNSV

const WCHAR* VAL_SCRNSV = L"SCRNSAVE.EXE"
static

Definition at line 62 of file sysparams.c.

Referenced by SpiLoadTimeOut().

◆ VAL_SCRTO

const WCHAR* VAL_SCRTO = L"ScreenSaveTimeOut"
static

Definition at line 61 of file sysparams.c.

Referenced by SpiGetSet(), and SpiLoadTimeOut().

◆ VAL_SENSITIVITY

const WCHAR* VAL_SENSITIVITY = L"MouseSensitivity"
static

Definition at line 58 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_SNAPDEFBTN

const WCHAR* VAL_SNAPDEFBTN = L"SnapToDefaultButton"
static

Definition at line 53 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_SWAP

const WCHAR* VAL_SWAP = L"SwapMouseButtons"
static

Definition at line 54 of file sysparams.c.

Referenced by SpiGetSet(), and SpiUpdatePerUserSystemParameters().

◆ VAL_USERPREFMASK

const WCHAR* VAL_USERPREFMASK = L"UserPreferencesMask"
static

Definition at line 79 of file sysparams.c.

Referenced by SpiLoadUserPrefMask(), and SpiSetUserPref().