ReactOS 0.4.16-dev-1172-g2041f3c
sysparams.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL, see COPYING in the top level directory
3 * PROJECT: ReactOS win32 kernel mode subsystem server
4 * PURPOSE: System parameters functions
5 * FILE: win32ss/user/ntuser/sysparams.c
6 * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
7 */
8
9// TODO:
10// - Check all values that are in Winsta in ROS.
11// - Does setting invalid fonts work?
12// - Save appropriate text metrics.
13
14#include <win32k.h>
15DBG_DEFAULT_CHANNEL(UserSysparams);
16
21
22// HACK! We initialize SPI before we have a proper surface to get this from.
23#define dpi 96
24//(pPrimarySurface->GDIInfo.ulLogPixelsY)
25#define REG2METRIC(reg) (reg > 0 ? reg : ((-(reg) * dpi + 720) / 1440))
26#define METRIC2REG(met) (-((((met) * 1440)- 0) / dpi))
27
28#define REQ_INTERACTIVE_WINSTA(err) \
29do { \
30 if (GetW32ProcessInfo()->prpwinsta != InputWindowStation) \
31 { \
32 if (GetW32ProcessInfo()->prpwinsta == NULL) \
33 { \
34 ERR("NtUserSystemParametersInfo called without active window station, and it requires an interactive one\n"); \
35 } \
36 else \
37 { \
38 ERR("NtUserSystemParametersInfo requires interactive window station (current is '%wZ')\n", \
39 &(OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(GetW32ProcessInfo()->prpwinsta))->Name)); \
40 } \
41 EngSetLastError(err); \
42 return 0; \
43 } \
44} while (0)
45
46static const WCHAR* KEY_MOUSE = L"Control Panel\\Mouse";
47static const WCHAR* VAL_MOUSE1 = L"MouseThreshold1";
48static const WCHAR* VAL_MOUSE2 = L"MouseThreshold2";
49static const WCHAR* VAL_MOUSE3 = L"MouseSpeed";
50static const WCHAR* VAL_MOUSETRAILS = L"MouseTrails";
51static const WCHAR* VAL_DBLCLKWIDTH = L"DoubleClickWidth";
52static const WCHAR* VAL_DBLCLKHEIGHT = L"DoubleClickHeight";
53static const WCHAR* VAL_DBLCLKTIME = L"DoubleClickSpeed";
54static const WCHAR* VAL_SNAPDEFBTN = L"SnapToDefaultButton";
55static const WCHAR* VAL_SWAP = L"SwapMouseButtons";
56static const WCHAR* VAL_HOVERTIME = L"MouseHoverTime";
57static const WCHAR* VAL_HOVERWIDTH = L"MouseHoverWidth";
58static const WCHAR* VAL_HOVERHEIGHT = L"MouseHoverHeight";
59static const WCHAR* VAL_SENSITIVITY = L"MouseSensitivity";
60
61static const WCHAR* KEY_DESKTOP = L"Control Panel\\Desktop";
62static const WCHAR* VAL_SCRTO = L"ScreenSaveTimeOut";
63static const WCHAR* VAL_SCRNSV = L"SCRNSAVE.EXE";
64static const WCHAR* VAL_SCRACT = L"ScreenSaveActive";
65static const WCHAR* VAL_GRID = L"GridGranularity";
66static const WCHAR* VAL_DRAG = L"DragFullWindows";
67static const WCHAR* VAL_DRAGHEIGHT = L"DragHeight";
68static const WCHAR* VAL_DRAGWIDTH = L"DragWidth";
69static const WCHAR* VAL_FONTSMOOTHING = L"FontSmoothing";
70static const WCHAR* VAL_FONTSMOOTHINGTYPE = L"FontSmoothingType";
71static const WCHAR* VAL_FONTSMOOTHINGCONTRAST = L"FontSmoothingGamma";
72static const WCHAR* VAL_FONTSMOOTHINGORIENTATION = L"FontSmoothingOrientation";
73static const WCHAR* VAL_SCRLLLINES = L"WheelScrollLines";
74static const WCHAR* VAL_CLICKLOCKTIME = L"ClickLockTime";
75static const WCHAR* VAL_PAINTDESKVER = L"PaintDesktopVersion";
76static const WCHAR* VAL_CARETRATE = L"CursorBlinkRate";
77static const WCHAR* VAL_CARETWIDTH = L"CaretWidth";
78#if (_WIN32_WINNT >= 0x0600)
79static const WCHAR* VAL_SCRLLCHARS = L"WheelScrollChars";
80#endif
81static const WCHAR* VAL_USERPREFMASK = L"UserPreferencesMask";
82static const WCHAR* VAL_SNAP_ENABLED = L"WindowArrangementActive";
83static const WCHAR* VAL_SNAP_DOCKMOVING = L"DockMoving";
84
85static const WCHAR* KEY_MDALIGN = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows";
86static const WCHAR* VAL_MDALIGN = L"MenuDropAlignment";
87
88static const WCHAR* KEY_METRIC = L"Control Panel\\Desktop\\WindowMetrics";
89static const WCHAR* VAL_BORDER = L"BorderWidth";
90static const WCHAR* VAL_ICONSPC = L"IconSpacing";
91static const WCHAR* VAL_ICONVSPC = L"IconVerticalspacing";
92static const WCHAR* VAL_ITWRAP = L"IconTitleWrap";
93
94static const WCHAR* KEY_SOUND = L"Control Panel\\Sound";
95static const WCHAR* VAL_BEEP = L"Beep";
96
97static const WCHAR* KEY_KBD = L"Control Panel\\Keyboard";
98static const WCHAR* VAL_KBDSPD = L"KeyboardSpeed";
99static const WCHAR* VAL_KBDDELAY = L"KeyboardDelay";
100
101static const WCHAR* KEY_SHOWSNDS = L"Control Panel\\Accessibility\\ShowSounds";
102static const WCHAR* KEY_KDBPREF = L"Control Panel\\Accessibility\\Keyboard Preference";
103static const WCHAR* KEY_SCRREAD = L"Control Panel\\Accessibility\\Blind Access";
104static const WCHAR* VAL_ON = L"On";
105
106static const WCHAR* KEY_MOUSEKEYS = L"Control Panel\\Accessibility\\MouseKeys";
107static const WCHAR* VAL_MOUSEKEYS_FLAGS = L"Flags";
108static const WCHAR* VAL_MOUSEKEYS_MAX = L"MaximumSpeed";
109static const WCHAR* VAL_MOUSEKEYS_TIMETOMAX = L"TimeToMaximumSpeed";
110
113static
114INT
115SpiLoadDWord(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
116{
118 if (!RegReadUserSetting(pwszKey, pwszValue, REG_DWORD, &Result, sizeof(Result)))
119 {
120 return iValue;
121 }
122 return Result;
123}
124
125static
126INT
127SpiLoadInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
128{
129 WCHAR awcBuffer[12];
130 ULONG cbSize;
131
132 cbSize = sizeof(awcBuffer);
133 if (!RegReadUserSetting(pwszKey, pwszValue, REG_SZ, awcBuffer, cbSize))
134 {
135 return iValue;
136 }
137 return _wtoi(awcBuffer);
138}
139
140static
141DWORD
143{
145 if (!RegReadUserSetting(KEY_DESKTOP, VAL_USERPREFMASK, REG_BINARY, &Result, sizeof(Result)))
146 {
147 return dValue;
148 }
149 return Result;
150}
151
152static
153DWORD
155{ // Must have the string!
156 WCHAR szApplicationName[MAX_PATH];
157 RtlZeroMemory(&szApplicationName, sizeof(szApplicationName));
158 if (!RegReadUserSetting(KEY_DESKTOP, VAL_SCRNSV, REG_SZ, &szApplicationName, sizeof(szApplicationName)))
159 {
160 return 0;
161 }
162 if (szApplicationName[0] == 0) return 0;
163 return SpiLoadInt(KEY_DESKTOP, VAL_SCRTO, 600);
164}
165
166static
167INT
168SpiLoadMouse(PCWSTR pwszValue, INT iValue)
169{
170 return SpiLoadInt(KEY_MOUSE, pwszValue, iValue);
171}
172
173static
174INT
175SpiLoadMetric(PCWSTR pwszValue, INT iValue)
176{
177 INT iRegVal;
178
179 iRegVal = SpiLoadInt(KEY_METRIC, pwszValue, METRIC2REG(iValue));
180 TRACE("Loaded metric setting '%S', iValue=%d(reg:%d), ret=%d(reg:%d)\n",
181 pwszValue, iValue, METRIC2REG(iValue), REG2METRIC(iRegVal), iRegVal);
182 return REG2METRIC(iRegVal);
183}
184
185static
186VOID
188{
189 BOOL bResult;
190
191 bResult = RegReadUserSetting(KEY_METRIC,
194 plfOut,
195 sizeof(LOGFONTW));
196 if (!bResult)
197 *plfOut = *plfDefault;
198}
199
200static
201VOID
203{
204 /* Fixup values */
205 gspv.ncm.iCaptionWidth = max(gspv.ncm.iCaptionWidth, 8);
206 gspv.ncm.iBorderWidth = max(gspv.ncm.iBorderWidth, 1);
207 gspv.ncm.iScrollWidth = max(gspv.ncm.iScrollWidth, 8);
208 gspv.ncm.iScrollHeight = max(gspv.ncm.iScrollHeight, 8);
209// gspv.ncm.iMenuHeight = max(gspv.ncm.iMenuHeight, gspv.tmMenuFont.tmHeight);
210// gspv.ncm.iMenuHeight = max(gspv.ncm.iMenuHeight,
211// 2 + gspv.tmMenuFont.tmHeight +
212// gspv.tmMenuFont.tmExternalLeading);
213 if (gspv.iDblClickTime == 0) gspv.iDblClickTime = 500;
214
215 // FIXME: Hack!!!
218
221
222}
223
224static
225VOID
227{
228 static LOGFONTW lf1 = {-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE,
230 VARIABLE_PITCH | FF_SWISS, L"MS Sans Serif"};
231 static LOGFONTW lf2 = {-11, 0, 0, 0, FW_BOLD, FALSE, FALSE,
233 VARIABLE_PITCH | FF_SWISS, L"MS Sans Serif"};
234
235 TRACE("Enter SpiUpdatePerUserSystemParameters\n");
236
237 /* Clear the structure */
238 RtlZeroMemory(&gspv, sizeof(gspv));
239
240 /* Load mouse settings */
254
255 /* Load keyboard settings */
258
259 /* Load NONCLIENTMETRICS */
260 gspv.ncm.cbSize = sizeof(NONCLIENTMETRICSW);
261 gspv.ncm.iBorderWidth = SpiLoadMetric(VAL_BORDER, 1);
262 gspv.ncm.iScrollWidth = SpiLoadMetric(L"ScrollWidth", 16);
263 gspv.ncm.iScrollHeight = SpiLoadMetric(L"ScrollHeight", 16);
264 gspv.ncm.iCaptionWidth = SpiLoadMetric(L"CaptionWidth", 19);
265 gspv.ncm.iCaptionHeight = SpiLoadMetric(L"CaptionHeight", 19);
266 gspv.ncm.iSmCaptionWidth = SpiLoadMetric(L"SmCaptionWidth", 12);
267 gspv.ncm.iSmCaptionHeight = SpiLoadMetric(L"SmCaptionHeight", 15);
268 gspv.ncm.iMenuWidth = SpiLoadMetric(L"MenuWidth", 18);
269 gspv.ncm.iMenuHeight = SpiLoadMetric(L"MenuHeight", 18);
270#if (WINVER >= 0x0600)
271 gspv.ncm.iPaddedBorderWidth = SpiLoadMetric(L"PaddedBorderWidth", 18);
272#endif
273 SpiLoadFont(&gspv.ncm.lfCaptionFont, L"CaptionFont", &lf2);
274 SpiLoadFont(&gspv.ncm.lfSmCaptionFont, L"SmCaptionFont", &lf1);
275 SpiLoadFont(&gspv.ncm.lfMenuFont, L"MenuFont", &lf1);
276 SpiLoadFont(&gspv.ncm.lfStatusFont, L"StatusFont", &lf1);
277 SpiLoadFont(&gspv.ncm.lfMessageFont, L"MessageFont", &lf1);
278
279 /* Load MINIMIZEDMETRICS */
280 gspv.mm.cbSize = sizeof(MINIMIZEDMETRICS);
281 gspv.mm.iWidth = SpiLoadMetric(L"MinWidth", 160);
282 gspv.mm.iHorzGap = SpiLoadMetric(L"MinHorzGap", 160);
283 gspv.mm.iVertGap = SpiLoadMetric(L"MinVertGap", 24);
284 gspv.mm.iArrange = SpiLoadInt(KEY_METRIC, L"MinArrange", ARW_HIDE);
285
286 /* Load ICONMETRICS */
287 gspv.im.cbSize = sizeof(ICONMETRICSW);
288 gspv.im.iHorzSpacing = SpiLoadMetric(VAL_ICONSPC, 64);
289 gspv.im.iVertSpacing = SpiLoadMetric(VAL_ICONVSPC, 64);
290 gspv.im.iTitleWrap = SpiLoadMetric(VAL_ITWRAP, 1);
291 SpiLoadFont(&gspv.im.lfFont, L"IconFont", &lf1);
292
293 /* Load desktop settings */
297 gpsi->dtCaretBlink = SpiLoadInt(KEY_DESKTOP, VAL_CARETRATE, 530);
306#if (_WIN32_WINNT >= 0x0600)
307 gspv.uiWheelScrollChars = SpiLoadInt(KEY_DESKTOP, VAL_SCRLLCHARS, 3);
308#endif
309
310 /* Some hardcoded values for now */
311
313 gspv.bBeep = TRUE;
317 gspv.dwMenuShowDelay = SpiLoadInt(KEY_DESKTOP, L"MenuShowDelay", 400);
319
323#if(WINVER >= 0x0600)
324 gspv.bScrSaverSecure = FALSE;
325#endif
326
328
332 gspv.mousekeys.cbSize = sizeof(MOUSEKEYS);
336 gspv.mousekeys.iCtrlSpeed = 8; // FIXME
342
345
346 /* Make sure we don't use broken values */
348
349 /* Update SystemMetrics */
350 InitMetrics();
351
352 if (gbSpiInitialized && gpsi)
353 {
358 }
359 gdwLanguageToggleKey = UserGetLanguageToggle(L"Language Hotkey", 1);
360 gdwLayoutToggleKey = UserGetLanguageToggle(L"Layout Hotkey", 2);
361}
362
363BOOL
365{
368 return TRUE;
369}
370
371
372BOOL
377{
378 BOOL bResult;
379
380 TRACE("Enter NtUserUpdatePerUserSystemParameters\n");
382
384 if(bEnable)
386 else
388 bResult = TRUE;
389
390 TRACE("Leave NtUserUpdatePerUserSystemParameters, returning %d\n", bResult);
391 UserLeave();
392
393 return bResult;
394}
395
396
399static
400VOID
402{
403 RegWriteUserSetting(pwszKey,
404 pwszValue,
405 REG_DWORD,
406 &Value,
407 sizeof(Value));
408}
409
410static
411VOID
412SpiStoreSz(PCWSTR pwszKey, PCWSTR pwszValue, PCWSTR pwsz)
413{
414 RegWriteUserSetting(pwszKey,
415 pwszValue,
416 REG_SZ,
417 pwsz,
418 (wcslen(pwsz) + 1) * sizeof(WCHAR));
419}
420
421static
422VOID
423SpiStoreSzInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
424{
425 WCHAR awcBuffer[15];
426
427 _itow(iValue, awcBuffer, 10);
428 RegWriteUserSetting(pwszKey,
429 pwszValue,
430 REG_SZ,
431 awcBuffer,
432 (wcslen(awcBuffer) + 1) * sizeof(WCHAR));
433}
434
435static
436VOID
437SpiStoreMetric(LPCWSTR pwszValue, INT iValue)
438{
439 SpiStoreSzInt(KEY_METRIC, pwszValue, METRIC2REG(iValue));
440}
441
442static
443VOID
444SpiStoreFont(PCWSTR pwszValue, LOGFONTW* plogfont)
445{
446 RegWriteUserSetting(KEY_METRIC,
447 pwszValue,
449 plogfont,
450 sizeof(LOGFONTW));
451}
452
453
456// FIXME: get rid of the flags and only use this from um. kernel can access data directly.
457static
459SpiMemCopy(PVOID pvDst, PVOID pvSrc, ULONG cbSize, BOOL bProtect)
460{
462
463 if (bProtect)
464 {
466 {
467 RtlCopyMemory(pvDst, pvSrc, cbSize);
468 }
470 {
472 }
473 _SEH2_END;
474 }
475 else
476 {
477 RtlCopyMemory(pvDst, pvSrc, cbSize);
478 }
479
480 if (!NT_SUCCESS(Status))
481 {
483 ERR("SpiMemCopy failed, pvDst=%p, pvSrc=%p, bProtect=%d\n", pvDst, pvSrc, bProtect);
484 }
485
486 return NT_SUCCESS(Status);
487}
488
489static inline
492{
494 return SpiMemCopy(pvParam, pvData, cbSize, fl & SPIF_PROTECT);
495}
496
497static inline
500{
502 return SpiMemCopy(pvData, pvParam, cbSize, fl & SPIF_PROTECT);
503}
504
505static inline
508{
510 /* Get the cbSite member from UM memory */
511 if (!SpiSet(&cbBufSize, pvParam, sizeof(ULONG), fl))
512 return 0;
513 /* Verify the correct size */
514 if (cbBufSize != cbSize)
515 return 0;
516 return SpiGet(pvParam, pvData, cbSize, fl);
517}
518
519static inline
521SpiGetInt(PVOID pvParam, PVOID piValue, FLONG fl)
522{
523 return SpiGet(pvParam, piValue, sizeof(INT), fl);
524}
525
526static inline
528SpiSetYesNo(BOOL *pbData, BOOL bValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
529{
531 *pbData = bValue ? TRUE : FALSE;
533 {
534 SpiStoreSz(pwszKey, pwszValue, bValue ? L"Yes" : L"No");
535 }
536 return (UINT_PTR)pwszKey;
537}
538
539static inline
541SpiSetBool(BOOL *pbData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
542{
544 *pbData = iValue ? TRUE : FALSE;
546 {
547 SpiStoreSzInt(pwszKey, pwszValue, iValue);
548 }
549 return (UINT_PTR)pwszKey;
550}
551
552static inline
554SpiSetDWord(PVOID pvData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
555{
557 *(INT*)pvData = iValue;
559 {
560 SpiStoreDWord(pwszKey, pwszValue, iValue);
561 }
562 return (UINT_PTR)pwszKey;
563}
564
565static inline
567SpiSetInt(PVOID pvData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
568{
570 *(INT*)pvData = iValue;
572 {
573 SpiStoreSzInt(pwszKey, pwszValue, iValue);
574 }
575 return (UINT_PTR)pwszKey;
576}
577
578static inline
581{
583 *(INT*)pvData = iValue;
585 {
586 SpiStoreMetric(pwszValue, iValue);
587 }
588 return (UINT_PTR)KEY_METRIC;
589}
590
591static inline
594{
595 DWORD dwRegMask;
596 BOOL bValue = PtrToUlong(pvValue);
597
599
600 /* Set or clear bit according to bValue */
601 gspv.dwUserPrefMask = bValue ? gspv.dwUserPrefMask | dwMask :
602 gspv.dwUserPrefMask & ~dwMask;
603
605 {
606 /* Read current value */
607 if (!RegReadUserSetting(KEY_DESKTOP,
610 &dwRegMask,
611 sizeof(DWORD)))
612 {
613 WARN("Failed to read UserPreferencesMask setting\n");
614 dwRegMask = 0;
615 }
616
617 /* Set or clear bit according to bValue */
618 dwRegMask = bValue ? (dwRegMask | dwMask) : (dwRegMask & ~dwMask);
619
620 /* write back value */
621 RegWriteUserSetting(KEY_DESKTOP,
624 &dwRegMask,
625 sizeof(DWORD));
626 }
627
628 return (UINT_PTR)KEY_DESKTOP;
629}
630
631static inline
634{
635 INT iValue = gspv.dwUserPrefMask & dwMask ? 1 : 0;
636 return SpiGetInt(pvParam, &iValue, fl);
637}
638
639static
642{
643 UNICODE_STRING ustr;
644 WCHAR awc[MAX_PATH];
645 BOOL bResult;
646 HBITMAP hbmp, hOldBitmap;
647 SURFACE *psurfBmp;
648 ULONG ulTile, ulStyle;
649
651
652 if (!pvParam)
653 {
654 /* FIXME: Reset Wallpaper to registry value */
655 return (UINT_PTR)KEY_DESKTOP;
656 }
657
658 /* Capture UNICODE_STRING */
659 bResult = SpiMemCopy(&ustr, pvParam, sizeof(ustr), fl & SPIF_PROTECT);
660 if (!bResult)
661 {
662 return 0;
663 }
664 if (ustr.Length > MAX_PATH * sizeof(WCHAR))
665 {
666 return 0;
667 }
668
669 /* Copy the string buffer name */
670 bResult = SpiMemCopy(gspv.awcWallpaper, ustr.Buffer, ustr.Length, fl & SPIF_PROTECT);
671 if (!bResult)
672 {
673 return 0;
674 }
675
676 /* Update the UNICODE_STRING */
680 gspv.awcWallpaper[ustr.Length / sizeof(WCHAR)] = 0;
681
682 TRACE("SpiSetWallpaper, name=%S\n", gspv.awcWallpaper);
683
684 /* Update registry */
686 {
688 }
689
690 /* Got a filename? */
691 if (gspv.awcWallpaper[0] != 0)
692 {
693 /* Convert file name to nt file name */
694 ustr.Buffer = awc;
695 ustr.MaximumLength = MAX_PATH * sizeof(WCHAR);
696 ustr.Length = 0;
698 {
699 ERR("RtlDosPathNameToNtPathName_U failed\n");
700 return 0;
701 }
702
703 /* Load the Bitmap */
704 hbmp = UserLoadImage(ustr.Buffer);
705 if (!hbmp)
706 {
707 ERR("UserLoadImage failed\n");
708 return 0;
709 }
710
711 /* Try to get the size of the wallpaper */
712 if (!(psurfBmp = SURFACE_ShareLockSurface(hbmp)))
713 {
715 return 0;
716 }
717
721
723
724 /* Change the bitmap's ownership */
726
727 /* Yes, Windows really loads the current setting from the registry. */
728 ulTile = SpiLoadInt(KEY_DESKTOP, L"TileWallpaper", 0);
729 ulStyle = SpiLoadInt(KEY_DESKTOP, L"WallpaperStyle", 0);
730 TRACE("SpiSetWallpaper: ulTile=%lu, ulStyle=%lu\n", ulTile, ulStyle);
731
732 /* Check the values we found in the registry */
733 if (ulTile && !ulStyle)
734 {
736 }
737 else if (!ulTile && ulStyle)
738 {
739 if (ulStyle == 2)
740 {
742 }
743 else if (ulStyle == 6)
744 {
746 }
747 else if (ulStyle == 10)
748 {
750 }
751 }
752 }
753 else
754 {
755 /* Remove wallpaper */
756 gspv.cxWallpaper = 0;
757 gspv.cyWallpaper = 0;
758 hbmp = 0;
759 }
760
761 /* Take care of the old wallpaper, if any */
762 hOldBitmap = gspv.hbmWallpaper;
763 if(hOldBitmap != NULL)
764 {
765 /* Delete the old wallpaper */
767 GreDeleteObject(hOldBitmap);
768 }
769
770 /* Set the new wallpaper */
772
774
775
776 return (UINT_PTR)KEY_DESKTOP;
777}
778
779static BOOL
781{
782 PWND pwndDesktop, pwndCurrent;
783 HWND *ahwnd;
785 int i;
786
787 pwndDesktop = UserGetDesktopWindow();
788 ASSERT(pwndDesktop);
789
790 ahwnd = IntWinListChildren(pwndDesktop);
791 if(!ahwnd)
792 return FALSE;
793
794 for (i = 0; ahwnd[i]; i++)
795 {
796 pwndCurrent = UserGetWindowObject(ahwnd[i]);
797 if(!pwndCurrent)
798 continue;
799
800 UserRefObjectCo(pwndCurrent, &Ref);
801 co_WinPosSetWindowPos(pwndCurrent, 0, pwndCurrent->rcWindow.left,pwndCurrent->rcWindow.top,
802 pwndCurrent->rcWindow.right-pwndCurrent->rcWindow.left
803 ,pwndCurrent->rcWindow.bottom - pwndCurrent->rcWindow.top,
806 UserDerefObjectCo(pwndCurrent);
807 }
808
810
811 return TRUE;
812}
813
814static
816SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
817{
818 switch (uiAction)
819 {
820 case SPI_GETBEEP:
821 return SpiGetInt(pvParam, &gspv.bBeep, fl);
822
823 case SPI_SETBEEP:
824 return SpiSetYesNo(&gspv.bBeep, uiParam, KEY_SOUND, VAL_BEEP, fl);
825
826 case SPI_GETMOUSE:
827 return SpiGet(pvParam, &gspv.caiMouse, 3 * sizeof(INT), fl);
828
829 case SPI_SETMOUSE:
830 if (!SpiSet(&gspv.caiMouse, pvParam, 3 * sizeof(INT), fl))
831 return 0;
833 {
837 }
838 return (UINT_PTR)KEY_MOUSE;
839
840 case SPI_GETBORDER:
841 return SpiGetInt(pvParam, &gspv.ncm.iBorderWidth, fl);
842
843 case SPI_SETBORDER:
844 uiParam = max(uiParam, 1);
845 return SpiSetInt(&gspv.ncm.iBorderWidth, uiParam, KEY_METRIC, VAL_BORDER, fl);
846
848 return SpiGetInt(pvParam, &gspv.dwKbdSpeed, fl);
849
851 return SpiSetInt(&gspv.dwKbdSpeed, uiParam, KEY_KBD, VAL_KBDSPD, fl);
852
853 case SPI_LANGDRIVER:
854 ERR("SPI_LANGDRIVER is unimplemented\n");
855 break;
856
858 return SpiGetInt(pvParam, &gspv.iScrSaverTimeout, fl);
859
862
864 return SpiGetInt(pvParam, &gspv.bScrSaverActive, fl);
865
868
870 return SpiGetInt(pvParam, &gspv.uiGridGranularity, fl);
871
874
876 uiParam = min(uiParam, gspv.ustrWallpaper.Length + 1UL);
877 return SpiGet(pvParam, gspv.awcWallpaper, uiParam, fl);
878
880 return SpiSetWallpaper(pvParam, fl);
881
883 ERR("SPI_SETDESKPATTERN is unimplemented\n");
884 break;
885
887 return SpiGetInt(pvParam, &gspv.iKbdDelay, fl);
888
890 return SpiSetInt(&gspv.iKbdDelay, uiParam, KEY_KBD, VAL_KBDDELAY, fl);
891
893 if (pvParam)
894 {
895 return SpiGetInt(pvParam, &gspv.im.iHorzSpacing, fl);
896 }
897 uiParam = max(uiParam, 32);
898 return SpiSetMetric(&gspv.im.iHorzSpacing, uiParam, VAL_ICONSPC, fl);
899
901 if (pvParam)
902 {
903 return SpiGetInt(pvParam, &gspv.im.iVertSpacing, fl);
904 }
905 uiParam = max(uiParam, 32);
906 return SpiSetMetric(&gspv.im.iVertSpacing, uiParam, VAL_ICONVSPC, fl);
907
909 return SpiGetInt(pvParam, &gspv.im.iTitleWrap, fl);
910
912 return SpiSetInt(&gspv.im.iTitleWrap, uiParam, KEY_METRIC, VAL_ITWRAP, fl);
913
915 return SpiGetInt(pvParam, &gspv.bMenuDropAlign, fl);
916
919
922
925
927 return SpiGet(pvParam, &gspv.im.lfFont, sizeof(LOGFONTW), fl);
928
930 if (!SpiSet(&gspv.im.lfFont, pvParam, sizeof(LOGFONTW), fl))
931 return 0;
933 {
934 SpiStoreFont(L"IconFont", &gspv.im.lfFont);
935 }
936 return (UINT_PTR)KEY_METRIC;
937
940
942 return SpiSetInt(&gspv.bMouseBtnSwap, uiParam, KEY_MOUSE, VAL_SWAP, fl);
943
945 return SpiGetInt(pvParam, &gspv.bFastTaskSwitch, fl);
946
948 /* According to Winetest this one is unimplemented */
949 return 1;
950
951 case SPI_GETDRAGFULLWINDOWS:
952 return SpiGetInt(pvParam, &gspv.bDragFullWindows, fl);
953
954 case SPI_SETDRAGFULLWINDOWS:
956
957 case SPI_GETNONCLIENTMETRICS:
958 {
959 return SpiGet(pvParam, &gspv.ncm, sizeof(NONCLIENTMETRICSW), fl);
960 }
961
962 case SPI_SETNONCLIENTMETRICS:
963 {
964 LPNONCLIENTMETRICSW metrics = (LPNONCLIENTMETRICSW)pvParam;
965
966 /* Fixup user's structure size */
967 metrics->cbSize = sizeof(NONCLIENTMETRICSW);
968
969 if (!SpiSet(&gspv.ncm, metrics, sizeof(NONCLIENTMETRICSW), fl))
970 return 0;
971
973 {
974 SpiStoreMetric(VAL_BORDER, gspv.ncm.iBorderWidth);
975 SpiStoreMetric(L"ScrollWidth", gspv.ncm.iScrollWidth);
976 SpiStoreMetric(L"ScrollHeight", gspv.ncm.iScrollHeight);
977 SpiStoreMetric(L"CaptionWidth", gspv.ncm.iCaptionWidth);
978 SpiStoreMetric(L"CaptionHeight", gspv.ncm.iCaptionHeight);
979 SpiStoreMetric(L"SmCaptionWidth", gspv.ncm.iSmCaptionWidth);
980 SpiStoreMetric(L"SmCaptionHeight", gspv.ncm.iSmCaptionHeight);
981 SpiStoreMetric(L"MenuWidth", gspv.ncm.iMenuWidth);
982 SpiStoreMetric(L"MenuHeight", gspv.ncm.iMenuHeight);
983#if (WINVER >= 0x0600)
984 SpiStoreMetric(L"PaddedBorderWidth", gspv.ncm.iPaddedBorderWidth);
985#endif
986 SpiStoreFont(L"CaptionFont", &gspv.ncm.lfCaptionFont);
987 SpiStoreFont(L"SmCaptionFont", &gspv.ncm.lfSmCaptionFont);
988 SpiStoreFont(L"MenuFont", &gspv.ncm.lfMenuFont);
989 SpiStoreFont(L"StatusFont", &gspv.ncm.lfStatusFont);
990 SpiStoreFont(L"MessageFont", &gspv.ncm.lfMessageFont);
991 }
992
994 return 0;
995
996 return (UINT_PTR)KEY_METRIC;
997 }
998
999 case SPI_GETMINIMIZEDMETRICS:
1000 {
1001 return SpiGet(pvParam, &gspv.mm, sizeof(MINIMIZEDMETRICS), fl);
1002 }
1003
1004 case SPI_SETMINIMIZEDMETRICS:
1005 {
1007
1008 /* Fixup user's structure size */
1009 metrics->cbSize = sizeof(MINIMIZEDMETRICS);
1010
1011 if (!SpiSet(&gspv.mm, metrics, sizeof(MINIMIZEDMETRICS), fl))
1012 return 0;
1013
1014 gspv.mm.iWidth = max(0, gspv.mm.iWidth);
1017 gspv.mm.iArrange = gspv.mm.iArrange & 0xf;
1018
1019 if (fl & SPIF_UPDATEINIFILE)
1020 {
1021 SpiStoreMetric(L"MinWidth", gspv.mm.iWidth);
1022 SpiStoreMetric(L"MinHorzGap", gspv.mm.iHorzGap);
1023 SpiStoreMetric(L"MinVertGap", gspv.mm.iVertGap);
1024 SpiStoreMetric(L"MinArrange", gspv.mm.iArrange);
1025 }
1026
1027 return (UINT_PTR)KEY_METRIC;
1028 }
1029
1030 case SPI_GETICONMETRICS:
1031 {
1032 return SpiGet(pvParam, &gspv.im, sizeof(ICONMETRICSW), fl);
1033 }
1034
1035 case SPI_SETICONMETRICS:
1036 {
1037 LPICONMETRICSW metrics = (LPICONMETRICSW)pvParam;
1038
1039 /* Fixup user's structure size */
1040 metrics->cbSize = sizeof(ICONMETRICSW);
1041
1042 if (!SpiSet(&gspv.im, metrics, sizeof(ICONMETRICSW), fl))
1043 return 0;
1044
1045 if (fl & SPIF_UPDATEINIFILE)
1046 {
1047 SpiStoreMetric(VAL_ICONSPC, gspv.im.iHorzSpacing);
1048 SpiStoreMetric(VAL_ICONVSPC, gspv.im.iVertSpacing);
1049 SpiStoreMetric(VAL_ITWRAP, gspv.im.iTitleWrap);
1050 SpiStoreFont(L"IconFont", &gspv.im.lfFont);
1051 }
1052 return (UINT_PTR)KEY_METRIC;
1053 }
1054
1055 case SPI_GETWORKAREA:
1056 {
1057 PMONITOR pmonitor = UserGetPrimaryMonitor();
1058
1059 if(!pmonitor)
1060 return 0;
1061
1062 return SpiGet(pvParam, &pmonitor->rcWork, sizeof(RECTL), fl);
1063 }
1064
1065 case SPI_SETWORKAREA:
1066 {
1067 PMONITOR pmonitor;
1068 RECTL rcWorkArea, rcIntersect;
1069
1070 if (!pvParam)
1071 return 0;
1072
1073 RtlCopyMemory(&rcWorkArea, pvParam, sizeof(rcWorkArea));
1074
1075 /* fail if empty */
1076 if (RECTL_bIsEmptyRect(&rcWorkArea))
1077 return 0;
1078
1079 /* get the nearest monitor */
1080 pmonitor = UserMonitorFromRect(&rcWorkArea, MONITOR_DEFAULTTONEAREST);
1081 if (!pmonitor)
1082 return 0;
1083
1084 /* fail unless work area is completely in monitor */
1085 if (!RECTL_bIntersectRect(&rcIntersect, &pmonitor->rcMonitor, &rcWorkArea) ||
1086 !RtlEqualMemory(&rcIntersect, &rcWorkArea, sizeof(rcIntersect)))
1087 {
1088 return 0;
1089 }
1090
1091 if (!SpiSet(&pmonitor->rcWork, pvParam, sizeof(RECTL), fl))
1092 return 0;
1093
1094 if (fl & SPIF_UPDATEINIFILE)
1095 {
1096 // FIXME: What to do?
1097 }
1098 return (UINT_PTR)KEY_DESKTOP;
1099 }
1100
1101 case SPI_SETPENWINDOWS:
1102 ERR("SPI_SETPENWINDOWS is unimplemented\n");
1103 break;
1104
1105 case SPI_GETFILTERKEYS:
1106 {
1107 LPFILTERKEYS FilterKeys = (LPFILTERKEYS)pvParam;
1108
1109 if (uiParam != 0 && uiParam != sizeof(FILTERKEYS))
1110 return 0;
1111
1112 if (!FilterKeys || FilterKeys->cbSize != sizeof(FILTERKEYS))
1113 return 0;
1114
1115 return SpiGet(pvParam, &gspv.filterkeys, sizeof(FILTERKEYS), fl);
1116 }
1117
1118 case SPI_SETFILTERKEYS:
1119 {
1120 LPFILTERKEYS FilterKeys = (LPFILTERKEYS)pvParam;
1121
1122 if (uiParam != 0 && uiParam != sizeof(FILTERKEYS))
1123 return 0;
1124
1125 if (!FilterKeys || FilterKeys->cbSize != sizeof(FILTERKEYS))
1126 return 0;
1127
1128 if (!SpiSet(&gspv.filterkeys, pvParam, sizeof(FILTERKEYS), fl))
1129 return 0;
1130
1131 if (fl & SPIF_UPDATEINIFILE)
1132 {
1133 // FIXME: What to do?
1134 }
1135 return (UINT_PTR)KEY_DESKTOP;
1136 }
1137
1138 case SPI_GETTOGGLEKEYS:
1139 {
1140 LPTOGGLEKEYS ToggleKeys = (LPTOGGLEKEYS)pvParam;
1141
1142 if (uiParam != 0 && uiParam != sizeof(TOGGLEKEYS))
1143 return 0;
1144
1145 if (!ToggleKeys || ToggleKeys->cbSize != sizeof(TOGGLEKEYS))
1146 return 0;
1147
1148 return SpiGet(pvParam, &gspv.togglekeys, sizeof(TOGGLEKEYS), fl);
1149 }
1150
1151 case SPI_SETTOGGLEKEYS:
1152 {
1153 LPTOGGLEKEYS ToggleKeys = (LPTOGGLEKEYS)pvParam;
1154
1155 if (uiParam != 0 && uiParam != sizeof(TOGGLEKEYS))
1156 return 0;
1157
1158 if (!ToggleKeys || ToggleKeys->cbSize != sizeof(TOGGLEKEYS))
1159 return 0;
1160
1161 if (!SpiSet(&gspv.togglekeys, pvParam, sizeof(TOGGLEKEYS), fl))
1162 return 0;
1163
1164 if (fl & SPIF_UPDATEINIFILE)
1165 {
1166 // FIXME: What to do?
1167 }
1168 return (UINT_PTR)KEY_DESKTOP;
1169 }
1170
1171 case SPI_GETMOUSEKEYS:
1172 {
1173 LPMOUSEKEYS MouseKeys = (LPMOUSEKEYS)pvParam;
1174
1175 if (uiParam != 0 && uiParam != sizeof(MOUSEKEYS))
1176 return 0;
1177
1178 if (!MouseKeys || MouseKeys->cbSize != sizeof(MOUSEKEYS))
1179 return 0;
1180
1181 return SpiGet(pvParam, &gspv.mousekeys, sizeof(MOUSEKEYS), fl);
1182 }
1183
1184 case SPI_SETMOUSEKEYS:
1185 {
1186 LPMOUSEKEYS MouseKeys = (LPMOUSEKEYS)pvParam;
1187
1188 if (uiParam != 0 && uiParam != sizeof(MOUSEKEYS))
1189 return 0;
1190
1191 if (!MouseKeys || MouseKeys->cbSize != sizeof(MOUSEKEYS))
1192 return 0;
1193
1194 if (!SpiSet(&gspv.mousekeys, pvParam, sizeof(MOUSEKEYS), fl))
1195 return 0;
1196
1197 if (fl & SPIF_UPDATEINIFILE)
1198 {
1202 }
1203 return (UINT_PTR)KEY_DESKTOP;
1204 }
1205
1206 case SPI_GETSHOWSOUNDS:
1207 return SpiGetInt(pvParam, &gspv.bShowSounds, fl);
1208
1209 case SPI_SETSHOWSOUNDS:
1210 return SpiSetBool(&gspv.bShowSounds, uiParam, KEY_SHOWSNDS, VAL_ON, fl);
1211
1212 case SPI_GETSTICKYKEYS:
1213 {
1214 LPSTICKYKEYS StickyKeys = (LPSTICKYKEYS)pvParam;
1215
1216 if (uiParam != 0 && uiParam != sizeof(STICKYKEYS))
1217 return 0;
1218
1219 if (!StickyKeys || StickyKeys->cbSize != sizeof(STICKYKEYS))
1220 return 0;
1221
1222 return SpiGetEx(pvParam, &gspv.stickykeys, sizeof(STICKYKEYS), fl);
1223 }
1224
1225 case SPI_SETSTICKYKEYS:
1226 {
1227 LPSTICKYKEYS StickyKeys = (LPSTICKYKEYS)pvParam;
1228
1229 if (uiParam != 0 && uiParam != sizeof(STICKYKEYS))
1230 return 0;
1231
1232 if (!StickyKeys || StickyKeys->cbSize != sizeof(STICKYKEYS))
1233 return 0;
1234
1235 if (!SpiSet(&gspv.stickykeys, pvParam, sizeof(STICKYKEYS), fl))
1236 return 0;
1237
1238 if (fl & SPIF_UPDATEINIFILE)
1239 {
1240 // FIXME: What to do?
1241 }
1242 return (UINT_PTR)KEY_DESKTOP;
1243 }
1244
1246 {
1247 LPACCESSTIMEOUT AccessTimeout = (LPACCESSTIMEOUT)pvParam;
1248
1249 if (uiParam != 0 && uiParam != sizeof(ACCESSTIMEOUT))
1250 return 0;
1251
1252 if (!AccessTimeout || AccessTimeout->cbSize != sizeof(ACCESSTIMEOUT))
1253 return 0;
1254
1255 return SpiGetEx(pvParam, &gspv.accesstimeout, sizeof(ACCESSTIMEOUT), fl);
1256 }
1257
1259 {
1260 LPACCESSTIMEOUT AccessTimeout = (LPACCESSTIMEOUT)pvParam;
1261
1262 if (uiParam != 0 && uiParam != sizeof(ACCESSTIMEOUT))
1263 {
1264 return 0;
1265 }
1266
1267 if (!AccessTimeout || AccessTimeout->cbSize != sizeof(ACCESSTIMEOUT))
1268 {
1269 return 0;
1270 }
1271
1272 if (!SpiSet(&gspv.accesstimeout, pvParam, sizeof(ACCESSTIMEOUT), fl))
1273 return 0;
1274
1275 if (fl & SPIF_UPDATEINIFILE)
1276 {
1277 // FIXME: What to do?
1278 }
1279 return (UINT_PTR)KEY_DESKTOP;
1280 }
1281
1282 case SPI_GETSERIALKEYS:
1283 {
1284 LPSERIALKEYS SerialKeys = (LPSERIALKEYS)pvParam;
1285
1286 if (uiParam != 0 && uiParam != sizeof(SERIALKEYS))
1287 return 0;
1288
1289 if (!SerialKeys || SerialKeys->cbSize != sizeof(SERIALKEYS))
1290 return 0;
1291
1292 return SpiGet(pvParam, &gspv.serialkeys, sizeof(SERIALKEYS), fl);
1293 }
1294
1295 case SPI_SETSERIALKEYS:
1296 {
1297 LPSERIALKEYS SerialKeys = (LPSERIALKEYS)pvParam;
1298
1299 if (uiParam != 0 && uiParam != sizeof(SERIALKEYS))
1300 return 0;
1301
1302 if (!SerialKeys || SerialKeys->cbSize != sizeof(SERIALKEYS))
1303 return 0;
1304
1305 if (!SpiSet(&gspv.serialkeys, pvParam, sizeof(SERIALKEYS), fl))
1306 return 0;
1307
1308 if (fl & SPIF_UPDATEINIFILE)
1309 {
1310 // FIXME: What to do?
1311 }
1312 return (UINT_PTR)KEY_DESKTOP;
1313 }
1314
1315 case SPI_GETSOUNDSENTRY:
1316 {
1317 LPSOUNDSENTRYW SoundsEntry = (LPSOUNDSENTRYW)pvParam;
1318
1319 if (uiParam != 0 && uiParam != sizeof(SOUNDSENTRYW))
1320 return 0;
1321
1322 if (!SoundsEntry || SoundsEntry->cbSize != sizeof(SOUNDSENTRYW))
1323 return 0;
1324
1325 return SpiGet(pvParam, &gspv.soundsentry, sizeof(SOUNDSENTRYW), fl);
1326 }
1327
1328 case SPI_SETSOUNDSENTRY:
1329 {
1330 LPSOUNDSENTRYW SoundsEntry = (LPSOUNDSENTRYW)pvParam;
1331
1332 if (uiParam != 0 && uiParam != sizeof(SOUNDSENTRYW))
1333 return 0;
1334
1335 if (!SoundsEntry || SoundsEntry->cbSize != sizeof(SOUNDSENTRYW))
1336 return 0;
1337
1338 if (!SpiSet(&gspv.soundsentry, pvParam, sizeof(SOUNDSENTRYW), fl))
1339 return 0;
1340
1341 if (fl & SPIF_UPDATEINIFILE)
1342 {
1343 // FIXME: What to do?
1344 }
1345 return (UINT_PTR)KEY_DESKTOP;
1346 }
1347
1348 case SPI_GETHIGHCONTRAST:
1349 {
1350 LPHIGHCONTRASTW highcontrast = (LPHIGHCONTRASTW)pvParam;
1351
1352 if (uiParam != 0 && uiParam != sizeof(HIGHCONTRASTW))
1353 return 0;
1354
1355 if (!highcontrast || highcontrast->cbSize != sizeof(HIGHCONTRASTW))
1356 return 0;
1357
1358 return SpiGet(pvParam, &gspv.highcontrast, sizeof(HIGHCONTRASTW), fl);
1359 }
1360
1361 case SPI_SETHIGHCONTRAST:
1362 {
1363 LPHIGHCONTRASTW highcontrast = (LPHIGHCONTRASTW)pvParam;
1364
1365 if (uiParam != 0 && uiParam != sizeof(HIGHCONTRASTW))
1366 return 0;
1367
1368 if (!highcontrast || highcontrast->cbSize != sizeof(HIGHCONTRASTW))
1369 return 0;
1370
1371 if (!SpiSet(&gspv.highcontrast, pvParam, sizeof(HIGHCONTRASTW), fl))
1372 return 0;
1373
1374 if (fl & SPIF_UPDATEINIFILE)
1375 {
1376 // FIXME: What to do?
1377 }
1378 return (UINT_PTR)KEY_DESKTOP;
1379 }
1380
1381 case SPI_GETKEYBOARDPREF:
1382 return SpiGetInt(pvParam, &gspv.bKbdPref, fl);
1383
1384 case SPI_SETKEYBOARDPREF:
1385 return SpiSetBool(&gspv.bKbdPref, uiParam, KEY_KDBPREF, VAL_ON, fl);
1386
1387 case SPI_GETSCREENREADER:
1388 return SpiGetInt(pvParam, &gspv.bScreenReader, fl);
1389
1390 case SPI_SETSCREENREADER:
1391 return SpiSetBool(&gspv.bScreenReader, uiParam, KEY_SCRREAD, VAL_ON, fl);
1392
1393 case SPI_GETANIMATION:
1394 return SpiGet(pvParam, &gspv.animationinfo, sizeof(ANIMATIONINFO), fl);
1395
1396 case SPI_SETANIMATION:
1397 if (!SpiSet(&gspv.animationinfo, pvParam, sizeof(ANIMATIONINFO), fl))
1398 return 0;
1399 if (fl & SPIF_UPDATEINIFILE)
1400 {
1401 // FIXME: What to do?
1402 }
1403 return (UINT_PTR)KEY_DESKTOP;
1404
1405 case SPI_GETFONTSMOOTHING:
1406 return SpiGetInt(pvParam, &gspv.bFontSmoothing, fl);
1407
1408 case SPI_SETFONTSMOOTHING:
1409 gspv.bFontSmoothing = !!uiParam;
1410 if (fl & SPIF_UPDATEINIFILE)
1411 {
1413 }
1414 return (UINT_PTR)KEY_DESKTOP;
1415
1416 case SPI_SETDRAGWIDTH:
1417 return SpiSetInt(&gspv.iDragWidth, uiParam, KEY_DESKTOP, VAL_DRAGWIDTH, fl);
1418
1419 case SPI_SETDRAGHEIGHT:
1421
1422 case SPI_SETHANDHELD:
1423 return SpiSetBool(&gspv.bHandHeld, uiParam, KEY_DESKTOP, L"HandHeld", fl);
1424
1425 case SPI_GETLOWPOWERTIMEOUT:
1426 return SpiGetInt(pvParam, &gspv.iLowPwrTimeout, fl);
1427
1428 case SPI_GETPOWEROFFTIMEOUT:
1429 return SpiGetInt(pvParam, &gspv.iPwrOffTimeout, fl);
1430
1431 case SPI_SETLOWPOWERTIMEOUT:
1432 return SpiSetInt(&gspv.iLowPwrTimeout, uiParam, KEY_DESKTOP, L"LowPowerTimeOut", fl);
1433
1434 case SPI_SETPOWEROFFTIMEOUT:
1435 return SpiSetInt(&gspv.iPwrOffTimeout, uiParam, KEY_DESKTOP, L"PowerOffTimeOut", fl);
1436
1437 case SPI_GETLOWPOWERACTIVE:
1438 return SpiGetInt(pvParam, &gspv.iPwrOffTimeout, fl);
1439
1440 case SPI_GETPOWEROFFACTIVE:
1441 return SpiGetInt(pvParam, &gspv.bPwrOffActive, fl);
1442
1443 case SPI_SETLOWPOWERACTIVE:
1444 return SpiSetBool(&gspv.bLowPwrActive, uiParam, KEY_DESKTOP, L"LowPowerActive", fl);
1445
1446 case SPI_SETPOWEROFFACTIVE:
1447 return SpiSetBool(&gspv.bPwrOffActive, uiParam, KEY_DESKTOP, L"PowerOffActive", fl);
1448
1449 case SPI_SETCURSORS:
1450 ERR("SPI_SETCURSORS is unimplemented\n");
1451 break;
1452
1453 case SPI_SETICONS:
1454 ERR("SPI_SETICONS is unimplemented\n");
1455 break;
1456
1457 case SPI_GETDEFAULTINPUTLANG:
1458 if (!gspklBaseLayout)
1459 return FALSE;
1460
1461 return SpiGet(pvParam, &gspklBaseLayout->hkl, sizeof(HKL), fl);
1462
1463 case SPI_SETDEFAULTINPUTLANG:
1464 {
1465 HKL hkl;
1466
1467 /* Note: SPIF_UPDATEINIFILE is not supported */
1468 if ((fl & SPIF_UPDATEINIFILE) || !SpiSet(&hkl, pvParam, sizeof(hkl), fl))
1469 return FALSE;
1470
1472 }
1473
1474 case SPI_SETLANGTOGGLE:
1475 gdwLayoutToggleKey = UserGetLanguageToggle(L"Layout Hotkey", 2);
1476 gdwLanguageToggleKey = UserGetLanguageToggle(L"Language Hotkey", 1);
1477 return gdwLanguageToggleKey;
1478
1479 case SPI_GETWINDOWSEXTENSION:
1480 ERR("SPI_GETWINDOWSEXTENSION is unimplemented\n");
1481 break;
1482
1483 case SPI_GETMOUSETRAILS:
1484 return SpiGetInt(pvParam, &gspv.iMouseTrails, fl);
1485
1486 case SPI_SETMOUSETRAILS:
1488
1489 case SPI_GETSNAPTODEFBUTTON:
1490 return SpiGetInt(pvParam, &gspv.bSnapToDefBtn, fl);
1491
1492 case SPI_SETSNAPTODEFBUTTON:
1494
1495 case SPI_GETMOUSEHOVERWIDTH:
1496 return SpiGetInt(pvParam, &gspv.iMouseHoverWidth, fl);
1497
1498 case SPI_SETMOUSEHOVERWIDTH:
1500
1501 case SPI_GETMOUSEHOVERHEIGHT:
1502 return SpiGetInt(pvParam, &gspv.iMouseHoverHeight, fl);
1503
1504 case SPI_SETMOUSEHOVERHEIGHT:
1506
1507 case SPI_GETMOUSEHOVERTIME:
1508 return SpiGetInt(pvParam, &gspv.iMouseHoverTime, fl);
1509
1510 case SPI_SETMOUSEHOVERTIME:
1511 /* See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa
1512 * copy text from it, if some agument why xp and 2003 behovir diffent
1513 * only if they do not have SP install
1514 * " Windows Server 2003 and Windows XP: The operating system does not
1515 * enforce the use of USER_TIMER_MAXIMUM and USER_TIMER_MINIMUM until
1516 * Windows Server 2003 SP1 and Windows XP SP2 "
1517 */
1519
1520 case SPI_GETWHEELSCROLLLINES:
1521 return SpiGetInt(pvParam, &gspv.iWheelScrollLines, fl);
1522
1525
1526 case SPI_GETMENUSHOWDELAY:
1527 return SpiGetInt(pvParam, &gspv.dwMenuShowDelay, fl);
1528
1529 case SPI_SETMENUSHOWDELAY:
1530 return SpiSetInt(&gspv.dwMenuShowDelay, uiParam, KEY_DESKTOP, L"MenuShowDelay", fl);
1531
1532#if (_WIN32_WINNT >= 0x0600)
1534 return SpiGetInt(pvParam, &gspv.uiWheelScrollChars, fl);
1535
1536 case SPI_SETWHEELSCROLLCHARS:
1537 return SpiSetInt(&gspv.uiWheelScrollChars, uiParam, KEY_DESKTOP, VAL_SCRLLCHARS, fl);
1538#endif
1539 case SPI_GETSHOWIMEUI:
1540 return SpiGetInt(pvParam, &gspv.bShowImeUi, fl);
1541
1542 case SPI_SETSHOWIMEUI:
1543 return SpiSetBool(&gspv.bShowImeUi, uiParam, KEY_DESKTOP, L"", fl);
1544
1545 case SPI_GETMOUSESPEED:
1546 return SpiGetInt(pvParam, &gspv.iMouseSpeed, fl);
1547
1548 case SPI_SETMOUSESPEED:
1549 {
1550 /* Allowed range is [1:20] */
1551 if ((INT_PTR)pvParam < 1 || (INT_PTR)pvParam > 20)
1552 return 0;
1553 else
1555 }
1556
1557 case SPI_GETSCREENSAVERRUNNING:
1558 return SpiGetInt(pvParam, &gspv.bScrSaverRunning, fl);
1559
1560 case SPI_SETSCREENSAVERRUNNING:
1561 // FIXME: also return value?
1562 return SpiSetBool(&gspv.bScrSaverRunning, uiParam, KEY_MOUSE, L"", fl);
1563
1564#if(WINVER >= 0x0600)
1565 case SPI_GETAUDIODESCRIPTION:
1566 return SpiGet(pvParam, &gspv.audiodescription, sizeof(AUDIODESCRIPTION), fl);
1567
1568 case SPI_SETAUDIODESCRIPTION:
1569 ERR("SPI_SETAUDIODESCRIPTION is unimplemented\n");
1570 break;
1571
1572 case SPI_GETSCREENSAVESECURE:
1573 return SpiGetInt(pvParam, &gspv.bScrSaverSecure, fl);
1574
1575 case SPI_SETSCREENSAVESECURE:
1576 return SpiSetBool(&gspv.bScrSaverSecure, uiParam, KEY_DESKTOP, L"ScreenSaverIsSecure", fl);
1577#endif
1578
1579 case SPI_GETACTIVEWINDOWTRACKING:
1580 return SpiGetUserPref(UPM_ACTIVEWINDOWTRACKING, pvParam, fl);
1581
1582 case SPI_SETACTIVEWINDOWTRACKING:
1583 return SpiSetUserPref(UPM_ACTIVEWINDOWTRACKING, pvParam, fl);
1584
1585 case SPI_GETMENUANIMATION:
1586 return SpiGetUserPref(UPM_MENUANIMATION, pvParam, fl);
1587
1588 case SPI_SETMENUANIMATION:
1589 return SpiSetUserPref(UPM_MENUANIMATION, pvParam, fl);
1590
1591 case SPI_GETCOMBOBOXANIMATION:
1592 return SpiGetUserPref(UPM_COMBOBOXANIMATION, pvParam, fl);
1593
1594 case SPI_SETCOMBOBOXANIMATION:
1595 return SpiSetUserPref(UPM_COMBOBOXANIMATION, pvParam, fl);
1596
1597 case SPI_GETLISTBOXSMOOTHSCROLLING:
1599
1600 case SPI_SETLISTBOXSMOOTHSCROLLING:
1602
1603 case SPI_GETGRADIENTCAPTIONS:
1604 {
1606 {
1607 INT iValue = 0;
1608 return SpiGetInt(pvParam, &iValue, fl);
1609 }
1610 else
1611 {
1612 return SpiGetUserPref(UPM_GRADIENTCAPTIONS, pvParam, fl);
1613 }
1614 }
1615
1616 case SPI_SETGRADIENTCAPTIONS:
1617 return SpiSetUserPref(UPM_GRADIENTCAPTIONS, pvParam, fl);
1618
1619 case SPI_GETKEYBOARDCUES:
1620 return SpiGetUserPref(UPM_KEYBOARDCUES, pvParam, fl);
1621
1622 case SPI_SETKEYBOARDCUES:
1623 return SpiSetUserPref(UPM_KEYBOARDCUES, pvParam, fl);
1624
1625 case SPI_GETACTIVEWNDTRKZORDER:
1626 return SpiGetUserPref(UPM_ACTIVEWNDTRKZORDER, pvParam, fl);
1627
1628 case SPI_SETACTIVEWNDTRKZORDER:
1629 return SpiSetUserPref(UPM_ACTIVEWNDTRKZORDER, pvParam, fl);
1630
1631 case SPI_GETHOTTRACKING:
1632 return SpiGetUserPref(UPM_HOTTRACKING, pvParam, fl);
1633
1634 case SPI_SETHOTTRACKING:
1635 return SpiSetUserPref(UPM_HOTTRACKING, pvParam, fl);
1636
1637 case SPI_GETMENUFADE:
1638 return SpiGetUserPref(UPM_MENUFADE, pvParam, fl);
1639
1640 case SPI_SETMENUFADE:
1641 return SpiSetUserPref(UPM_MENUFADE, pvParam, fl);
1642
1643 case SPI_GETSELECTIONFADE:
1644 return SpiGetUserPref(UPM_SELECTIONFADE, pvParam, fl);
1645
1646 case SPI_SETSELECTIONFADE:
1647 return SpiSetUserPref(UPM_SELECTIONFADE, pvParam, fl);
1648
1649 case SPI_GETTOOLTIPANIMATION:
1650 return SpiGetUserPref(UPM_TOOLTIPANIMATION, pvParam, fl);
1651
1652 case SPI_SETTOOLTIPANIMATION:
1653 return SpiSetUserPref(UPM_TOOLTIPANIMATION, pvParam, fl);
1654
1655 case SPI_GETTOOLTIPFADE:
1656 return SpiGetUserPref(UPM_TOOLTIPFADE, pvParam, fl);
1657
1658 case SPI_SETTOOLTIPFADE:
1659 return SpiSetUserPref(UPM_TOOLTIPFADE, pvParam, fl);
1660
1661 case SPI_GETCURSORSHADOW:
1662 return SpiGetUserPref(UPM_CURSORSHADOW, pvParam, fl);
1663
1664 case SPI_SETCURSORSHADOW:
1666 return SpiSetUserPref(UPM_CURSORSHADOW, pvParam, fl);
1667
1668 case SPI_GETUIEFFECTS:
1669 return SpiGetUserPref(UPM_UIEFFECTS, pvParam, fl);
1670
1671 case SPI_SETUIEFFECTS:
1672 return SpiSetUserPref(UPM_UIEFFECTS, pvParam, fl);
1673
1674 case SPI_GETMOUSESONAR:
1675 return SpiGetInt(pvParam, &gspv.bMouseSonar, fl);
1676
1677 case SPI_SETMOUSESONAR:
1678 return SpiSetBool(&gspv.bMouseSonar, uiParam, KEY_MOUSE, L"", fl);
1679
1680 case SPI_GETMOUSECLICKLOCK:
1681 return SpiGetUserPref(UPM_CLICKLOCK, pvParam, fl);
1682
1683 case SPI_SETMOUSECLICKLOCK:
1684 gspv.bMouseClickLock = PtrToUlong(pvParam);
1685 return SpiSetUserPref(UPM_CLICKLOCK, pvParam, fl);
1686
1687 case SPI_GETMOUSEVANISH:
1688 return SpiGetInt(pvParam, &gspv.bMouseVanish, fl);
1689
1690 case SPI_SETMOUSEVANISH:
1691 return SpiSetBool(&gspv.bMouseVanish, uiParam, KEY_MOUSE, L"", fl);
1692
1693 case SPI_GETFLATMENU:
1694 return SpiGetUserPref(UPM_FLATMENU, pvParam, fl);
1695
1696 case SPI_SETFLATMENU:
1697 return SpiSetUserPref(UPM_FLATMENU, pvParam, fl);
1698
1699 case SPI_GETDROPSHADOW:
1700 return SpiGetUserPref(UPM_DROPSHADOW, pvParam, fl);
1701
1702 case SPI_SETDROPSHADOW:
1703 return SpiSetUserPref(UPM_DROPSHADOW, pvParam, fl);
1704
1705 case SPI_GETBLOCKSENDINPUTRESETS:
1706 return SpiGetInt(pvParam, &gspv.bBlockSendInputResets, fl);
1707
1708 case SPI_SETBLOCKSENDINPUTRESETS:
1709 return SpiSetBool(&gspv.bBlockSendInputResets, uiParam, KEY_MOUSE, L"", fl);
1710
1711#if(_WIN32_WINNT >= 0x0600)
1712 case SPI_GETDISABLEOVERLAPPEDCONTENT:
1713 return SpiGetInt(pvParam, &gspv.bDisableOverlappedContent, fl);
1714
1715 case SPI_SETDISABLEOVERLAPPEDCONTENT:
1716 return SpiSetBool(&gspv.bDisableOverlappedContent, uiParam, KEY_MOUSE, L"", fl);
1717
1718 case SPI_GETCLIENTAREAANIMATION:
1719 return SpiGetInt(pvParam, &gspv.bClientAreaAnimation, fl);
1720
1721 case SPI_SETCLIENTAREAANIMATION:
1722 return SpiSetBool(&gspv.bClientAreaAnimation, uiParam, KEY_MOUSE, L"", fl);
1723
1724 case SPI_GETCLEARTYPE:
1725 return SpiGetInt(pvParam, &gspv.bClearType, fl);
1726
1727 case SPI_SETCLEARTYPE:
1728 return SpiSetBool(&gspv.bClearType, uiParam, KEY_MOUSE, L"", fl);
1729
1730 case SPI_GETSPEECHRECOGNITION:
1731 return SpiGetInt(pvParam, &gspv.bSpeechRecognition, fl);
1732
1733 case SPI_SETSPEECHRECOGNITION:
1734 return SpiSetBool(&gspv.bSpeechRecognition, uiParam, KEY_MOUSE, L"", fl);
1735#endif
1736
1737 case SPI_GETFOREGROUNDLOCKTIMEOUT:
1738 return SpiGetInt(pvParam, &gspv.dwForegroundLockTimeout, fl);
1739
1740 case SPI_SETFOREGROUNDLOCKTIMEOUT:
1741 return SpiSetInt(&gspv.dwForegroundLockTimeout, uiParam, KEY_MOUSE, L"", fl);
1742
1743 case SPI_GETACTIVEWNDTRKTIMEOUT:
1744 return SpiGetInt(pvParam, &gspv.dwActiveTrackingTimeout, fl);
1745
1746 case SPI_SETACTIVEWNDTRKTIMEOUT:
1747 return SpiSetInt(&gspv.dwActiveTrackingTimeout, uiParam, KEY_MOUSE, L"", fl);
1748
1749 case SPI_GETFOREGROUNDFLASHCOUNT:
1750 return SpiGetInt(pvParam, &gspv.dwForegroundFlashCount, fl);
1751
1752 case SPI_SETFOREGROUNDFLASHCOUNT:
1753 return SpiSetInt(&gspv.dwForegroundFlashCount, uiParam, KEY_MOUSE, L"", fl);
1754
1755 case SPI_GETCARETWIDTH:
1756 return SpiGetInt(pvParam, &gspv.dwCaretWidth, fl);
1757
1758 case SPI_SETCARETWIDTH:
1760
1761 case SPI_GETMOUSECLICKLOCKTIME:
1762 return SpiGetInt(pvParam, &gspv.dwMouseClickLockTime, fl);
1763
1764 case SPI_SETMOUSECLICKLOCKTIME:
1766
1767 case SPI_GETFONTSMOOTHINGTYPE:
1768 return SpiGetInt(pvParam, &gspv.uiFontSmoothingType, fl);
1769
1770 case SPI_SETFONTSMOOTHINGTYPE:
1772
1773 case SPI_GETFONTSMOOTHINGCONTRAST:
1774 return SpiGetInt(pvParam, &gspv.uiFontSmoothingContrast, fl);
1775
1776 case SPI_SETFONTSMOOTHINGCONTRAST:
1778
1779 case SPI_GETFOCUSBORDERWIDTH:
1780 return SpiGetInt(pvParam, &gspv.uiFocusBorderWidth, fl);
1781
1782 case SPI_SETFOCUSBORDERWIDTH:
1783 return SpiSetInt(&gspv.uiFocusBorderWidth, uiParam, KEY_MOUSE, L"", fl);
1784
1785 case SPI_GETFOCUSBORDERHEIGHT:
1786 return SpiGetInt(pvParam, &gspv.uiFocusBorderHeight, fl);
1787
1788 case SPI_SETFOCUSBORDERHEIGHT:
1789 return SpiSetInt(&gspv.uiFocusBorderHeight, uiParam, KEY_MOUSE, L"", fl);
1790
1791 case SPI_GETFONTSMOOTHINGORIENTATION:
1792 return SpiGetInt(pvParam, &gspv.uiFontSmoothingOrientation, fl);
1793
1794 case SPI_SETFONTSMOOTHINGORIENTATION:
1796
1797 case SPI_GETWINARRANGING:
1798 return SpiGetInt(pvParam, &g_bWindowSnapEnabled, fl);
1799 case SPI_SETWINARRANGING:
1801
1802 case SPI_GETDOCKMOVING:
1803 return SpiGetInt(pvParam, &gspv.bDockMoving, fl);
1804 case SPI_SETDOCKMOVING:
1806
1807 /* The following are undocumented, but valid SPI values */
1808 case 0x1010:
1809 case 0x1011:
1810 case 0x1028:
1811 case 0x1029:
1812 case 0x102A:
1813 case 0x102B:
1814 case 0x102C:
1815 case 0x102D:
1816 case 0x102E:
1817 case 0x102F:
1818 case 0x1030:
1819 case 0x1031:
1820 case 0x1032:
1821 case 0x1033:
1822 case 0x1034:
1823 case 0x1035:
1824 case 0x1036:
1825 case 0x1037:
1826 case 0x1038:
1827 case 0x1039:
1828 case 0x103A:
1829 case 0x103B:
1830 case 0x103C:
1831 case 0x103D:
1832 ERR("Undocumented SPI value %x is unimplemented\n", uiAction);
1833 break;
1834
1835 default:
1836 ERR("Invalid SPI value: %u\n", uiAction);
1838 return 0;
1839 }
1840
1841 return 0;
1842}
1843
1844static BOOL
1845SpiGetSetProbeBuffer(UINT uiAction, UINT uiParam, PVOID pvParam)
1846{
1847 BOOL bToUser = TRUE;
1848 ULONG cbSize = 0;
1849
1850 switch (uiAction)
1851 {
1852 case SPI_GETBEEP:
1853 case SPI_GETBORDER:
1862 case SPI_GETDRAGFULLWINDOWS:
1863 case SPI_GETSHOWSOUNDS:
1864 case SPI_GETKEYBOARDPREF:
1865 case SPI_GETSCREENREADER:
1866 case SPI_GETFONTSMOOTHING:
1867 case SPI_GETLOWPOWERTIMEOUT:
1868 case SPI_GETPOWEROFFTIMEOUT:
1869 case SPI_GETLOWPOWERACTIVE:
1870 case SPI_GETPOWEROFFACTIVE:
1871 case SPI_GETMOUSETRAILS:
1872 case SPI_GETSNAPTODEFBUTTON:
1873 case SPI_GETMOUSEHOVERWIDTH:
1874 case SPI_GETMOUSEHOVERHEIGHT:
1875 case SPI_GETMOUSEHOVERTIME:
1876 case SPI_GETWHEELSCROLLLINES:
1877 case SPI_GETMENUSHOWDELAY:
1878#if (_WIN32_WINNT >= 0x0600)
1880#endif
1881 case SPI_GETSHOWIMEUI:
1882 case SPI_GETMOUSESPEED:
1883 case SPI_GETSCREENSAVERRUNNING:
1884#if(WINVER >= 0x0600)
1885 case SPI_GETSCREENSAVESECURE:
1886#endif
1887 case SPI_GETACTIVEWINDOWTRACKING:
1888 case SPI_GETMENUANIMATION:
1889 case SPI_GETCOMBOBOXANIMATION:
1890 case SPI_GETLISTBOXSMOOTHSCROLLING:
1891 case SPI_GETGRADIENTCAPTIONS:
1892 case SPI_GETKEYBOARDCUES:
1893 case SPI_GETACTIVEWNDTRKZORDER:
1894 case SPI_GETHOTTRACKING:
1895 case SPI_GETMENUFADE:
1896 case SPI_GETSELECTIONFADE:
1897 case SPI_GETTOOLTIPANIMATION:
1898 case SPI_GETTOOLTIPFADE:
1899 case SPI_GETCURSORSHADOW:
1900 case SPI_GETUIEFFECTS:
1901 case SPI_GETMOUSESONAR:
1902 case SPI_GETMOUSECLICKLOCK:
1903 case SPI_GETMOUSEVANISH:
1904 case SPI_GETFLATMENU:
1905 case SPI_GETDROPSHADOW:
1906 case SPI_GETBLOCKSENDINPUTRESETS:
1907#if(_WIN32_WINNT >= 0x0600)
1908 case SPI_GETDISABLEOVERLAPPEDCONTENT:
1909 case SPI_GETCLIENTAREAANIMATION:
1910 case SPI_GETCLEARTYPE:
1911 case SPI_GETSPEECHRECOGNITION:
1912#endif
1913 case SPI_GETFOREGROUNDLOCKTIMEOUT:
1914 case SPI_GETACTIVEWNDTRKTIMEOUT:
1915 case SPI_GETFOREGROUNDFLASHCOUNT:
1916 case SPI_GETCARETWIDTH:
1917 case SPI_GETMOUSECLICKLOCKTIME:
1918 case SPI_GETFONTSMOOTHINGTYPE:
1919 case SPI_GETFONTSMOOTHINGCONTRAST:
1920 case SPI_GETFOCUSBORDERWIDTH:
1921 case SPI_GETFOCUSBORDERHEIGHT:
1922 case SPI_GETFONTSMOOTHINGORIENTATION:
1923 cbSize = sizeof(INT);
1924 break;
1925
1928 if (pvParam) cbSize = sizeof(INT);
1929 break;
1930
1931 case SPI_GETMOUSE:
1932 cbSize = 3 * sizeof(INT);
1933 break;
1934
1936 cbSize = min(uiParam, gspv.ustrWallpaper.Length + 1UL);
1937 break;
1938
1940 cbSize = sizeof(LOGFONTW);
1941 break;
1942
1943 case SPI_GETNONCLIENTMETRICS:
1944 cbSize = sizeof(NONCLIENTMETRICSW);
1945 break;
1946
1947 case SPI_GETMINIMIZEDMETRICS:
1948 cbSize = sizeof(MINIMIZEDMETRICS);
1949 break;
1950
1951 case SPI_GETICONMETRICS:
1952 cbSize = sizeof(ICONMETRICSW);
1953 break;
1954
1955 case SPI_GETWORKAREA:
1956 cbSize = sizeof(RECTL);
1957 break;
1958
1959 case SPI_GETFILTERKEYS:
1960 cbSize = sizeof(FILTERKEYS);
1961 break;
1962
1963 case SPI_GETTOGGLEKEYS:
1964 cbSize = sizeof(TOGGLEKEYS);
1965 break;
1966
1967 case SPI_GETMOUSEKEYS:
1968 cbSize = sizeof(MOUSEKEYS);
1969 break;
1970
1971 case SPI_GETSTICKYKEYS:
1972 cbSize = sizeof(STICKYKEYS);
1973 break;
1974
1976 cbSize = sizeof(ACCESSTIMEOUT);
1977 break;
1978
1979 case SPI_GETSERIALKEYS:
1980 cbSize = sizeof(SERIALKEYS);
1981 break;
1982
1983 case SPI_GETSOUNDSENTRY:
1984 cbSize = sizeof(SOUNDSENTRYW);
1985 break;
1986
1987 case SPI_GETHIGHCONTRAST:
1988 cbSize = sizeof(HIGHCONTRASTW);
1989 break;
1990
1991 case SPI_GETANIMATION:
1992 cbSize = sizeof(ANIMATIONINFO);
1993 break;
1994
1995 case SPI_GETDEFAULTINPUTLANG:
1996 cbSize = sizeof(HKL);
1997 break;
1998
1999#if(WINVER >= 0x0600)
2000 case SPI_GETAUDIODESCRIPTION:
2001 cbSize = sizeof(AUDIODESCRIPTION);
2002 break;
2003#endif
2004
2005 case SPI_SETMOUSE:
2006 cbSize = 3 * sizeof(INT);
2007 bToUser = FALSE;
2008 break;
2009
2011 cbSize = sizeof(LOGFONTW);
2012 bToUser = FALSE;
2013 break;
2014
2015 case SPI_SETNONCLIENTMETRICS:
2016 cbSize = sizeof(NONCLIENTMETRICSW);
2017 bToUser = FALSE;
2018 break;
2019
2020 case SPI_SETMINIMIZEDMETRICS:
2021 cbSize = sizeof(MINIMIZEDMETRICS);
2022 bToUser = FALSE;
2023 break;
2024
2025 case SPI_SETICONMETRICS:
2026 cbSize = sizeof(ICONMETRICSW);
2027 bToUser = FALSE;
2028 break;
2029
2030 case SPI_SETWORKAREA:
2031 cbSize = sizeof(RECTL);
2032 bToUser = FALSE;
2033 break;
2034
2035 case SPI_SETFILTERKEYS:
2036 cbSize = sizeof(FILTERKEYS);
2037 bToUser = FALSE;
2038 break;
2039
2040 case SPI_SETTOGGLEKEYS:
2041 cbSize = sizeof(TOGGLEKEYS);
2042 bToUser = FALSE;
2043 break;
2044
2045 case SPI_SETMOUSEKEYS:
2046 cbSize = sizeof(MOUSEKEYS);
2047 bToUser = FALSE;
2048 break;
2049
2050 case SPI_SETSTICKYKEYS:
2051 cbSize = sizeof(STICKYKEYS);
2052 bToUser = FALSE;
2053 break;
2054
2056 cbSize = sizeof(ACCESSTIMEOUT);
2057 bToUser = FALSE;
2058 break;
2059
2060 case SPI_SETSERIALKEYS:
2061 cbSize = sizeof(SERIALKEYS);
2062 bToUser = FALSE;
2063 break;
2064
2065 case SPI_SETSOUNDSENTRY:
2066 cbSize = sizeof(SOUNDSENTRYW);
2067 bToUser = FALSE;
2068 break;
2069
2070 case SPI_SETHIGHCONTRAST:
2071 cbSize = sizeof(HIGHCONTRASTW);
2072 bToUser = FALSE;
2073 break;
2074
2075 case SPI_SETANIMATION:
2076 cbSize = sizeof(ANIMATIONINFO);
2077 bToUser = FALSE;
2078 break;
2079
2080 case SPI_SETDEFAULTINPUTLANG:
2081 cbSize = sizeof(HKL);
2082 bToUser = FALSE;
2083 break;
2084
2085 case SPI_SETMOUSESPEED:
2086 cbSize = sizeof(INT);
2087 bToUser = FALSE;
2088 break;
2089 }
2090
2091 if (cbSize)
2092 {
2093 _SEH2_TRY
2094 {
2095 if (bToUser)
2096 {
2097 ProbeForWrite(pvParam, cbSize, sizeof(UCHAR));
2098 }
2099 else
2100 {
2101 ProbeForRead(pvParam, cbSize, sizeof(UCHAR));
2102 }
2103 }
2105 {
2106 _SEH2_YIELD(return FALSE);
2107 }
2108 _SEH2_END;
2109 }
2110
2111 return TRUE;
2112}
2113
2114BOOL
2117 UINT uiAction,
2118 UINT uiParam,
2119 PVOID pvParam,
2120 UINT fWinIni)
2121{
2122 ULONG_PTR ulResult;
2124
2125 ASSERT(ppi);
2126
2127 if (!gbSpiInitialized)
2128 {
2130 //ASSERT(FALSE);
2131 return FALSE;
2132 }
2133
2134 /* Get a pointer to the current Windowstation */
2135 if (!ppi->prpwinsta)
2136 {
2137 ERR("UserSystemParametersInfo called without active window station.\n");
2138 //ASSERT(FALSE);
2139 //return FALSE;
2140 }
2141
2142 if ((fWinIni & SPIF_PROTECT) && !SpiGetSetProbeBuffer(uiAction, uiParam, pvParam))
2143 {
2145 return FALSE;
2146 }
2147
2148 /* Do the actual operation */
2149 ulResult = SpiGetSet(uiAction, uiParam, pvParam, fWinIni);
2150
2151 /* Did we change something? */
2152 if (ulResult > 1)
2153 {
2155
2156 /* Update system metrics */
2157 InitMetrics();
2158
2159 /* Send notification to toplevel windows, if requested */
2160 if (fWinIni & SPIF_SENDCHANGE)
2161 {
2162 /* Send WM_SETTINGCHANGE to all toplevel windows */
2165 (WPARAM)uiAction,
2166 (LPARAM)ulResult,
2168 100,
2169 &ulResult);
2170 }
2171 ulResult = 1;
2172 }
2173
2174 return ulResult;
2175}
2176
2177BOOL
2180 UINT uiAction,
2181 UINT uiParam,
2182 PVOID pvParam,
2183 UINT fWinIni)
2184{
2185 BOOL bResult;
2186
2187 TRACE("Enter NtUserSystemParametersInfo(%u)\n", uiAction);
2189
2190 // FIXME: Get rid of the flags and only use this from um. kernel can access data directly.
2191 /* Set UM memory protection flag */
2192 fWinIni |= SPIF_PROTECT;
2193
2194 /* Call internal function */
2195 bResult = UserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
2196
2197 TRACE("Leave NtUserSystemParametersInfo, returning %d\n", bResult);
2198 UserLeave();
2199
2200 return bResult;
2201}
2202
2203/* EOF */
@ UPM_TOOLTIPANIMATION
@ UPM_COMBOBOXANIMATION
@ UPM_ACTIVEWINDOWTRACKING
@ UPM_GRADIENTCAPTIONS
@ UPM_LISTBOXSMOOTHSCROLLING
@ UPM_ACTIVEWNDTRKZORDER
LONG NTSTATUS
Definition: precomp.h:26
#define SPI_GETWHEELSCROLLCHARS
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:106
HBITMAP hbmp
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define APIENTRY
Definition: api.h:79
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define MAX_PATH
Definition: compat.h:34
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define PtrToUlong(u)
Definition: config.h:107
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define KeRosDumpStackFrames(Frames, Count)
Definition: gdidebug.h:11
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
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
PSERVERINFO gpsi
Definition: imm.c:18
_CRTIMP wchar_t *__cdecl _itow(_In_ int _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SRVINFO_KBDPREF
Definition: ntuser.h:952
#define PUSIF_COMBOBOXANIMATION
Definition: ntuser.h:995
#define PUSIF_KEYBOARDCUES
Definition: ntuser.h:997
BOOL NTAPI NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
Definition: painting.c:2003
#define PUSIF_LISTBOXSMOOTHSCROLLING
Definition: ntuser.h:996
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define RtlEqualMemory(dst, src, len)
Definition: kdvm.h:18
#define REG_SZ
Definition: layer.c:22
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
static HBITMAP
Definition: button.c:44
#define SPI_GETDESKWALLPAPER
Definition: sysparams.c:34
#define min(a, b)
Definition: monoChain.cc:55
HKL hkl
Definition: msctf.idl:650
UINT_PTR HKL
Definition: msctf.idl:143
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
unsigned int UINT
Definition: ndis.h:50
#define REG_BINARY
Definition: nt_native.h:1496
#define FASTCALL
Definition: nt_native.h:50
unsigned long FLONG
Definition: ntbasedef.h:378
__kernel_entry W32KAPI INT APIENTRY NtGdiGetDeviceCaps(_In_ HDC hdc, _In_ INT i)
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1792
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:258
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:249
#define L(x)
Definition: ntvdm.h:50
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:43
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
#define INT
Definition: polytest.cpp:20
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:184
#define REG_DWORD
Definition: sdbapi.c:596
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE(s)
Definition: solgame.cpp:4
RECT rcWork
Definition: monitor.h:19
RECT rcMonitor
Definition: monitor.h:18
struct _WINSTATION_OBJECT * prpwinsta
Definition: win32.h:267
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
INT iMouseHoverWidth
Definition: sysparams.h:85
BOOL bDockMoving
Definition: sysparams.h:162
INT iDragHeight
Definition: sysparams.h:92
MINIMIZEDMETRICS mm
Definition: sysparams.h:52
BOOL bFontSmoothing
Definition: sysparams.h:125
WALLPAPER_MODE WallpaperMode
Definition: sysparams.h:144
BOOL bScreenReader
Definition: sysparams.h:60
FILTERKEYS filterkeys
Definition: sysparams.h:100
UINT uiFocusBorderHeight
Definition: sysparams.h:55
UINT uiFocusBorderWidth
Definition: sysparams.h:54
TEXTMETRICW tmCaptionFont
Definition: sysparams.h:139
NONCLIENTMETRICSW ncm
Definition: sysparams.h:51
DWORD dwMenuShowDelay
Definition: sysparams.h:131
MOUSEKEYS mousekeys
Definition: sysparams.h:76
BOOL bHandHeld
Definition: sysparams.h:148
INT iWheelScrollLines
Definition: sysparams.h:94
INT iKbdDelay
Definition: sysparams.h:107
INT iDblClickHeight
Definition: sysparams.h:89
BOOL bMouseBtnSwap
Definition: sysparams.h:82
SOUNDSENTRYW soundsentry
Definition: sysparams.h:70
UNICODE_STRING ustrWallpaper
Definition: sysparams.h:145
ULONG cxWallpaper
Definition: sysparams.h:143
SERIALKEYS serialkeys
Definition: sysparams.h:101
DWORD dwForegroundLockTimeout
Definition: sysparams.h:155
INT iDblClickTime
Definition: sysparams.h:90
STICKYKEYS stickykeys
Definition: sysparams.h:102
INT iLowPwrTimeout
Definition: sysparams.h:118
INT iScrSaverTimeout
Definition: sysparams.h:110
TEXTMETRICW tmMenuFont
Definition: sysparams.h:138
BOOL bSnapToDefBtn
Definition: sysparams.h:153
ICONMETRICSW im
Definition: sysparams.h:53
DWORD dwMouseClickLockTime
Definition: sysparams.h:79
BOOL bMouseClickLock
Definition: sysparams.h:77
BOOL bBeep
Definition: sysparams.h:72
DWORD dwKbdSpeed
Definition: sysparams.h:104
BOOL bMenuDropAlign
Definition: sysparams.h:130
DWORD dwUserPrefMask
Definition: sysparams.h:124
ULONG cyWallpaper
Definition: sysparams.h:143
INT iMouseHoverHeight
Definition: sysparams.h:86
ANIMATIONINFO animationinfo
Definition: sysparams.h:152
BOOL bLowPwrActive
Definition: sysparams.h:120
HIGHCONTRASTW highcontrast
Definition: sysparams.h:59
BOOL bMouseCursorShadow
Definition: sysparams.h:78
DWORD dwCaretWidth
Definition: sysparams.h:158
BOOL bShowSounds
Definition: sysparams.h:71
INT iDragWidth
Definition: sysparams.h:91
HANDLE hbmWallpaper
Definition: sysparams.h:142
WCHAR awcWallpaper[MAX_PATH+1]
Definition: sysparams.h:146
INT iDblClickWidth
Definition: sysparams.h:88
BOOL bScrSaverRunning
Definition: sysparams.h:112
ACCESSTIMEOUT accesstimeout
Definition: sysparams.h:58
DWORD dwActiveTrackingTimeout
Definition: sysparams.h:156
UINT uiFontSmoothingContrast
Definition: sysparams.h:127
UINT uiGridGranularity
Definition: sysparams.h:150
BOOL bKbdPref
Definition: sysparams.h:105
DWORD dwForegroundFlashCount
Definition: sysparams.h:157
INT iMouseSpeed
Definition: sysparams.h:84
UINT uiFontSmoothingType
Definition: sysparams.h:126
CURSORACCELERATION_INFO caiMouse
Definition: sysparams.h:75
BOOL bMouseVanish
Definition: sysparams.h:81
BOOL bScrSaverActive
Definition: sysparams.h:111
BOOL bBlockSendInputResets
Definition: sysparams.h:132
BOOL bPwrOffActive
Definition: sysparams.h:121
UINT uiFontSmoothingOrientation
Definition: sysparams.h:128
BOOL bDragFullWindows
Definition: sysparams.h:129
BOOL bMouseSonar
Definition: sysparams.h:80
INT iMouseTrails
Definition: sysparams.h:93
TOGGLEKEYS togglekeys
Definition: sysparams.h:103
INT iMouseHoverTime
Definition: sysparams.h:87
BOOL bFastTaskSwitch
Definition: sysparams.h:149
INT iPwrOffTimeout
Definition: sysparams.h:119
BOOL bShowImeUi
Definition: sysparams.h:154
SURFOBJ SurfObj
Definition: surface.h:8
SIZEL sizlBitmap
Definition: winddi.h:1209
USHORT MaximumLength
Definition: env_spec_w32.h:370
Definition: object.h:4
Definition: ntuser.h:694
RECT rcWindow
Definition: ntuser.h:716
HKL hkl
Definition: input.h:32
DWORD iMaxSpeed
Definition: winuser.h:3432
DWORD iTimeToMaxSpeed
Definition: winuser.h:3433
UINT cbSize
Definition: winuser.h:3430
DWORD dwFlags
Definition: winuser.h:3431
DWORD iCtrlSpeed
Definition: winuser.h:3434
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
DWORD dwSRVIFlags
Definition: ntuser.h:1051
DWORD cbSize
Definition: winuser.h:3548
LONG tmAveCharWidth
Definition: wingdi.h:2388
LONG tmExternalLeading
Definition: wingdi.h:2387
LONG tmHeight
Definition: wingdi.h:2383
DWORD cbSize
Definition: winuser.h:3553
#define max(a, b)
Definition: svc.c:63
BOOL InitSysParams()
#define SPIF_PROTECT
Definition: sysparams.h:13
#define SPITESTPREF(x)
Definition: sysparams.h:201
@ wmCenter
Definition: sysparams.h:41
@ wmFill
Definition: sysparams.h:45
@ wmTile
Definition: sysparams.h:42
@ wmStretch
Definition: sysparams.h:43
@ wmFit
Definition: sysparams.h:44
@ UPM_FLATMENU
Definition: sysparams.h:32
@ UPM_DROPSHADOW
Definition: sysparams.h:33
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_In_z_ PCWSTR pwszValueName
Definition: ntuser.h:42
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:124
HWND FASTCALL UserGetShellWindow(VOID)
Definition: window.c:3697
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
Definition: gdiobj.c:1261
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1158
HBITMAP NTAPI UserLoadImage(PCWSTR)
Definition: file.c:159
BOOL NTAPI W32kDosPathNameToNtPathName(PCWSTR, PUNICODE_STRING)
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
HDC ScreenDeviceContext
Definition: desktop.c:53
PWND FASTCALL UserGetDesktopWindow(VOID)
Definition: desktop.c:1403
PKL gspklBaseLayout
Definition: kbdlayout.c:22
DWORD gdwLanguageToggleKey
Definition: keyboard.c:19
DWORD gdwLayoutToggleKey
Definition: keyboard.c:21
BOOL NTAPI UserSetDefaultInputLang(HKL hKl)
Definition: kbdlayout.c:583
LRESULT FASTCALL co_IntSendMessageTimeout(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT uFlags, UINT uTimeout, ULONG_PTR *uResult)
Definition: message.c:1707
BOOL NTAPI InitMetrics(VOID)
Definition: metric.c:45
DWORD FASTCALL UserGetLanguageToggle(_In_ PCWSTR pszType, _In_ DWORD dwDefaultValue)
Definition: misc.c:84
PMONITOR NTAPI UserMonitorFromRect(PRECTL pRect, DWORD dwFlags)
Definition: monitor.c:405
PMONITOR NTAPI UserGetPrimaryMonitor(VOID)
Definition: monitor.c:102
static INT SpiLoadInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:127
static const WCHAR * VAL_DBLCLKHEIGHT
Definition: sysparams.c:52
static const WCHAR * KEY_MDALIGN
Definition: sysparams.c:85
static const WCHAR * VAL_CLICKLOCKTIME
Definition: sysparams.c:74
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:61
static UINT_PTR SpiSet(PVOID pvData, PVOID pvParam, ULONG cbSize, FLONG fl)
Definition: sysparams.c:499
#define REG2METRIC(reg)
Definition: sysparams.c:25
static const WCHAR * KEY_MOUSE
Definition: sysparams.c:46
static DWORD SpiLoadUserPrefMask(DWORD dValue)
Definition: sysparams.c:142
static VOID SpiStoreFont(PCWSTR pwszValue, LOGFONTW *plogfont)
Definition: sysparams.c:444
static UINT_PTR SpiSetYesNo(BOOL *pbData, BOOL bValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:528
static const WCHAR * VAL_MOUSETRAILS
Definition: sysparams.c:50
static const WCHAR * VAL_FONTSMOOTHING
Definition: sysparams.c:69
static const WCHAR * VAL_BEEP
Definition: sysparams.c:95
static const WCHAR * VAL_SCRTO
Definition: sysparams.c:62
BOOL g_bWindowSnapEnabled
Definition: sysparams.c:20
static const WCHAR * VAL_FONTSMOOTHINGCONTRAST
Definition: sysparams.c:71
static const WCHAR * VAL_SWAP
Definition: sysparams.c:55
static VOID SpiFixupValues(VOID)
Definition: sysparams.c:202
static const WCHAR * VAL_USERPREFMASK
Definition: sysparams.c:81
static const WCHAR * KEY_SOUND
Definition: sysparams.c:94
BOOL g_PaintDesktopVersion
Definition: sysparams.c:19
static const WCHAR * VAL_HOVERWIDTH
Definition: sysparams.c:57
static const WCHAR * KEY_SHOWSNDS
Definition: sysparams.c:101
static const WCHAR * VAL_SNAP_ENABLED
Definition: sysparams.c:82
static const WCHAR * VAL_MOUSE3
Definition: sysparams.c:49
static UINT_PTR SpiGetInt(PVOID pvParam, PVOID piValue, FLONG fl)
Definition: sysparams.c:521
#define REQ_INTERACTIVE_WINSTA(err)
Definition: sysparams.c:28
static const WCHAR * VAL_HOVERTIME
Definition: sysparams.c:56
static const WCHAR * VAL_HOVERHEIGHT
Definition: sysparams.c:58
static VOID SpiUpdatePerUserSystemParameters(VOID)
Definition: sysparams.c:226
static const WCHAR * VAL_DRAGHEIGHT
Definition: sysparams.c:67
static INT SpiLoadMouse(PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:168
static const WCHAR * VAL_SNAP_DOCKMOVING
Definition: sysparams.c:83
static const WCHAR * VAL_MOUSE2
Definition: sysparams.c:48
static const WCHAR * VAL_FONTSMOOTHINGORIENTATION
Definition: sysparams.c:72
static UINT_PTR SpiSetDWord(PVOID pvData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:554
static UINT_PTR SpiGetUserPref(DWORD dwMask, PVOID pvParam, FLONG fl)
Definition: sysparams.c:633
static const WCHAR * KEY_METRIC
Definition: sysparams.c:88
static const WCHAR * VAL_DBLCLKWIDTH
Definition: sysparams.c:51
static const WCHAR * VAL_MOUSEKEYS_TIMETOMAX
Definition: sysparams.c:109
static INT SpiLoadDWord(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:115
static const WCHAR * VAL_PAINTDESKVER
Definition: sysparams.c:75
BOOL gbSpiInitialized
Definition: sysparams.c:18
static const WCHAR * VAL_ON
Definition: sysparams.c:104
static const WCHAR * KEY_SCRREAD
Definition: sysparams.c:103
static const WCHAR * VAL_MDALIGN
Definition: sysparams.c:86
static VOID SpiStoreMetric(LPCWSTR pwszValue, INT iValue)
Definition: sysparams.c:437
static const WCHAR * VAL_DRAG
Definition: sysparams.c:66
static const WCHAR * KEY_MOUSEKEYS
Definition: sysparams.c:106
static const WCHAR * VAL_KBDDELAY
Definition: sysparams.c:99
static UINT_PTR SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
Definition: sysparams.c:816
static UINT_PTR SpiSetBool(BOOL *pbData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:541
static const WCHAR * VAL_SCRACT
Definition: sysparams.c:64
static const WCHAR * VAL_SCRNSV
Definition: sysparams.c:63
static INT SpiLoadMetric(PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:175
static const WCHAR * VAL_SNAPDEFBTN
Definition: sysparams.c:54
static VOID SpiStoreDWord(PCWSTR pwszKey, PCWSTR pwszValue, DWORD Value)
Definition: sysparams.c:401
static const WCHAR * VAL_ICONVSPC
Definition: sysparams.c:91
BOOL APIENTRY NtUserUpdatePerUserSystemParameters(DWORD dwReserved, BOOL bEnable)
Definition: sysparams.c:374
static DWORD SpiLoadTimeOut(VOID)
Definition: sysparams.c:154
static VOID SpiStoreSzInt(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:423
static VOID SpiStoreSz(PCWSTR pwszKey, PCWSTR pwszValue, PCWSTR pwsz)
Definition: sysparams.c:412
static BOOL SpiGetSetProbeBuffer(UINT uiAction, UINT uiParam, PVOID pvParam)
Definition: sysparams.c:1845
static const WCHAR * VAL_SENSITIVITY
Definition: sysparams.c:59
static UINT_PTR SpiGetEx(PVOID pvParam, PVOID pvData, ULONG cbSize, FLONG fl)
Definition: sysparams.c:507
static UINT_PTR SpiSetUserPref(DWORD dwMask, PVOID pvValue, FLONG fl)
Definition: sysparams.c:593
static const WCHAR * VAL_DBLCLKTIME
Definition: sysparams.c:53
static const WCHAR * VAL_SCRLLLINES
Definition: sysparams.c:73
static UINT_PTR SpiGet(PVOID pvParam, PVOID pvData, ULONG cbSize, FLONG fl)
Definition: sysparams.c:491
static const WCHAR * KEY_KBD
Definition: sysparams.c:97
static const WCHAR * KEY_KDBPREF
Definition: sysparams.c:102
static const WCHAR * VAL_KBDSPD
Definition: sysparams.c:98
static const WCHAR * VAL_ICONSPC
Definition: sysparams.c:90
static const WCHAR * VAL_DRAGWIDTH
Definition: sysparams.c:68
static const WCHAR * VAL_FONTSMOOTHINGTYPE
Definition: sysparams.c:70
static const WCHAR * VAL_GRID
Definition: sysparams.c:65
static const WCHAR * VAL_MOUSE1
Definition: sysparams.c:47
static BOOL SpiNotifyNCMetricsChanged(VOID)
Definition: sysparams.c:780
static const WCHAR * VAL_MOUSEKEYS_MAX
Definition: sysparams.c:108
static const WCHAR * VAL_ITWRAP
Definition: sysparams.c:92
static const WCHAR * VAL_CARETRATE
Definition: sysparams.c:76
static const WCHAR * VAL_CARETWIDTH
Definition: sysparams.c:77
static UINT_PTR SpiSetWallpaper(PVOID pvParam, FLONG fl)
Definition: sysparams.c:641
static const WCHAR * VAL_MOUSEKEYS_FLAGS
Definition: sysparams.c:107
SPIVALUES gspv
Definition: sysparams.c:17
static VOID SpiLoadFont(PLOGFONTW plfOut, LPWSTR pwszValueName, PLOGFONTW plfDefault)
Definition: sysparams.c:187
static UINT_PTR SpiMemCopy(PVOID pvDst, PVOID pvSrc, ULONG cbSize, BOOL bProtect)
Definition: sysparams.c:459
#define METRIC2REG(met)
Definition: sysparams.c:26
static const WCHAR * VAL_BORDER
Definition: sysparams.c:89
static UINT_PTR SpiSetMetric(PVOID pvData, INT iValue, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:580
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2116
BOOL APIENTRY NtUserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2179
static UINT_PTR SpiSetInt(PVOID pvData, INT iValue, PCWSTR pwszKey, PCWSTR pwszValue, FLONG fl)
Definition: sysparams.c:567
#define USERTAG_WINDOWLIST
Definition: tags.h:298
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:276
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_updates_bytes_to_ pdwDataLen BYTE * pbData
Definition: wincrypt.h:4201
_In_ FLONG fl
Definition: winddi.h:1279
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
_In_ BOOL bEnable
Definition: winddi.h:3426
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3749
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
#define ERROR_NOACCESS
Definition: winerror.h:578
#define VARIABLE_PITCH
Definition: wingdi.h:445
#define DEFAULT_QUALITY
Definition: wingdi.h:436
#define FW_BOLD
Definition: wingdi.h:378
#define ANSI_CHARSET
Definition: wingdi.h:383
#define FW_NORMAL
Definition: wingdi.h:373
#define BITSPIXEL
Definition: wingdi.h:720
#define FF_SWISS
Definition: wingdi.h:452
_In_ DWORD _In_ DWORD cbBufSize
Definition: winsvc.h:424
#define ARW_HIDE
Definition: winuser.h:1087
#define SPI_SETSTICKYKEYS
Definition: winuser.h:1419
#define SPI_GETFILTERKEYS
Definition: winuser.h:1410
#define SPI_GETACCESSTIMEOUT
Definition: winuser.h:1420
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SWP_NOREDRAW
Definition: winuser.h:1257
SERIALKEYSA SERIALKEYS
Definition: winuser.h:5752
#define SPI_GETMOUSEKEYS
Definition: winuser.h:1414
#define SPI_SETBORDER
Definition: winuser.h:1369
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define SPI_GETSHOWSOUNDS
Definition: winuser.h:1416
#define SPI_GETBORDER
Definition: winuser.h:1368
#define SPI_SETMOUSEKEYS
Definition: winuser.h:1415
struct tagHIGHCONTRASTW * LPHIGHCONTRASTW
#define SPI_SETMENUDROPALIGNMENT
Definition: winuser.h:1388
#define SPI_SETDESKWALLPAPER
Definition: winuser.h:1380
#define SPI_GETTOGGLEKEYS
Definition: winuser.h:1412
#define SPI_SETFASTTASKSWITCH
Definition: winuser.h:1396
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1384
#define HWND_BROADCAST
Definition: winuser.h:1215
#define SPI_SETDOUBLECLKWIDTH
Definition: winuser.h:1389
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SPI_SETBEEP
Definition: winuser.h:1365
#define SPI_SETACCESSTIMEOUT
Definition: winuser.h:1421
#define SPI_GETGRIDGRANULARITY
Definition: winuser.h:1378
#define SPI_SETSCREENSAVEACTIVE
Definition: winuser.h:1377
struct tagSTICKYKEYS STICKYKEYS
#define SPI_SETDOUBLECLKHEIGHT
Definition: winuser.h:1390
struct tagMOUSEKEYS MOUSEKEYS
#define RDW_ERASE
Definition: winuser.h:1222
#define SPI_GETFASTTASKSWITCH
Definition: winuser.h:1395
struct tagFILTERKEYS FILTERKEYS
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1391
struct tagFILTERKEYS * LPFILTERKEYS
#define SPI_SETFILTERKEYS
Definition: winuser.h:1411
#define SPI_GETMOUSE
Definition: winuser.h:1366
struct tagACCESSTIMEOUT * LPACCESSTIMEOUT
#define SPIF_SENDCHANGE
Definition: winuser.h:1591
#define SPI_LANGDRIVER
Definition: winuser.h:1372
#define WM_SETTINGCHANGE
Definition: winuser.h:1648
struct tagSOUNDSENTRYW SOUNDSENTRYW
#define SPI_SETDESKPATTERN
Definition: winuser.h:1381
#define SPI_SETKEYBOARDSPEED
Definition: winuser.h:1371
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1590
struct tagSTICKYKEYS * LPSTICKYKEYS
#define SPI_SETICONTITLELOGFONT
Definition: winuser.h:1394
#define SPI_SETTOGGLEKEYS
Definition: winuser.h:1413
#define SWP_NOCOPYBITS
Definition: winuser.h:1254
struct tagMINIMIZEDMETRICS MINIMIZEDMETRICS
#define SPI_GETKEYBOARDSPEED
Definition: winuser.h:1370
#define SPI_GETSTICKYKEYS
Definition: winuser.h:1418
struct tagTOGGLEKEYS * LPTOGGLEKEYS
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1392
struct tagHIGHCONTRASTW HIGHCONTRASTW
#define SPI_GETICONTITLEWRAP
Definition: winuser.h:1385
#define SPI_SETMOUSEBUTTONSWAP
Definition: winuser.h:1393
struct tagSOUNDSENTRYW * LPSOUNDSENTRYW
struct tagACCESSTIMEOUT ACCESSTIMEOUT
#define SPI_ICONHORIZONTALSPACING
Definition: winuser.h:1373
struct tagMOUSEKEYS * LPMOUSEKEYS
struct tagMINIMIZEDMETRICS * LPMINIMIZEDMETRICS
#define SPI_GETBEEP
Definition: winuser.h:1364
#define SPI_SETMOUSE
Definition: winuser.h:1367
#define SPI_GETKEYBOARDDELAY
Definition: winuser.h:1382
#define SPI_SETICONTITLEWRAP
Definition: winuser.h:1386
#define SWP_NOZORDER
Definition: winuser.h:1258
#define SPI_SETSOUNDSENTRY
Definition: winuser.h:1427
#define SPI_SETKEYBOARDDELAY
Definition: winuser.h:1383
#define SPI_GETSOUNDSENTRY
Definition: winuser.h:1426
SERIALKEYSA * LPSERIALKEYS
Definition: winuser.h:5752
#define SPI_SETSCREENSAVETIMEOUT
Definition: winuser.h:1375
#define SPI_SETSHOWSOUNDS
Definition: winuser.h:1417
#define SPI_SETGRIDGRANULARITY
Definition: winuser.h:1379
#define SPI_GETSCREENSAVETIMEOUT
Definition: winuser.h:1374
#define RDW_INVALIDATE
Definition: winuser.h:1225
struct tagANIMATIONINFO ANIMATIONINFO
struct tagTOGGLEKEYS TOGGLEKEYS
#define SPI_GETSCREENSAVEACTIVE
Definition: winuser.h:1376
#define SMTO_NORMAL
Definition: winuser.h:1236
#define SPI_GETMENUDROPALIGNMENT
Definition: winuser.h:1387
_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:409
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define SPI_SETWHEELSCROLLLINES
Definition: zmouse.h:30