ReactOS  0.4.13-dev-482-ge57f103
sysparams.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winreg.h"
#include "winuser.h"
#include "winnls.h"
Include dependency graph for sysparams.c:

Go to the source code of this file.

Classes

struct  LOGFONT16
 

Macros

#define _WIN32_WINNT   0x0600 /* For SPI_GETMOUSEHOVERWIDTH and more */
 
#define _WIN32_IE   0x0700
 
#define WINVER   0x0600 /* For COLOR_MENUBAR, NONCLIENTMETRICS with padding */
 
#define SPI_GETDESKWALLPAPER   0x0073
 
#define eq(received, expected, label, type)   ok((received) == (expected), "%s: got " type " instead of " type "\n", (label),(received),(expected))
 
#define SPI_SETBEEP_REGKEY   "Control Panel\\Sound"
 
#define SPI_SETBEEP_VALNAME   "Beep"
 
#define SPI_SETMOUSE_REGKEY   "Control Panel\\Mouse"
 
#define SPI_SETMOUSE_VALNAME1   "MouseThreshold1"
 
#define SPI_SETMOUSE_VALNAME2   "MouseThreshold2"
 
#define SPI_SETMOUSE_VALNAME3   "MouseSpeed"
 
#define SPI_SETBORDER_REGKEY   "Control Panel\\Desktop\\WindowMetrics"
 
#define SPI_SETBORDER_REGKEY2   "Control Panel\\Desktop"
 
#define SPI_SETBORDER_VALNAME   "BorderWidth"
 
#define SPI_METRIC_REGKEY   "Control Panel\\Desktop\\WindowMetrics"
 
#define SPI_SCROLLWIDTH_VALNAME   "ScrollWidth"
 
#define SPI_SCROLLHEIGHT_VALNAME   "ScrollHeight"
 
#define SPI_CAPTIONWIDTH_VALNAME   "CaptionWidth"
 
#define SPI_CAPTIONHEIGHT_VALNAME   "CaptionHeight"
 
#define SPI_CAPTIONFONT_VALNAME   "CaptionFont"
 
#define SPI_SMCAPTIONWIDTH_VALNAME   "SmCaptionWidth"
 
#define SPI_SMCAPTIONHEIGHT_VALNAME   "SmCaptionHeight"
 
#define SPI_SMCAPTIONFONT_VALNAME   "SmCaptionFont"
 
#define SPI_MENUWIDTH_VALNAME   "MenuWidth"
 
#define SPI_MENUHEIGHT_VALNAME   "MenuHeight"
 
#define SPI_MENUFONT_VALNAME   "MenuFont"
 
#define SPI_STATUSFONT_VALNAME   "StatusFont"
 
#define SPI_MESSAGEFONT_VALNAME   "MessageFont"
 
#define SPI_SETKEYBOARDSPEED_REGKEY   "Control Panel\\Keyboard"
 
#define SPI_SETKEYBOARDSPEED_VALNAME   "KeyboardSpeed"
 
#define SPI_ICONHORIZONTALSPACING_REGKEY   "Control Panel\\Desktop\\WindowMetrics"
 
#define SPI_ICONHORIZONTALSPACING_REGKEY2   "Control Panel\\Desktop"
 
#define SPI_ICONHORIZONTALSPACING_VALNAME   "IconSpacing"
 
#define SPI_ICONVERTICALSPACING_REGKEY   "Control Panel\\Desktop\\WindowMetrics"
 
#define SPI_ICONVERTICALSPACING_REGKEY2   "Control Panel\\Desktop"
 
#define SPI_ICONVERTICALSPACING_VALNAME   "IconVerticalSpacing"
 
#define SPI_MINIMIZEDMETRICS_REGKEY   "Control Panel\\Desktop\\WindowMetrics"
 
#define SPI_MINWIDTH_VALNAME   "MinWidth"
 
#define SPI_MINHORZGAP_VALNAME   "MinHorzGap"
 
#define SPI_MINVERTGAP_VALNAME   "MinVertGap"
 
#define SPI_MINARRANGE_VALNAME   "MinArrange"
 
#define SPI_SETSCREENSAVETIMEOUT_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETSCREENSAVETIMEOUT_VALNAME   "ScreenSaveTimeOut"
 
#define SPI_SETSCREENSAVEACTIVE_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETSCREENSAVEACTIVE_VALNAME   "ScreenSaveActive"
 
#define SPI_SETGRIDGRANULARITY_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETGRIDGRANULARITY_VALNAME   "GridGranularity"
 
#define SPI_SETKEYBOARDDELAY_REGKEY   "Control Panel\\Keyboard"
 
#define SPI_SETKEYBOARDDELAY_VALNAME   "KeyboardDelay"
 
#define SPI_SETICONTITLEWRAP_REGKEY1   "Control Panel\\Desktop\\WindowMetrics"
 
#define SPI_SETICONTITLEWRAP_REGKEY2   "Control Panel\\Desktop"
 
#define SPI_SETICONTITLEWRAP_VALNAME   "IconTitleWrap"
 
#define SPI_SETMENUDROPALIGNMENT_REGKEY1   "Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
 
#define SPI_SETMENUDROPALIGNMENT_REGKEY2   "Control Panel\\Desktop"
 
#define SPI_SETMENUDROPALIGNMENT_VALNAME   "MenuDropAlignment"
 
#define SPI_SETDOUBLECLKWIDTH_REGKEY1   "Control Panel\\Mouse"
 
#define SPI_SETDOUBLECLKWIDTH_REGKEY2   "Control Panel\\Desktop"
 
#define SPI_SETDOUBLECLKWIDTH_VALNAME   "DoubleClickWidth"
 
#define SPI_SETDOUBLECLKHEIGHT_REGKEY1   "Control Panel\\Mouse"
 
#define SPI_SETDOUBLECLKHEIGHT_REGKEY2   "Control Panel\\Desktop"
 
#define SPI_SETDOUBLECLKHEIGHT_VALNAME   "DoubleClickHeight"
 
#define SPI_SETDOUBLECLICKTIME_REGKEY   "Control Panel\\Mouse"
 
#define SPI_SETDOUBLECLICKTIME_VALNAME   "DoubleClickSpeed"
 
#define SPI_SETMOUSEBUTTONSWAP_REGKEY   "Control Panel\\Mouse"
 
#define SPI_SETMOUSEBUTTONSWAP_VALNAME   "SwapMouseButtons"
 
#define SPI_SETWORKAREA_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETWORKAREA_VALNAME   "WINE_WorkArea"
 
#define SPI_SETSHOWSOUNDS_REGKEY   "Control Panel\\Accessibility\\ShowSounds"
 
#define SPI_SETSHOWSOUNDS_VALNAME   "On"
 
#define SPI_SETKEYBOARDPREF_REGKEY   "Control Panel\\Accessibility\\Keyboard Preference"
 
#define SPI_SETKEYBOARDPREF_VALNAME   "On"
 
#define SPI_SETKEYBOARDPREF_REGKEY_LEGACY   "Control Panel\\Accessibility"
 
#define SPI_SETKEYBOARDPREF_VALNAME_LEGACY   "Keyboard Preference"
 
#define SPI_SETSCREENREADER_REGKEY   "Control Panel\\Accessibility\\Blind Access"
 
#define SPI_SETSCREENREADER_VALNAME   "On"
 
#define SPI_SETSCREENREADER_REGKEY_LEGACY   "Control Panel\\Accessibility"
 
#define SPI_SETSCREENREADER_VALNAME_LEGACY   "Blind Access"
 
#define SPI_SETFONTSMOOTHING_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETFONTSMOOTHING_VALNAME   "FontSmoothing"
 
#define SPI_SETFONTSMOOTHINGTYPE_VALNAME   "FontSmoothingType"
 
#define SPI_SETFONTSMOOTHINGCONTRAST_VALNAME   "FontSmoothingGamma"
 
#define SPI_SETFONTSMOOTHINGORIENTATION_VALNAME   "FontSmoothingOrientation"
 
#define SPI_SETLOWPOWERACTIVE_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETLOWPOWERACTIVE_VALNAME   "LowPowerActive"
 
#define SPI_SETPOWEROFFACTIVE_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETPOWEROFFACTIVE_VALNAME   "PowerOffActive"
 
#define SPI_SETDRAGFULLWINDOWS_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETDRAGFULLWINDOWS_VALNAME   "DragFullWindows"
 
#define SPI_SETSNAPTODEFBUTTON_REGKEY   "Control Panel\\Mouse"
 
#define SPI_SETSNAPTODEFBUTTON_VALNAME   "SnapToDefaultButton"
 
#define SPI_SETMOUSEHOVERWIDTH_REGKEY   "Control Panel\\Mouse"
 
#define SPI_SETMOUSEHOVERWIDTH_VALNAME   "MouseHoverWidth"
 
#define SPI_SETMOUSEHOVERHEIGHT_REGKEY   "Control Panel\\Mouse"
 
#define SPI_SETMOUSEHOVERHEIGHT_VALNAME   "MouseHoverHeight"
 
#define SPI_SETMOUSEHOVERTIME_REGKEY   "Control Panel\\Mouse"
 
#define SPI_SETMOUSEHOVERTIME_VALNAME   "MouseHoverTime"
 
#define SPI_SETMOUSESCROLLCHARS_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETMOUSESCROLLCHARS_VALNAME   "WheelScrollChars"
 
#define SPI_SETMOUSESCROLLLINES_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETMOUSESCROLLLINES_VALNAME   "WheelScrollLines"
 
#define SPI_SETMENUSHOWDELAY_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETMENUSHOWDELAY_VALNAME   "MenuShowDelay"
 
#define SPI_SETDESKWALLPAPER_REGKEY   "Control Panel\\Desktop"
 
#define SPI_SETDESKWALLPAPER_VALNAME   "Wallpaper"
 
#define WINE_CURRENT_USER_REGKEY   "Wine"
 
#define test_reg_key(subKey, valName, testValue)   _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_SZ, FALSE )
 
#define test_reg_key_optional(subKey, valName, testValue)   _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_SZ, TRUE )
 
#define test_reg_key_ex(subKey1, subKey2, valName, testValue)   _test_reg_key( subKey1, subKey2, valName, NULL, testValue, REG_SZ, FALSE )
 
#define test_reg_key_ex2(subKey1, subKey2, valName1, valName2, testValue)   _test_reg_key( subKey1, subKey2, valName1, valName2, testValue, REG_SZ, FALSE )
 
#define test_reg_key_ex2_optional(subKey1, subKey2, valName1, valName2, testValue)   _test_reg_key( subKey1, subKey2, valName1, valName2, testValue, REG_SZ, TRUE )
 
#define test_reg_key_dword(subKey, valName, testValue)   _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_DWORD, FALSE )
 
#define test_reg_metric(KEY, VAL, val)
 
#define test_reg_metric2(KEY1, KEY2, VAL, val)
 
#define test_reg_font(KEY, VAL, LF)
 
#define TEST_NONCLIENTMETRICS_REG(ncm)
 
#define ok_gsm(i, e)
 
#define ok_gsm_2(i, e1, e2)
 
#define ok_gsm_3(i, e1, e2, e3)
 

Typedefs

typedef struct LOGFONT16LPLOGFONT16
 

Functions

static LONG (WINAPI *pChangeDisplaySettingsExA)(LPCSTR
 
static BOOL (WINAPI *pIsProcessDPIAware)(void)
 
static DWORD WINAPI SysParamsThreadFunc (LPVOID lpParam)
 
static LRESULT CALLBACK SysParamsTestWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static BOOL get_reg_dword (HKEY base, const char *key_name, const char *value_name, DWORD *value)
 
static DWORD get_real_dpi (void)
 
static void test_change_message (int action, int optional)
 
static BOOL test_error_msg (int rc, const char *name)
 
static void _test_reg_key (LPCSTR subKey1, LPCSTR subKey2, LPCSTR valName1, LPCSTR valName2, const void *exp_value, DWORD exp_type, BOOL optional)
 
static UINT metricfromreg (const char *keyname, const char *valname, int dpi)
 
static int lffromreg (const char *keyname, const char *valname, LOGFONTA *plf)
 
static void test_SPI_SETBEEP (void)
 
static BOOL run_spi_setmouse_test (int curr_val[], POINT *req_change, POINT *proj_change, int nchange)
 
static void test_SPI_SETMOUSE (void)
 
static BOOL test_setborder (UINT curr_val, int usesetborder, int dpi)
 
static void test_SPI_SETBORDER (void)
 
static void test_SPI_SETKEYBOARDSPEED (void)
 
static BOOL dotest_spi_iconhorizontalspacing (INT curr_val)
 
static void test_SPI_ICONHORIZONTALSPACING (void)
 
static void test_SPI_SETSCREENSAVETIMEOUT (void)
 
static void test_SPI_SETSCREENSAVEACTIVE (void)
 
static void test_SPI_SETGRIDGRANULARITY (void)
 
static void test_SPI_SETKEYBOARDDELAY (void)
 
static BOOL dotest_spi_iconverticalspacing (INT curr_val)
 
static void test_SPI_ICONVERTICALSPACING (void)
 
static void test_SPI_SETICONTITLEWRAP (void)
 
static void test_SPI_SETMENUDROPALIGNMENT (void)
 
static void test_SPI_SETDOUBLECLKWIDTH (void)
 
static void test_SPI_SETDOUBLECLKHEIGHT (void)
 
static void test_SPI_SETDOUBLECLICKTIME (void)
 
static void test_SPI_SETMOUSEBUTTONSWAP (void)
 
static void test_SPI_SETFASTTASKSWITCH (void)
 
static void test_SPI_SETDRAGFULLWINDOWS (void)
 
static int get_tmheight (LOGFONTA *plf, int flag)
 
static void test_GetSystemMetrics (void)
 
static void test_SPI_SETNONCLIENTMETRICS (void)
 
static void test_SPI_SETMINIMIZEDMETRICS (void)
 
static void test_SPI_SETICONMETRICS (void)
 
static void test_SPI_SETWORKAREA (void)
 
static void test_SPI_SETSHOWSOUNDS (void)
 
static void test_SPI_SETKEYBOARDPREF (void)
 
static void test_SPI_SETSCREENREADER (void)
 
static void test_SPI_SETFONTSMOOTHING (void)
 
static void test_SPI_SETLOWPOWERACTIVE (void)
 
static void test_SPI_SETPOWEROFFACTIVE (void)
 
static void test_SPI_SETSNAPTODEFBUTTON (void)
 
static void test_SPI_SETMOUSEHOVERWIDTH (void)
 
static void test_SPI_SETMOUSEHOVERHEIGHT (void)
 
static void test_SPI_SETMOUSEHOVERTIME (void)
 
static void test_SPI_SETWHEELSCROLLLINES (void)
 
static void test_SPI_SETMENUSHOWDELAY (void)
 
static void test_SPI_SETWHEELSCROLLCHARS (void)
 
static void test_SPI_SETWALLPAPER (void)
 
static void test_WM_DISPLAYCHANGE (void)
 
static LONG _GdiGetCharDimensions (HDC hdc, LPTEXTMETRICA lptm, LONG *height)
 
static void get_text_metr_size (HDC hdc, LOGFONTA *plf, TEXTMETRICA *ptm, UINT *psz)
 
static INT CALLBACK enum_all_fonts_proc (const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam)
 
static BOOL is_font_enumerated (const char *name)
 
static int get_cursor_size (int size)
 
static void test_EnumDisplaySettings (void)
 
static void test_GetSysColorBrush (void)
 
static void test_dpi_aware (void)
 
static void test_GetAutoRotationState (void)
 
 START_TEST (sysparams)
 

Variables

static LPDEVMODEA
 
static HWND
 
static DWORD
 
static LPVOID
 
static BOOL strict
 
static int dpi
 
static int real_dpi
 
static BOOL iswin9x
 
static HDC hdc
 
static HWND ghTestWnd
 
static int change_counter
 
static int change_setworkarea_param
 
static int change_iconverticalspacing_param
 
static int change_last_param
 
static int last_bpp
 
static BOOL displaychange_ok = FALSE
 
static BOOL displaychange_test_active = FALSE
 
static HANDLE displaychange_sem = 0
 
static const charsetmouse_valuenames [3]
 
static UINT smcxsmsize = 999999999
 
static int gsm_error_ctr
 

Macro Definition Documentation

◆ _WIN32_IE

#define _WIN32_IE   0x0700

Definition at line 22 of file sysparams.c.

◆ _WIN32_WINNT

#define _WIN32_WINNT   0x0600 /* For SPI_GETMOUSEHOVERWIDTH and more */

Definition at line 21 of file sysparams.c.

◆ eq

#define eq (   received,
  expected,
  label,
  type 
)    ok((received) == (expected), "%s: got " type " instead of " type "\n", (label),(received),(expected))

Definition at line 53 of file sysparams.c.

◆ ok_gsm

#define ok_gsm (   i,
  e 
)
Value:
{\
int exp = (e);\
int act = GetSystemMetrics( (i));\
if( exp != act) gsm_error_ctr++;\
ok( !( exp != act),"GetSystemMetrics(%s): expected %d actual %d\n", #i, exp,act);\
}
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
#define e
Definition: ke_i.h:82
static int gsm_error_ctr
Definition: sysparams.c:2658
int WINAPI GetSystemMetrics(_In_ int)
DWORD exp
Definition: msg.c:15681

Definition at line 2660 of file sysparams.c.

◆ ok_gsm_2

#define ok_gsm_2 (   i,
  e1,
  e2 
)
Value:
{\
int exp1 = (e1);\
int exp2 = (e2);\
int act = GetSystemMetrics( (i));\
if( exp1 != act && exp2 != act) gsm_error_ctr++;\
ok( !( exp1 != act && exp2 != act), "GetSystemMetrics(%s): expected %d or %d actual %d\n", #i, exp1, exp2, act);\
}
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 int gsm_error_ctr
Definition: sysparams.c:2658
int WINAPI GetSystemMetrics(_In_ int)
double __cdecl exp2(double)

Definition at line 2667 of file sysparams.c.

◆ ok_gsm_3

#define ok_gsm_3 (   i,
  e1,
  e2,
  e3 
)
Value:
{\
int exp1 = (e1);\
int exp2 = (e2);\
int exp3 = (e3);\
int act = GetSystemMetrics( (i));\
if( exp1 != act && exp2 != act && exp3 != act) gsm_error_ctr++;\
ok( !( exp1 != act && exp2 != act && exp3 != act),"GetSystemMetrics(%s): expected %d or %d or %d actual %d\n", #i, exp1, exp2, exp3, act);\
}
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 int gsm_error_ctr
Definition: sysparams.c:2658
int WINAPI GetSystemMetrics(_In_ int)
double __cdecl exp2(double)

Definition at line 2675 of file sysparams.c.

◆ SPI_CAPTIONFONT_VALNAME

#define SPI_CAPTIONFONT_VALNAME   "CaptionFont"

Definition at line 71 of file sysparams.c.

◆ SPI_CAPTIONHEIGHT_VALNAME

#define SPI_CAPTIONHEIGHT_VALNAME   "CaptionHeight"

Definition at line 70 of file sysparams.c.

◆ SPI_CAPTIONWIDTH_VALNAME

#define SPI_CAPTIONWIDTH_VALNAME   "CaptionWidth"

Definition at line 69 of file sysparams.c.

◆ SPI_GETDESKWALLPAPER

#define SPI_GETDESKWALLPAPER   0x0073

Definition at line 40 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_REGKEY

#define SPI_ICONHORIZONTALSPACING_REGKEY   "Control Panel\\Desktop\\WindowMetrics"

Definition at line 83 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_REGKEY2

#define SPI_ICONHORIZONTALSPACING_REGKEY2   "Control Panel\\Desktop"

Definition at line 84 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_VALNAME

#define SPI_ICONHORIZONTALSPACING_VALNAME   "IconSpacing"

Definition at line 85 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_REGKEY

#define SPI_ICONVERTICALSPACING_REGKEY   "Control Panel\\Desktop\\WindowMetrics"

Definition at line 86 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_REGKEY2

#define SPI_ICONVERTICALSPACING_REGKEY2   "Control Panel\\Desktop"

Definition at line 87 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_VALNAME

#define SPI_ICONVERTICALSPACING_VALNAME   "IconVerticalSpacing"

Definition at line 88 of file sysparams.c.

◆ SPI_MENUFONT_VALNAME

#define SPI_MENUFONT_VALNAME   "MenuFont"

Definition at line 77 of file sysparams.c.

◆ SPI_MENUHEIGHT_VALNAME

#define SPI_MENUHEIGHT_VALNAME   "MenuHeight"

Definition at line 76 of file sysparams.c.

◆ SPI_MENUWIDTH_VALNAME

#define SPI_MENUWIDTH_VALNAME   "MenuWidth"

Definition at line 75 of file sysparams.c.

◆ SPI_MESSAGEFONT_VALNAME

#define SPI_MESSAGEFONT_VALNAME   "MessageFont"

Definition at line 79 of file sysparams.c.

◆ SPI_METRIC_REGKEY

#define SPI_METRIC_REGKEY   "Control Panel\\Desktop\\WindowMetrics"

Definition at line 66 of file sysparams.c.

◆ SPI_MINARRANGE_VALNAME

#define SPI_MINARRANGE_VALNAME   "MinArrange"

Definition at line 93 of file sysparams.c.

◆ SPI_MINHORZGAP_VALNAME

#define SPI_MINHORZGAP_VALNAME   "MinHorzGap"

Definition at line 91 of file sysparams.c.

◆ SPI_MINIMIZEDMETRICS_REGKEY

#define SPI_MINIMIZEDMETRICS_REGKEY   "Control Panel\\Desktop\\WindowMetrics"

Definition at line 89 of file sysparams.c.

◆ SPI_MINVERTGAP_VALNAME

#define SPI_MINVERTGAP_VALNAME   "MinVertGap"

Definition at line 92 of file sysparams.c.

◆ SPI_MINWIDTH_VALNAME

#define SPI_MINWIDTH_VALNAME   "MinWidth"

Definition at line 90 of file sysparams.c.

◆ SPI_SCROLLHEIGHT_VALNAME

#define SPI_SCROLLHEIGHT_VALNAME   "ScrollHeight"

Definition at line 68 of file sysparams.c.

◆ SPI_SCROLLWIDTH_VALNAME

#define SPI_SCROLLWIDTH_VALNAME   "ScrollWidth"

Definition at line 67 of file sysparams.c.

◆ SPI_SETBEEP_REGKEY

#define SPI_SETBEEP_REGKEY   "Control Panel\\Sound"

Definition at line 57 of file sysparams.c.

◆ SPI_SETBEEP_VALNAME

#define SPI_SETBEEP_VALNAME   "Beep"

Definition at line 58 of file sysparams.c.

◆ SPI_SETBORDER_REGKEY

#define SPI_SETBORDER_REGKEY   "Control Panel\\Desktop\\WindowMetrics"

Definition at line 63 of file sysparams.c.

◆ SPI_SETBORDER_REGKEY2

#define SPI_SETBORDER_REGKEY2   "Control Panel\\Desktop"

Definition at line 64 of file sysparams.c.

◆ SPI_SETBORDER_VALNAME

#define SPI_SETBORDER_VALNAME   "BorderWidth"

Definition at line 65 of file sysparams.c.

◆ SPI_SETDESKWALLPAPER_REGKEY

#define SPI_SETDESKWALLPAPER_REGKEY   "Control Panel\\Desktop"

Definition at line 155 of file sysparams.c.

◆ SPI_SETDESKWALLPAPER_VALNAME

#define SPI_SETDESKWALLPAPER_VALNAME   "Wallpaper"

Definition at line 156 of file sysparams.c.

◆ SPI_SETDOUBLECLICKTIME_REGKEY

#define SPI_SETDOUBLECLICKTIME_REGKEY   "Control Panel\\Mouse"

Definition at line 114 of file sysparams.c.

◆ SPI_SETDOUBLECLICKTIME_VALNAME

#define SPI_SETDOUBLECLICKTIME_VALNAME   "DoubleClickSpeed"

Definition at line 115 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_REGKEY1

#define SPI_SETDOUBLECLKHEIGHT_REGKEY1   "Control Panel\\Mouse"

Definition at line 111 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_REGKEY2

#define SPI_SETDOUBLECLKHEIGHT_REGKEY2   "Control Panel\\Desktop"

Definition at line 112 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_VALNAME

#define SPI_SETDOUBLECLKHEIGHT_VALNAME   "DoubleClickHeight"

Definition at line 113 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_REGKEY1

#define SPI_SETDOUBLECLKWIDTH_REGKEY1   "Control Panel\\Mouse"

Definition at line 108 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_REGKEY2

#define SPI_SETDOUBLECLKWIDTH_REGKEY2   "Control Panel\\Desktop"

Definition at line 109 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_VALNAME

#define SPI_SETDOUBLECLKWIDTH_VALNAME   "DoubleClickWidth"

Definition at line 110 of file sysparams.c.

◆ SPI_SETDRAGFULLWINDOWS_REGKEY

#define SPI_SETDRAGFULLWINDOWS_REGKEY   "Control Panel\\Desktop"

Definition at line 139 of file sysparams.c.

◆ SPI_SETDRAGFULLWINDOWS_VALNAME

#define SPI_SETDRAGFULLWINDOWS_VALNAME   "DragFullWindows"

Definition at line 140 of file sysparams.c.

◆ SPI_SETFONTSMOOTHING_REGKEY

#define SPI_SETFONTSMOOTHING_REGKEY   "Control Panel\\Desktop"

Definition at line 130 of file sysparams.c.

◆ SPI_SETFONTSMOOTHING_VALNAME

#define SPI_SETFONTSMOOTHING_VALNAME   "FontSmoothing"

Definition at line 131 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGCONTRAST_VALNAME

#define SPI_SETFONTSMOOTHINGCONTRAST_VALNAME   "FontSmoothingGamma"

Definition at line 133 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGORIENTATION_VALNAME

#define SPI_SETFONTSMOOTHINGORIENTATION_VALNAME   "FontSmoothingOrientation"

Definition at line 134 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGTYPE_VALNAME

#define SPI_SETFONTSMOOTHINGTYPE_VALNAME   "FontSmoothingType"

Definition at line 132 of file sysparams.c.

◆ SPI_SETGRIDGRANULARITY_REGKEY

#define SPI_SETGRIDGRANULARITY_REGKEY   "Control Panel\\Desktop"

Definition at line 98 of file sysparams.c.

◆ SPI_SETGRIDGRANULARITY_VALNAME

#define SPI_SETGRIDGRANULARITY_VALNAME   "GridGranularity"

Definition at line 99 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_REGKEY1

#define SPI_SETICONTITLEWRAP_REGKEY1   "Control Panel\\Desktop\\WindowMetrics"

Definition at line 102 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_REGKEY2

#define SPI_SETICONTITLEWRAP_REGKEY2   "Control Panel\\Desktop"

Definition at line 103 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_VALNAME

#define SPI_SETICONTITLEWRAP_VALNAME   "IconTitleWrap"

Definition at line 104 of file sysparams.c.

◆ SPI_SETKEYBOARDDELAY_REGKEY

#define SPI_SETKEYBOARDDELAY_REGKEY   "Control Panel\\Keyboard"

Definition at line 100 of file sysparams.c.

◆ SPI_SETKEYBOARDDELAY_VALNAME

#define SPI_SETKEYBOARDDELAY_VALNAME   "KeyboardDelay"

Definition at line 101 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_REGKEY

#define SPI_SETKEYBOARDPREF_REGKEY   "Control Panel\\Accessibility\\Keyboard Preference"

Definition at line 122 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_REGKEY_LEGACY

#define SPI_SETKEYBOARDPREF_REGKEY_LEGACY   "Control Panel\\Accessibility"

Definition at line 124 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_VALNAME

#define SPI_SETKEYBOARDPREF_VALNAME   "On"

Definition at line 123 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_VALNAME_LEGACY

#define SPI_SETKEYBOARDPREF_VALNAME_LEGACY   "Keyboard Preference"

Definition at line 125 of file sysparams.c.

◆ SPI_SETKEYBOARDSPEED_REGKEY

#define SPI_SETKEYBOARDSPEED_REGKEY   "Control Panel\\Keyboard"

Definition at line 81 of file sysparams.c.

◆ SPI_SETKEYBOARDSPEED_VALNAME

#define SPI_SETKEYBOARDSPEED_VALNAME   "KeyboardSpeed"

Definition at line 82 of file sysparams.c.

◆ SPI_SETLOWPOWERACTIVE_REGKEY

#define SPI_SETLOWPOWERACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 135 of file sysparams.c.

◆ SPI_SETLOWPOWERACTIVE_VALNAME

#define SPI_SETLOWPOWERACTIVE_VALNAME   "LowPowerActive"

Definition at line 136 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_REGKEY1

#define SPI_SETMENUDROPALIGNMENT_REGKEY1   "Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"

Definition at line 105 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_REGKEY2

#define SPI_SETMENUDROPALIGNMENT_REGKEY2   "Control Panel\\Desktop"

Definition at line 106 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_VALNAME

#define SPI_SETMENUDROPALIGNMENT_VALNAME   "MenuDropAlignment"

Definition at line 107 of file sysparams.c.

◆ SPI_SETMENUSHOWDELAY_REGKEY

#define SPI_SETMENUSHOWDELAY_REGKEY   "Control Panel\\Desktop"

Definition at line 153 of file sysparams.c.

◆ SPI_SETMENUSHOWDELAY_VALNAME

#define SPI_SETMENUSHOWDELAY_VALNAME   "MenuShowDelay"

Definition at line 154 of file sysparams.c.

◆ SPI_SETMOUSE_REGKEY

#define SPI_SETMOUSE_REGKEY   "Control Panel\\Mouse"

Definition at line 59 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME1

#define SPI_SETMOUSE_VALNAME1   "MouseThreshold1"

Definition at line 60 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME2

#define SPI_SETMOUSE_VALNAME2   "MouseThreshold2"

Definition at line 61 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME3

#define SPI_SETMOUSE_VALNAME3   "MouseSpeed"

Definition at line 62 of file sysparams.c.

◆ SPI_SETMOUSEBUTTONSWAP_REGKEY

#define SPI_SETMOUSEBUTTONSWAP_REGKEY   "Control Panel\\Mouse"

Definition at line 116 of file sysparams.c.

◆ SPI_SETMOUSEBUTTONSWAP_VALNAME

#define SPI_SETMOUSEBUTTONSWAP_VALNAME   "SwapMouseButtons"

Definition at line 117 of file sysparams.c.

◆ SPI_SETMOUSEHOVERHEIGHT_REGKEY

#define SPI_SETMOUSEHOVERHEIGHT_REGKEY   "Control Panel\\Mouse"

Definition at line 145 of file sysparams.c.

◆ SPI_SETMOUSEHOVERHEIGHT_VALNAME

#define SPI_SETMOUSEHOVERHEIGHT_VALNAME   "MouseHoverHeight"

Definition at line 146 of file sysparams.c.

◆ SPI_SETMOUSEHOVERTIME_REGKEY

#define SPI_SETMOUSEHOVERTIME_REGKEY   "Control Panel\\Mouse"

Definition at line 147 of file sysparams.c.

◆ SPI_SETMOUSEHOVERTIME_VALNAME

#define SPI_SETMOUSEHOVERTIME_VALNAME   "MouseHoverTime"

Definition at line 148 of file sysparams.c.

◆ SPI_SETMOUSEHOVERWIDTH_REGKEY

#define SPI_SETMOUSEHOVERWIDTH_REGKEY   "Control Panel\\Mouse"

Definition at line 143 of file sysparams.c.

◆ SPI_SETMOUSEHOVERWIDTH_VALNAME

#define SPI_SETMOUSEHOVERWIDTH_VALNAME   "MouseHoverWidth"

Definition at line 144 of file sysparams.c.

◆ SPI_SETMOUSESCROLLCHARS_REGKEY

#define SPI_SETMOUSESCROLLCHARS_REGKEY   "Control Panel\\Desktop"

Definition at line 149 of file sysparams.c.

◆ SPI_SETMOUSESCROLLCHARS_VALNAME

#define SPI_SETMOUSESCROLLCHARS_VALNAME   "WheelScrollChars"

Definition at line 150 of file sysparams.c.

◆ SPI_SETMOUSESCROLLLINES_REGKEY

#define SPI_SETMOUSESCROLLLINES_REGKEY   "Control Panel\\Desktop"

Definition at line 151 of file sysparams.c.

◆ SPI_SETMOUSESCROLLLINES_VALNAME

#define SPI_SETMOUSESCROLLLINES_VALNAME   "WheelScrollLines"

Definition at line 152 of file sysparams.c.

◆ SPI_SETPOWEROFFACTIVE_REGKEY

#define SPI_SETPOWEROFFACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 137 of file sysparams.c.

◆ SPI_SETPOWEROFFACTIVE_VALNAME

#define SPI_SETPOWEROFFACTIVE_VALNAME   "PowerOffActive"

Definition at line 138 of file sysparams.c.

◆ SPI_SETSCREENREADER_REGKEY

#define SPI_SETSCREENREADER_REGKEY   "Control Panel\\Accessibility\\Blind Access"

Definition at line 126 of file sysparams.c.

◆ SPI_SETSCREENREADER_REGKEY_LEGACY

#define SPI_SETSCREENREADER_REGKEY_LEGACY   "Control Panel\\Accessibility"

Definition at line 128 of file sysparams.c.

◆ SPI_SETSCREENREADER_VALNAME

#define SPI_SETSCREENREADER_VALNAME   "On"

Definition at line 127 of file sysparams.c.

◆ SPI_SETSCREENREADER_VALNAME_LEGACY

#define SPI_SETSCREENREADER_VALNAME_LEGACY   "Blind Access"

Definition at line 129 of file sysparams.c.

◆ SPI_SETSCREENSAVEACTIVE_REGKEY

#define SPI_SETSCREENSAVEACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 96 of file sysparams.c.

◆ SPI_SETSCREENSAVEACTIVE_VALNAME

#define SPI_SETSCREENSAVEACTIVE_VALNAME   "ScreenSaveActive"

Definition at line 97 of file sysparams.c.

◆ SPI_SETSCREENSAVETIMEOUT_REGKEY

#define SPI_SETSCREENSAVETIMEOUT_REGKEY   "Control Panel\\Desktop"

Definition at line 94 of file sysparams.c.

◆ SPI_SETSCREENSAVETIMEOUT_VALNAME

#define SPI_SETSCREENSAVETIMEOUT_VALNAME   "ScreenSaveTimeOut"

Definition at line 95 of file sysparams.c.

◆ SPI_SETSHOWSOUNDS_REGKEY

#define SPI_SETSHOWSOUNDS_REGKEY   "Control Panel\\Accessibility\\ShowSounds"

Definition at line 120 of file sysparams.c.

◆ SPI_SETSHOWSOUNDS_VALNAME

#define SPI_SETSHOWSOUNDS_VALNAME   "On"

Definition at line 121 of file sysparams.c.

◆ SPI_SETSNAPTODEFBUTTON_REGKEY

#define SPI_SETSNAPTODEFBUTTON_REGKEY   "Control Panel\\Mouse"

Definition at line 141 of file sysparams.c.

◆ SPI_SETSNAPTODEFBUTTON_VALNAME

#define SPI_SETSNAPTODEFBUTTON_VALNAME   "SnapToDefaultButton"

Definition at line 142 of file sysparams.c.

◆ SPI_SETWORKAREA_REGKEY

#define SPI_SETWORKAREA_REGKEY   "Control Panel\\Desktop"

Definition at line 118 of file sysparams.c.

◆ SPI_SETWORKAREA_VALNAME

#define SPI_SETWORKAREA_VALNAME   "WINE_WorkArea"

Definition at line 119 of file sysparams.c.

◆ SPI_SMCAPTIONFONT_VALNAME

#define SPI_SMCAPTIONFONT_VALNAME   "SmCaptionFont"

Definition at line 74 of file sysparams.c.

◆ SPI_SMCAPTIONHEIGHT_VALNAME

#define SPI_SMCAPTIONHEIGHT_VALNAME   "SmCaptionHeight"

Definition at line 73 of file sysparams.c.

◆ SPI_SMCAPTIONWIDTH_VALNAME

#define SPI_SMCAPTIONWIDTH_VALNAME   "SmCaptionWidth"

Definition at line 72 of file sysparams.c.

◆ SPI_STATUSFONT_VALNAME

#define SPI_STATUSFONT_VALNAME   "StatusFont"

Definition at line 78 of file sysparams.c.

◆ TEST_NONCLIENTMETRICS_REG

#define TEST_NONCLIENTMETRICS_REG (   ncm)
Value:
/*FIXME: test_reg_metric2( SPI_SETBORDER_REGKEY2, SPI_SETBORDER_REGKEY, SPI_SETBORDER_VALNAME, (ncm).iBorderWidth);*/\
test_reg_metric( SPI_METRIC_REGKEY, SPI_SCROLLWIDTH_VALNAME, (ncm).iScrollWidth);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_SCROLLHEIGHT_VALNAME, (ncm).iScrollHeight);\
/*FIXME: test_reg_metric( SPI_METRIC_REGKEY, SPI_CAPTIONWIDTH_VALNAME, (ncm).iCaptionWidth);*/\
test_reg_metric( SPI_METRIC_REGKEY, SPI_CAPTIONHEIGHT_VALNAME, (ncm).iCaptionHeight);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_SMCAPTIONWIDTH_VALNAME, (ncm).iSmCaptionWidth);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_SMCAPTIONHEIGHT_VALNAME, (ncm).iSmCaptionHeight);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_MENUWIDTH_VALNAME, (ncm).iMenuWidth);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_MENUHEIGHT_VALNAME, (ncm).iMenuHeight);\
test_reg_font( SPI_METRIC_REGKEY, SPI_MENUFONT_VALNAME, (ncm).lfMenuFont);\
test_reg_font( SPI_METRIC_REGKEY, SPI_CAPTIONFONT_VALNAME, (ncm).lfCaptionFont);\
test_reg_font( SPI_METRIC_REGKEY, SPI_SMCAPTIONFONT_VALNAME, (ncm).lfSmCaptionFont);\
test_reg_font( SPI_METRIC_REGKEY, SPI_STATUSFONT_VALNAME, (ncm).lfStatusFont);\
test_reg_font( SPI_METRIC_REGKEY, SPI_MESSAGEFONT_VALNAME, (ncm).lfMessageFont);
#define SPI_CAPTIONHEIGHT_VALNAME
Definition: sysparams.c:70
#define SPI_MESSAGEFONT_VALNAME
Definition: sysparams.c:79
#define SPI_MENUHEIGHT_VALNAME
Definition: sysparams.c:76
#define SPI_SCROLLWIDTH_VALNAME
Definition: sysparams.c:67
#define SPI_STATUSFONT_VALNAME
Definition: sysparams.c:78
#define SPI_METRIC_REGKEY
Definition: sysparams.c:66
#define SPI_SCROLLHEIGHT_VALNAME
Definition: sysparams.c:68
#define SPI_MENUFONT_VALNAME
Definition: sysparams.c:77
#define SPI_SMCAPTIONWIDTH_VALNAME
Definition: sysparams.c:72
#define SPI_SMCAPTIONFONT_VALNAME
Definition: sysparams.c:74
#define SPI_MENUWIDTH_VALNAME
Definition: sysparams.c:75
#define SPI_CAPTIONFONT_VALNAME
Definition: sysparams.c:71
#define SPI_SMCAPTIONHEIGHT_VALNAME
Definition: sysparams.c:73

Definition at line 1457 of file sysparams.c.

◆ test_reg_font

#define test_reg_font (   KEY,
  VAL,
  LF 
)
Value:
{ LOGFONTA lfreg;\
lffromreg( KEY, VAL, &lfreg);\
ok( (lfreg.lfHeight < 0 ? (LF).lfHeight == MulDiv( lfreg.lfHeight, dpi, real_dpi ) : \
MulDiv( -(LF).lfHeight , 72, dpi) == lfreg.lfHeight )&&\
(LF).lfWidth == lfreg.lfWidth &&\
(LF).lfWeight == lfreg.lfWeight &&\
!strcmp( (LF).lfFaceName, lfreg.lfFaceName)\
, "wrong value \"%s\" in registry %d, %d\n", VAL, (LF).lfHeight, lfreg.lfHeight);\
}
#define VAL(data, px, pl, pos)
Definition: driver.h:91
LONG lfHeight
Definition: dimm.idl:42
LONG lfWeight
Definition: dimm.idl:46
#define LF
Definition: telnetd.h:24
LONG lfWidth
Definition: dimm.idl:43
Definition: btrfs.h:125
static int real_dpi
Definition: sysparams.c:49
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
static int dpi
Definition: sysparams.c:49
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Definition at line 1446 of file sysparams.c.

◆ test_reg_key

#define test_reg_key (   subKey,
  valName,
  testValue 
)    _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_SZ, FALSE )

Definition at line 446 of file sysparams.c.

◆ test_reg_key_dword

#define test_reg_key_dword (   subKey,
  valName,
  testValue 
)    _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_DWORD, FALSE )

Definition at line 456 of file sysparams.c.

◆ test_reg_key_ex

#define test_reg_key_ex (   subKey1,
  subKey2,
  valName,
  testValue 
)    _test_reg_key( subKey1, subKey2, valName, NULL, testValue, REG_SZ, FALSE )

Definition at line 450 of file sysparams.c.

◆ test_reg_key_ex2

#define test_reg_key_ex2 (   subKey1,
  subKey2,
  valName1,
  valName2,
  testValue 
)    _test_reg_key( subKey1, subKey2, valName1, valName2, testValue, REG_SZ, FALSE )

Definition at line 452 of file sysparams.c.

◆ test_reg_key_ex2_optional

#define test_reg_key_ex2_optional (   subKey1,
  subKey2,
  valName1,
  valName2,
  testValue 
)    _test_reg_key( subKey1, subKey2, valName1, valName2, testValue, REG_SZ, TRUE )

Definition at line 454 of file sysparams.c.

◆ test_reg_key_optional

#define test_reg_key_optional (   subKey,
  valName,
  testValue 
)    _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_SZ, TRUE )

Definition at line 448 of file sysparams.c.

◆ test_reg_metric

#define test_reg_metric (   KEY,
  VAL,
  val 
)
Value:
{ INT regval;\
regval = metricfromreg( KEY, VAL, dpi);\
ok( regval==val, "wrong value \"%s\" in registry %d, expected %d\n", VAL, regval, val);\
}
#define VAL(data, px, pl, pos)
Definition: driver.h:91
int32_t INT
Definition: typedefs.h:56
GLuint GLfloat * val
Definition: glext.h:7180
Definition: btrfs.h:125
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:461
static int dpi
Definition: sysparams.c:49

Definition at line 1433 of file sysparams.c.

◆ test_reg_metric2

#define test_reg_metric2 (   KEY1,
  KEY2,
  VAL,
  val 
)
Value:
{ INT regval;\
regval = metricfromreg( KEY1, VAL, dpi);\
if( regval != val) regval = metricfromreg( KEY2, VAL, dpi);\
ok( regval==val, "wrong value \"%s\" in registry %d, expected %d\n", VAL, regval, val);\
}
#define VAL(data, px, pl, pos)
Definition: driver.h:91
int32_t INT
Definition: typedefs.h:56
GLuint GLfloat * val
Definition: glext.h:7180
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:461
static int dpi
Definition: sysparams.c:49

Definition at line 1439 of file sysparams.c.

◆ WINE_CURRENT_USER_REGKEY

#define WINE_CURRENT_USER_REGKEY   "Wine"

Definition at line 159 of file sysparams.c.

◆ WINVER

#define WINVER   0x0600 /* For COLOR_MENUBAR, NONCLIENTMETRICS with padding */

Definition at line 23 of file sysparams.c.

Typedef Documentation

◆ LPLOGFONT16

Function Documentation

◆ _GdiGetCharDimensions()

static LONG _GdiGetCharDimensions ( HDC  hdc,
LPTEXTMETRICA  lptm,
LONG height 
)
static

Definition at line 2620 of file sysparams.c.

2621 {
2622  SIZE sz;
2623  static const CHAR alphabet[] = {
2624  'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
2625  'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
2626  'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
2627 
2628  if(lptm && !GetTextMetricsA(hdc, lptm)) return 0;
2629 
2630  if(!GetTextExtentPointA(hdc, alphabet, 52, &sz)) return 0;
2631 
2632  if (height) *height = sz.cy;
2633  return (sz.cx / 26 + 1) / 2;
2634 }
BOOL WINAPI GetTextExtentPointA(_In_ HDC hdc, _In_reads_(c) LPCSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
char CHAR
Definition: xmlstorage.h:175
static HDC hdc
Definition: sysparams.c:51
LONG cx
Definition: windef.h:319
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
LONG cy
Definition: windef.h:320
static LPTEXTMETRICW lptm
Definition: font.c:42

Referenced by get_text_metr_size().

◆ _test_reg_key()

static void _test_reg_key ( LPCSTR  subKey1,
LPCSTR  subKey2,
LPCSTR  valName1,
LPCSTR  valName2,
const void exp_value,
DWORD  exp_type,
BOOL  optional 
)
static

Definition at line 310 of file sysparams.c.

312 {
314  DWORD valueLen;
315  DWORD type;
316  HKEY hKey;
317  LONG rc;
318  int found=0;
319 
320  *value='\0';
321  valueLen=sizeof(value);
322  RegOpenKeyA( HKEY_CURRENT_USER, subKey1, &hKey );
323  rc=RegQueryValueExA( hKey, valName1, NULL, &type, (LPBYTE)value, &valueLen );
324  RegCloseKey( hKey );
325  if (rc==ERROR_SUCCESS)
326  {
327  ok( type == exp_type, "wrong type %u/%u\n", type, exp_type );
328  switch (exp_type)
329  {
330  case REG_DWORD:
331  ok( *(DWORD *)value == *(DWORD *)exp_value,
332  "Wrong value in registry: %s %s %08x/%08x\n",
333  subKey1, valName1, *(DWORD *)value, *(DWORD *)exp_value );
334  break;
335  case REG_SZ:
336  ok( !strcmp( exp_value, value ),
337  "Wrong value in registry: %s %s '%s' instead of '%s'\n",
338  subKey1, valName1, value, (const char *)exp_value );
339  break;
340  }
341  found++;
342  }
343  else if (strict)
344  {
345  ok(0,"Missing registry entry: subKey=%s, valName=%s\n",
346  subKey1, valName1);
347  }
348  if (valName2)
349  {
350  *value='\0';
351  valueLen=sizeof(value);
352  RegOpenKeyA( HKEY_CURRENT_USER, subKey1, &hKey );
353  rc=RegQueryValueExA( hKey, valName2, NULL, &type, (LPBYTE)value, &valueLen );
354  RegCloseKey( hKey );
355  if (rc==ERROR_SUCCESS)
356  {
357  ok( type == exp_type, "wrong type %u/%u\n", type, exp_type );
358  switch (exp_type)
359  {
360  case REG_DWORD:
361  ok( *(DWORD *)value == *(DWORD *)exp_value,
362  "Wrong value in registry: %s %s %08x/%08x\n",
363  subKey1, valName1, *(DWORD *)value, *(DWORD *)exp_value );
364  break;
365  case REG_SZ:
366  ok( !strcmp( exp_value, value ),
367  "Wrong value in registry: %s %s '%s' instead of '%s'\n",
368  subKey1, valName1, value, (const char *)exp_value );
369  break;
370  }
371  found++;
372  }
373  else if (strict)
374  {
375  ok( 0,"Missing registry entry: subKey=%s, valName=%s\n",
376  subKey1, valName2 );
377  }
378  }
379  if (subKey2 && !strict)
380  {
381  *value='\0';
382  valueLen=sizeof(value);
383  RegOpenKeyA( HKEY_CURRENT_USER, subKey2, &hKey );
384  rc=RegQueryValueExA( hKey, valName1, NULL, &type, (LPBYTE)value, &valueLen );
385  RegCloseKey( hKey );
386  if (rc==ERROR_SUCCESS)
387  {
388  ok( type == exp_type, "wrong type %u/%u\n", type, exp_type );
389  switch (exp_type)
390  {
391  case REG_DWORD:
392  ok( *(DWORD *)value == *(DWORD *)exp_value,
393  "Wrong value in registry: %s %s %08x/%08x\n",
394  subKey1, valName1, *(DWORD *)value, *(DWORD *)exp_value );
395  break;
396  case REG_SZ:
397  ok( !strcmp( exp_value, value ),
398  "Wrong value in registry: %s %s '%s' instead of '%s'\n",
399  subKey1, valName1, value, (const char *)exp_value );
400  break;
401  }
402  found++;
403  }
404  else if (strict)
405  {
406  ok( 0,"Missing registry entry: subKey=%s, valName=%s\n",
407  subKey2, valName1 );
408  }
409  if (valName2)
410  {
411  *value='\0';
412  valueLen=sizeof(value);
413  RegOpenKeyA( HKEY_CURRENT_USER, subKey2, &hKey );
414  rc=RegQueryValueExA( hKey, valName2, NULL, &type, (LPBYTE)value, &valueLen );
415  RegCloseKey( hKey );
416  if (rc==ERROR_SUCCESS)
417  {
418  ok( type == exp_type, "wrong type %u/%u\n", type, exp_type );
419  switch (exp_type)
420  {
421  case REG_DWORD:
422  ok( *(DWORD *)value == *(DWORD *)exp_value,
423  "Wrong value in registry: %s %s %08x/%08x\n",
424  subKey1, valName1, *(DWORD *)value, *(DWORD *)exp_value );
425  break;
426  case REG_SZ:
427  ok( !strcmp( exp_value, value ),
428  "Wrong value in registry: %s %s '%s' instead of '%s'\n",
429  subKey1, valName1, value, (const char *)exp_value );
430  break;
431  }
432  found++;
433  }
434  else if (strict)
435  {
436  ok( 0,"Missing registry entry: subKey=%s, valName=%s\n",
437  subKey2, valName2 );
438  }
439  }
440  }
441  ok(found || optional,
442  "Missing registry values: %s or %s in keys: %s or %s\n",
443  valName1, (valName2?valName2:"<n/a>"), subKey1, (subKey2?subKey2:"<n/a>") );
444 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define ERROR_SUCCESS
Definition: deptool.c:10
#define HKEY_CURRENT_USER
Definition: winreg.h:11
char CHAR
Definition: xmlstorage.h:175
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
Definition: msg.h:41
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL strict
Definition: sysparams.c:48
GLsizei const GLfloat * value
Definition: glext.h:6069
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define REG_DWORD
Definition: sdbapi.c:596
#define REG_SZ
Definition: layer.c:22

◆ BOOL()

static BOOL ( WINAPI pIsProcessDPIAware)
static

◆ dotest_spi_iconhorizontalspacing()

static BOOL dotest_spi_iconhorizontalspacing ( INT  curr_val)
static

Definition at line 906 of file sysparams.c.

907 {
908  BOOL rc;
909  INT spacing, regval, min_val = MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI );
910  ICONMETRICSA im;
911 
914  if (!test_error_msg(rc,"SPI_ICONHORIZONTALSPACING")) return FALSE;
915  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
917  curr_val = max( curr_val, min_val );
918  /* The registry keys depend on the Windows version and the values too
919  * let's test (works on win95,ME,NT4,2k,XP)
920  */
922  if( regval != curr_val)
924  ok( curr_val == regval,
925  "wrong value in registry %d, expected %d\n", regval, curr_val);
926  /* compare with what SPI_ICONHORIZONTALSPACING returns */
927  rc=SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0, &spacing, 0 );
928  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
929  eq( spacing, curr_val, "ICONHORIZONTALSPACING", "%d");
930  /* and with a system metrics */
931  eq( GetSystemMetrics( SM_CXICONSPACING ), curr_val, "SM_CXICONSPACING", "%d" );
932  /* and with what SPI_GETICONMETRICS returns */
933  im.cbSize = sizeof(ICONMETRICSA);
934  rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im, FALSE );
935  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
936  eq( im.iHorzSpacing, curr_val, "SPI_GETICONMETRICS", "%d" );
937  return TRUE;
938 }
#define SM_CXICONSPACING
Definition: winuser.h:991
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
#define SPI_ICONHORIZONTALSPACING
Definition: winuser.h:1344
#define SPI_ICONHORIZONTALSPACING_REGKEY2
Definition: sysparams.c:84
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SPI_ICONHORIZONTALSPACING_REGKEY
Definition: sysparams.c:83
int WINAPI GetSystemMetrics(_In_ int)
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:461
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2846
static int dpi
Definition: sysparams.c:49
#define eq(received, expected, label, type)
Definition: sysparams.c:53
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define SPI_ICONHORIZONTALSPACING_VALNAME
Definition: sysparams.c:85

Referenced by test_SPI_ICONHORIZONTALSPACING().

◆ dotest_spi_iconverticalspacing()

static BOOL dotest_spi_iconverticalspacing ( INT  curr_val)
static

Definition at line 1075 of file sysparams.c.

1076 {
1077  BOOL rc;
1078  INT spacing, regval, min_val = MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI );
1079  ICONMETRICSA im;
1080 
1083  if (!test_error_msg(rc,"SPI_ICONVERTICALSPACING")) return FALSE;
1084  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1086  curr_val = max( curr_val, min_val );
1087  /* The registry keys depend on the Windows version and the values too
1088  * let's test (works on win95,ME,NT4,2k,XP)
1089  */
1091  if( regval != curr_val)
1093  ok( curr_val == regval,
1094  "wrong value in registry %d, expected %d\n", regval, curr_val);
1095  /* compare with what SPI_ICONVERTICALSPACING returns */
1096  rc=SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0, &spacing, 0 );
1097  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1098  eq( spacing, curr_val, "ICONVERTICALSPACING", "%d" );
1099  /* and with a system metrics */
1100  eq( GetSystemMetrics( SM_CYICONSPACING ), curr_val, "SM_CYICONSPACING", "%d" );
1101  /* and with what SPI_GETICONMETRICS returns */
1102  im.cbSize = sizeof(ICONMETRICSA);
1103  rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im, FALSE );
1104  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1105  eq( im.iVertSpacing, curr_val, "SPI_GETICONMETRICS", "%d" );
1106  return TRUE;
1107 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
int32_t INT
Definition: typedefs.h:56
#define SPI_ICONVERTICALSPACING_REGKEY2
Definition: sysparams.c:87
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
int WINAPI GetSystemMetrics(_In_ int)
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SM_CYICONSPACING
Definition: winuser.h:992
#define SPI_ICONVERTICALSPACING_REGKEY
Definition: sysparams.c:86
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:461
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2846
static int dpi
Definition: sysparams.c:49
#define eq(received, expected, label, type)
Definition: sysparams.c:53
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define SPI_ICONVERTICALSPACING_VALNAME
Definition: sysparams.c:88

Referenced by test_SPI_ICONVERTICALSPACING().

◆ enum_all_fonts_proc()

static INT CALLBACK enum_all_fonts_proc ( const LOGFONTA elf,
const TEXTMETRICA ntm,
DWORD  type,
LPARAM  lparam 
)
static

Definition at line 2685 of file sysparams.c.

2686 {
2687  return lstrcmpiA(elf->lfFaceName, (const char *)lparam);
2688 }
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55

Referenced by is_font_enumerated().

◆ get_cursor_size()

static int get_cursor_size ( int  size)
static

Definition at line 2702 of file sysparams.c.

2703 {
2704  /* only certain sizes are allowed for cursors */
2705  if (size >= 64) return 64;
2706  if (size >= 48) return 48;
2707  return 32;
2708 }
GLsizeiptr size
Definition: glext.h:5919

Referenced by test_GetSystemMetrics().

◆ get_real_dpi()

static DWORD get_real_dpi ( void  )
static

Definition at line 192 of file sysparams.c.

193 {
194  DWORD dpi;
195 
196  if (get_reg_dword(HKEY_CURRENT_USER, "Control Panel\\Desktop", "LogPixels", &dpi))
197  return dpi;
198  if (get_reg_dword(HKEY_CURRENT_CONFIG, "Software\\Fonts", "LogPixels", &dpi))
199  return dpi;
201 }
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
static BOOL get_reg_dword(HKEY base, const char *key_name, const char *value_name, DWORD *value)
Definition: sysparams.c:173
unsigned long DWORD
Definition: ntddk_ex.h:95
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2846
static int dpi
Definition: sysparams.c:49

Referenced by START_TEST().

◆ get_reg_dword()

static BOOL get_reg_dword ( HKEY  base,
const char key_name,
const char value_name,
DWORD value 
)
static

Definition at line 173 of file sysparams.c.

174 {
175  HKEY key;
176  DWORD type, data, size = sizeof(data);
177  BOOL ret = FALSE;
178 
180  {
181  if (RegQueryValueExA(key, value_name, NULL, &type, (void *)&data, &size) == ERROR_SUCCESS &&
182  type == REG_DWORD)
183  {
184  *value = data;
185  ret = TRUE;
186  }
187  RegCloseKey(key);
188  }
189  return ret;
190 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
HKEY key
Definition: reg.c:42
#define REG_DWORD
Definition: sdbapi.c:596
Definition: path.c:42

Referenced by get_real_dpi().

◆ get_text_metr_size()

static void get_text_metr_size ( HDC  hdc,
LOGFONTA plf,
TEXTMETRICA ptm,
UINT psz 
)
static

Definition at line 2638 of file sysparams.c.

2639 {
2640  HFONT hfont, hfontsav;
2641  TEXTMETRICA tm;
2642  if( !ptm) ptm = &tm;
2643  hfont = CreateFontIndirectA( plf);
2644  if( !hfont || ( hfontsav = SelectObject( hdc, hfont)) == NULL ) {
2645  ptm->tmHeight = -1;
2646  if( psz) *psz = 10;
2647  if( hfont) DeleteObject( hfont);
2648  return;
2649  }
2650  GetTextMetricsA( hdc, ptm);
2651  if( psz)
2652  if( !(*psz = _GdiGetCharDimensions( hdc, ptm, NULL)))
2653  *psz = 10;
2654  SelectObject( hdc, hfontsav);
2655  DeleteObject( hfont);
2656 }
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static HDC hdc
Definition: sysparams.c:51
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
static HFONT hfont
LONG tmHeight
Definition: wingdi.h:2339
Definition: time.h:76
static LONG _GdiGetCharDimensions(HDC hdc, LPTEXTMETRICA lptm, LONG *height)
Definition: sysparams.c:2620
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)

Referenced by test_GetSystemMetrics().

◆ get_tmheight()

static int get_tmheight ( LOGFONTA plf,
int  flag 
)
static

Definition at line 1474 of file sysparams.c.

1475 {
1476  TEXTMETRICA tm;
1478  hfont = SelectObject( hdc, hfont);
1479  GetTextMetricsA( hdc, &tm);
1480  hfont = SelectObject( hdc, hfont);
1481  return tm.tmHeight + (flag ? tm.tmExternalLeading : 0);
1482 }
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
static HDC hdc
Definition: sysparams.c:51
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
static HFONT hfont
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 flag
Definition: glfuncs.h:52
Definition: time.h:76
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)

Referenced by test_SPI_SETNONCLIENTMETRICS().

◆ is_font_enumerated()

static BOOL is_font_enumerated ( const char name)
static

Definition at line 2690 of file sysparams.c.

2691 {
2692  HDC hdc = CreateCompatibleDC(0);
2693  BOOL ret = FALSE;
2694 
2696  ret = TRUE;
2697 
2698  DeleteDC(hdc);
2699  return ret;
2700 }
#define TRUE
Definition: types.h:120
static INT CALLBACK enum_all_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam)
Definition: sysparams.c:2685
static HDC
Definition: imagelist.c:92
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
unsigned int BOOL
Definition: ntddk_ex.h:94
int WINAPI EnumFontFamiliesA(_In_ HDC, _In_opt_ LPCSTR, _In_ FONTENUMPROCA, _In_ LPARAM)
static HDC hdc
Definition: sysparams.c:51
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
int ret
BOOL WINAPI DeleteDC(_In_ HDC)
Definition: name.c:36

Referenced by test_GetSystemMetrics().

◆ lffromreg()

static int lffromreg ( const char keyname,
const char valname,
LOGFONTA plf 
)
static

Definition at line 499 of file sysparams.c.

500 {
501  HKEY hkey;
502  LOGFONTW lfw;
503  DWORD ret, size, type;
504 
505  RegOpenKeyA( HKEY_CURRENT_USER, keyname, &hkey );
506  size = sizeof( lfw);
507  ret=RegQueryValueExA( hkey, valname, NULL, &type, (LPBYTE)&lfw, &size );
508  RegCloseKey( hkey );
509  ok( ret == ERROR_SUCCESS, "Key \"%s\" value \"%s\" not found\n", keyname, valname);
510  if( ret != ERROR_SUCCESS)
511  return FALSE;
512  if( size <= sizeof( LOGFONT16)) {
513  LOGFONT16 *plf16 = (LOGFONT16*) &lfw;
514  plf->lfHeight = plf16->lfHeight;
515  plf->lfWidth = plf16->lfWidth;
516  plf->lfEscapement = plf16->lfEscapement;
517  plf->lfOrientation = plf16->lfOrientation;
518  plf->lfWeight = plf16->lfWeight;
519  plf->lfItalic = plf16->lfItalic;
520  plf->lfUnderline = plf16->lfUnderline;
521  plf->lfStrikeOut = plf16->lfStrikeOut;
522  plf->lfCharSet = plf16->lfCharSet;
523  plf->lfOutPrecision = plf16->lfOutPrecision;
524  plf->lfClipPrecision = plf16->lfClipPrecision;
525  plf->lfQuality = plf16->lfQuality;
526  plf->lfPitchAndFamily = plf16->lfPitchAndFamily;
527  memcpy( plf->lfFaceName, plf16->lfFaceName, LF_FACESIZE );
528  } else if( size <= sizeof( LOGFONTA)) {
529  plf = (LOGFONTA*) &lfw;
530  } else {
531  plf->lfHeight = lfw.lfHeight;
532  plf->lfWidth = lfw.lfWidth;
533  plf->lfEscapement = lfw.lfEscapement;
534  plf->lfOrientation = lfw.lfOrientation;
535  plf->lfWeight = lfw.lfWeight;
536  plf->lfItalic = lfw.lfItalic;
537  plf->lfUnderline = lfw.lfUnderline;
538  plf->lfStrikeOut = lfw.lfStrikeOut;
539  plf->lfCharSet = lfw.lfCharSet;
540  plf->lfOutPrecision = lfw.lfOutPrecision;
541  plf->lfClipPrecision = lfw.lfClipPrecision;
542  plf->lfQuality = lfw.lfQuality;
544  WideCharToMultiByte( CP_ACP, 0, lfw.lfFaceName, -1, plf->lfFaceName,
545  LF_FACESIZE, NULL, NULL);
546 
547  }
548  return TRUE;
549 }
BYTE lfItalic
Definition: dimm.idl:47
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
INT16 lfEscapement
Definition: sysparams.c:484
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define TRUE
Definition: types.h:120
#define LF_FACESIZE
Definition: dimm.idl:39
BYTE lfPitchAndFamily
Definition: dimm.idl:71
BYTE lfUnderline
Definition: sysparams.c:488
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
BYTE lfStrikeOut
Definition: dimm.idl:49
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG lfHeight
Definition: dimm.idl:59
BYTE lfCharSet
Definition: dimm.idl:67
BYTE lfClipPrecision
Definition: dimm.idl:69
BYTE lfUnderline
Definition: dimm.idl:48
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG lfEscapement
Definition: dimm.idl:61
BYTE lfCharSet
Definition: dimm.idl:50
BYTE lfOutPrecision
Definition: sysparams.c:491
CHAR lfFaceName[LF_FACESIZE]
Definition: sysparams.c:495
INT16 lfWidth
Definition: sysparams.c:483
BYTE lfOutPrecision
Definition: dimm.idl:51
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
LONG lfHeight
Definition: dimm.idl:42
LONG lfOrientation
Definition: dimm.idl:62
#define ok(value,...)
LONG lfWeight
Definition: dimm.idl:46
LONG lfWidth
Definition: dimm.idl:60
smooth NULL
Definition: ftsmooth.c:416
BYTE lfPitchAndFamily
Definition: dimm.idl:54
BYTE lfStrikeOut
Definition: sysparams.c:489
BYTE lfOutPrecision
Definition: dimm.idl:68
BYTE lfClipPrecision
Definition: sysparams.c:492
GLsizeiptr size
Definition: glext.h:5919
INT16 lfWeight
Definition: sysparams.c:486
unsigned long DWORD
Definition: ntddk_ex.h:95
BYTE lfQuality
Definition: sysparams.c:493
LONG lfWidth
Definition: dimm.idl:43
LONG lfOrientation
Definition: dimm.idl:45
int ret
BYTE lfQuality
Definition: dimm.idl:70
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BYTE lfQuality
Definition: dimm.idl:53
INT16 lfOrientation
Definition: sysparams.c:485
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfClipPrecision
Definition: dimm.idl:52
BYTE lfPitchAndFamily
Definition: sysparams.c:494
BYTE lfItalic
Definition: dimm.idl:64
BYTE lfItalic
Definition: sysparams.c:487
INT16 lfHeight
Definition: sysparams.c:482
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
LONG lfWeight
Definition: dimm.idl:63
BYTE lfCharSet
Definition: sysparams.c:490
BYTE lfUnderline
Definition: dimm.idl:65
LONG lfEscapement
Definition: dimm.idl:44

◆ LONG()

static LONG ( WINAPI pChangeDisplaySettingsExA)
static

◆ metricfromreg()

static UINT metricfromreg ( const char keyname,
const char valname,
int  dpi 
)
static

Definition at line 461 of file sysparams.c.

462 {
463  HKEY hkey;
464  char buf[64];
465  DWORD ret;
466  DWORD size, type;
467  int value;
468 
469  RegOpenKeyA( HKEY_CURRENT_USER, keyname, &hkey );
470  size = sizeof(buf);
471  ret=RegQueryValueExA( hkey, valname, NULL, &type, (LPBYTE)buf, &size );
472  RegCloseKey( hkey );
473  if( ret != ERROR_SUCCESS) return -1;
474  value = atoi( buf);
475  if( value < 0)
476  value = ( -value * dpi + 720) / 1440;
477  return value;
478 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define HKEY_CURRENT_USER
Definition: winreg.h:11
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLsizei const GLfloat * value
Definition: glext.h:6069
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
static int dpi
Definition: sysparams.c:49

Referenced by dotest_spi_iconhorizontalspacing(), dotest_spi_iconverticalspacing(), test_GetSystemMetrics(), test_setborder(), test_SPI_SETBORDER(), test_SPI_SETICONMETRICS(), test_SPI_SETICONTITLEWRAP(), test_SPI_SETMINIMIZEDMETRICS(), and test_SPI_SETNONCLIENTMETRICS().

◆ run_spi_setmouse_test()

static BOOL run_spi_setmouse_test ( int  curr_val[],
POINT req_change,
POINT proj_change,
int  nchange 
)
static

Definition at line 620 of file sysparams.c.

621 {
622  BOOL rc;
623  INT mi[3];
624  static int aw_turn = 0;
625  static BOOL w_implemented = TRUE;
626 
627  char buf[20];
628  int i;
629 
630  aw_turn++;
631  rc = FALSE;
632  if ((aw_turn % 2!=0) && (w_implemented))
633  {
634  /* call unicode on odd (non even) calls */
635  SetLastError(0xdeadbeef);
638  {
639  w_implemented = FALSE;
640  trace("SystemParametersInfoW not supported on this platform\n");
641  }
642  }
643 
644  if ((aw_turn % 2==0) || (!w_implemented))
645  {
646  /* call ascii version on even calls or if unicode is not available */
648  }
649  if (!test_error_msg(rc,"SPI_SETMOUSE")) return FALSE;
650 
651  ok(rc, "SystemParametersInfo: rc=%d err=%d\n", rc, GetLastError());
653  for (i = 0; i < 3; i++)
654  {
655  sprintf( buf, "%d", curr_val[i] );
657  }
658 
660  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
661  for (i = 0; i < 3; i++)
662  {
663  ok(mi[i] == curr_val[i],
664  "incorrect value for %d: %d != %d\n", i, mi[i], curr_val[i]);
665  }
666 
667  if (w_implemented)
668  {
670  ok(rc, "SystemParametersInfoW: rc=%d err=%d\n", rc, GetLastError());
671  for (i = 0; i < 3; i++)
672  {
673  ok(mi[i] == curr_val[i],
674  "incorrect value for %d: %d != %d\n", i, mi[i], curr_val[i]);
675  }
676  }
677 
678  if (0)
679  {
680  /* FIXME: this always fails for me - AJ */
681  for (i = 0; i < nchange; i++)
682  {
683  POINT mv;
685  mouse_event( MOUSEEVENTF_MOVE, req_change[i].x, req_change[i].y, 0, 0 );
686  GetCursorPos( &mv );
687  ok( proj_change[i].x == mv.x, "Projected dx and real dx comparison. May fail under high load.\n" );
688  ok( proj_change[i].y == mv.y, "Projected dy equals real dy. May fail under high load.\n" );
689  }
690  }
691  return TRUE;
692 }
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
#define MOUSEEVENTF_ABSOLUTE
Definition: winuser.h:1180
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SPI_SETMOUSE_REGKEY
Definition: sysparams.c:59
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SPI_SETMOUSE
Definition: winuser.h:1338
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static MONITORINFO mi
Definition: win.c:7331
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
int32_t INT
Definition: typedefs.h:56
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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
#define test_reg_key(subKey, valName, testValue)
Definition: sysparams.c:446
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
void WINAPI mouse_event(_In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ ULONG_PTR)
#define SPI_GETMOUSE
Definition: winuser.h:1337
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define MOUSEEVENTF_MOVE
Definition: winuser.h:1169
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static const char * setmouse_valuenames[3]
Definition: sysparams.c:611
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

Referenced by test_SPI_SETMOUSE().

◆ START_TEST()

START_TEST ( sysparams  )

Definition at line 3033 of file sysparams.c.

3034 {
3035  int argc;
3036  char** argv;
3037  WNDCLASSA wc;
3038  MSG msg;
3039  HANDLE hThread;
3040  DWORD dwThreadId;
3042 
3043  hdll = GetModuleHandleA("user32.dll");
3044  pChangeDisplaySettingsExA = (void*)GetProcAddress(hdll, "ChangeDisplaySettingsExA");
3045  pIsProcessDPIAware = (void*)GetProcAddress(hdll, "IsProcessDPIAware");
3046  pSetProcessDPIAware = (void*)GetProcAddress(hdll, "SetProcessDPIAware");
3047  pGetAutoRotationState = (void*)GetProcAddress(hdll, "GetAutoRotationState");
3048 
3050  hdc = GetDC(0);
3052  real_dpi = get_real_dpi();
3053  trace("dpi %d real_dpi %d\n", dpi, real_dpi);
3054  iswin9x = GetVersion() & 0x80000000;
3055 
3056  /* This test requires interactivity, if we don't have it, give up */
3059 
3061  strict=(argc >= 3 && strcmp(argv[2],"strict")==0);
3062  trace("strict=%d\n",strict);
3063 
3064  trace("testing GetSystemMetrics with your current desktop settings\n");
3066  trace("testing EnumDisplaySettings vs GetDeviceCaps\n");
3070 
3071  change_counter = 0;
3072  change_last_param = 0;
3073 
3074  wc.lpszClassName = "SysParamsTestClass";
3077  wc.hInstance = hInstance;
3078  wc.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION );
3079  wc.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW );
3080  wc.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
3081  wc.lpszMenuName = 0;
3082  wc.cbClsExtra = 0;
3083  wc.cbWndExtra = 0;
3084  RegisterClassA( &wc );
3085 
3086  ghTestWnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application",
3087  WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, hInstance, NULL );
3088 
3090  assert( hThread );
3091  CloseHandle( hThread );
3092 
3093  while( GetMessageA( &msg, 0, 0, 0 )) {
3094  TranslateMessage( &msg );
3095  DispatchMessageA( &msg );
3096  }
3097  ReleaseDC( 0, hdc);
3098 
3099  test_dpi_aware();
3100 }
static int argc
Definition: ServiceArgs.c:12
#define trace(...)
Definition: kmt_test.h:217
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
static DWORD get_real_dpi(void)
Definition: sysparams.c:192
static void test_EnumDisplaySettings(void)
Definition: sysparams.c:2928
HDC WINAPI GetDC(_In_opt_ HWND)
static void test_GetAutoRotationState(void)
Definition: sysparams.c:3011
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static int change_last_param
Definition: sysparams.c:168
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
int cbClsExtra
Definition: winuser.h:3118
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3124
#define IDI_APPLICATION
Definition: winuser.h:699
static void test_GetSysColorBrush(void)
Definition: sysparams.c:2970
HBRUSH hbrBackground
Definition: winuser.h:3123
#define CS_OWNDC
Definition: winuser.h:650
#define SPI_SETBEEP
Definition: winuser.h:1336
#define argv
Definition: mplay32.c:18
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
static HWND ghTestWnd
Definition: sysparams.c:161
#define COLOR_WINDOW
Definition: winuser.h:908
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2029
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
int cbWndExtra
Definition: winuser.h:3119
HINSTANCE hInstance
Definition: charmap.c:20
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static HDC hdc
Definition: sysparams.c:51
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
HCURSOR hCursor
Definition: winuser.h:3122
static void test_GetSystemMetrics(void)
Definition: sysparams.c:2710
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:111
smooth NULL
Definition: ftsmooth.c:416
static LRESULT CALLBACK SysParamsTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: sysparams.c:203
const char * LPCSTR
Definition: xmlstorage.h:183
#define CS_VREDRAW
Definition: winuser.h:653
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD WINAPI SysParamsThreadFunc(LPVOID lpParam)
Definition: sysparams.c:2562
int winetest_get_mainargs(char ***pargv)
static BOOL strict
Definition: sysparams.c:48
DWORD dwThreadId
Definition: fdebug.c:31
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
LPCSTR lpszClassName
Definition: winuser.h:3125
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3116
static int change_counter
Definition: sysparams.c:166
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static int real_dpi
Definition: sysparams.c:49
HINSTANCE hInstance
Definition: winuser.h:3120
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
static PVOID hdll
Definition: shimdbg.c:126
HANDLE hThread
Definition: wizard.c:27
WNDPROC lpfnWndProc
Definition: winuser.h:3117
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define GetProcAddress(x, y)
Definition: compat.h:410
#define LOGPIXELSY
Definition: wingdi.h:718
static BOOL iswin9x
Definition: sysparams.c:50
static int dpi
Definition: sysparams.c:49
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
static void test_dpi_aware(void)
Definition: sysparams.c:2991
HICON hIcon
Definition: winuser.h:3121

◆ SysParamsTestWndProc()

static LRESULT CALLBACK SysParamsTestWndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 203 of file sysparams.c.

205 {
206  switch (msg) {
207 
208  case WM_DISPLAYCHANGE:
209  ok(displaychange_ok, "Unexpected WM_DISPLAYCHANGE message\n");
210  last_bpp = wParam;
213  break;
214 
215  case WM_SETTINGCHANGE:
216  if (change_counter>0) {
217  /* ignore these messages caused by resizing of toolbars */
218  if( wParam == SPI_SETWORKAREA){
220  break;
221  } else if( wParam == SPI_ICONVERTICALSPACING) {
223  break;
224  } else if( displaychange_test_active)
225  break;
226  if( !change_last_param){
228  break;
229  }
230  ok(0,"too many changes counter=%d last change=%d\n",
232  change_counter++;
234  break;
235  }
236  change_counter++;
238  if( wParam == SPI_SETWORKAREA)
240  else if( wParam == SPI_ICONVERTICALSPACING)
242  else
244  break;
245 
246  case WM_DESTROY:
247  PostQuitMessage( 0 );
248  break;
249 
250  /* drop through */
251  default:
252  return( DefWindowProcA( hWnd, msg, wParam, lParam ) );
253  }
254 
255  return 0;
256 }
static int change_setworkarea_param
Definition: sysparams.c:167
static int last_bpp
Definition: sysparams.c:169
static int change_last_param
Definition: sysparams.c:168
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
#define WM_SETTINGCHANGE
Definition: winuser.h:1611
#define ok(value,...)
static BOOL displaychange_ok
Definition: sysparams.c:170
#define WM_DESTROY
Definition: winuser.h:1591
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
static HANDLE displaychange_sem
Definition: sysparams.c:171
static int change_iconverticalspacing_param
Definition: sysparams.c:167
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static int change_counter
Definition: sysparams.c:166
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseSemaphore(IN HANDLE hSemaphore, IN LONG lReleaseCount, IN LPLONG lpPreviousCount)
Definition: synch.c:488
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
static BOOL displaychange_test_active
Definition: sysparams.c:170

Referenced by START_TEST().

◆ SysParamsThreadFunc()

static DWORD WINAPI SysParamsThreadFunc ( LPVOID  lpParam)
static

Definition at line 2562 of file sysparams.c.

2563 {
2564  test_SPI_SETBEEP(); /* 1 */
2565  test_SPI_SETMOUSE(); /* 4 */
2566  test_SPI_SETBORDER(); /* 6 */
2567  test_SPI_SETKEYBOARDSPEED(); /* 10 */
2568  test_SPI_ICONHORIZONTALSPACING(); /* 13 */
2569  test_SPI_SETSCREENSAVETIMEOUT(); /* 14 */
2570  test_SPI_SETSCREENSAVEACTIVE(); /* 17 */
2571  test_SPI_SETGRIDGRANULARITY(); /* 19 */
2572  test_SPI_SETKEYBOARDDELAY(); /* 23 */
2573  test_SPI_ICONVERTICALSPACING(); /* 24 */
2574  test_SPI_SETICONTITLEWRAP(); /* 26 */
2575  test_SPI_SETMENUDROPALIGNMENT(); /* 28 */
2576  test_SPI_SETDOUBLECLKWIDTH(); /* 29 */
2577  test_SPI_SETDOUBLECLKHEIGHT(); /* 30 */
2578  test_SPI_SETDOUBLECLICKTIME(); /* 32 */
2579  test_SPI_SETMOUSEBUTTONSWAP(); /* 33 */
2580  test_SPI_SETFASTTASKSWITCH(); /* 36 */
2581  test_SPI_SETDRAGFULLWINDOWS(); /* 37 */
2582  /* test_WM_DISPLAYCHANGE seems to be somewhat buggy on
2583  * some versions of Windows (Vista, Win2k8, Win7B) in that
2584  * not all metrics are properly restored. Problems are
2585  * SM_CXMAXTRACK, SM_CYMAXTRACK
2586  * Fortunately setting the Non-Client metrics like in
2587  * test_SPI_SETNONCLIENTMETRICS will correct this. That is why
2588  * we do the DISPLAY change now... */
2590  test_SPI_SETNONCLIENTMETRICS(); /* 42 */
2591  test_SPI_SETMINIMIZEDMETRICS(); /* 44 */
2592  test_SPI_SETICONMETRICS(); /* 46 */
2593  test_SPI_SETWORKAREA(); /* 47 */
2594  test_SPI_SETSHOWSOUNDS(); /* 57 */
2595  test_SPI_SETKEYBOARDPREF(); /* 69 */
2596  test_SPI_SETSCREENREADER(); /* 71 */
2597  test_SPI_SETFONTSMOOTHING(); /* 75 */
2598  test_SPI_SETLOWPOWERACTIVE(); /* 85 */
2599  test_SPI_SETPOWEROFFACTIVE(); /* 86 */
2600  test_SPI_SETSNAPTODEFBUTTON(); /* 95 */
2601  test_SPI_SETMOUSEHOVERWIDTH(); /* 99 */
2602  test_SPI_SETMOUSEHOVERHEIGHT(); /* 101 */
2603  test_SPI_SETMOUSEHOVERTIME(); /* 103 */
2604  test_SPI_SETWHEELSCROLLLINES(); /* 105 */
2605  test_SPI_SETMENUSHOWDELAY(); /* 107 */
2606  test_SPI_SETWHEELSCROLLCHARS(); /* 108 */
2607  test_SPI_SETWALLPAPER(); /* 115 */
2608 
2609 
2610  SendMessageA( ghTestWnd, WM_DESTROY, 0, 0 );
2611  return 0;
2612 }
static void test_SPI_SETSCREENSAVEACTIVE(void)
Definition: sysparams.c:996
static void test_SPI_SETMINIMIZEDMETRICS(void)
Definition: sysparams.c:1611
static void test_SPI_SETBORDER(void)
Definition: sysparams.c:806
static void test_SPI_SETDRAGFULLWINDOWS(void)
Definition: sysparams.c:1396
static void test_SPI_SETNONCLIENTMETRICS(void)
Definition: sysparams.c:1487
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void test_SPI_SETDOUBLECLICKTIME(void)
Definition: sysparams.c:1290
static void test_SPI_ICONHORIZONTALSPACING(void)
Definition: sysparams.c:940
static void test_SPI_SETWORKAREA(void)
Definition: sysparams.c:1856
static void test_SPI_SETPOWEROFFACTIVE(void)
Definition: sysparams.c:2138
static void test_SPI_SETDOUBLECLKWIDTH(void)
Definition: sysparams.c:1222
static void test_SPI_SETMENUSHOWDELAY(void)
Definition: sysparams.c:2376
static HWND ghTestWnd
Definition: sysparams.c:161
static void test_SPI_SETICONTITLEWRAP(void)
Definition: sysparams.c:1130
static void test_SPI_SETFONTSMOOTHING(void)
Definition: sysparams.c:2016
static void test_SPI_SETLOWPOWERACTIVE(void)
Definition: sysparams.c:2098
static void test_SPI_ICONVERTICALSPACING(void)
Definition: sysparams.c:1109
static void test_SPI_SETGRIDGRANULARITY(void)
Definition: sysparams.c:1032
static void test_WM_DISPLAYCHANGE(void)
Definition: sysparams.c:2480
static void test_SPI_SETDOUBLECLKHEIGHT(void)
Definition: sysparams.c:1256
static void test_SPI_SETWALLPAPER(void)
Definition: sysparams.c:2453
static void test_SPI_SETMOUSEBUTTONSWAP(void)
Definition: sysparams.c:1346
#define WM_DESTROY
Definition: winuser.h:1591
static void test_SPI_SETKEYBOARDDELAY(void)
Definition: sysparams.c:1037
static void test_SPI_SETSCREENSAVETIMEOUT(void)
Definition: sysparams.c:959
static void test_SPI_SETSHOWSOUNDS(void)
Definition: sysparams.c:1908
static void test_SPI_SETKEYBOARDPREF(void)
Definition: sysparams.c:1946
static void test_SPI_SETSCREENREADER(void)
Definition: sysparams.c:1981
static void test_SPI_SETWHEELSCROLLLINES(void)
Definition: sysparams.c:2337
static void test_SPI_SETKEYBOARDSPEED(void)
Definition: sysparams.c:870
static void test_SPI_SETSNAPTODEFBUTTON(void)
Definition: sysparams.c:2178
static void test_SPI_SETMOUSE(void)
Definition: sysparams.c:694
static void test_SPI_SETMENUDROPALIGNMENT(void)
Definition: sysparams.c:1183
static void test_SPI_SETMOUSEHOVERHEIGHT(void)
Definition: sysparams.c:2253
static void test_SPI_SETFASTTASKSWITCH(void)
Definition: sysparams.c:1380
static void test_SPI_SETMOUSEHOVERTIME(void)
Definition: sysparams.c:2293
static void test_SPI_SETMOUSEHOVERWIDTH(void)
Definition: sysparams.c:2213
static void test_SPI_SETWHEELSCROLLCHARS(void)
Definition: sysparams.c:2415
static void test_SPI_SETICONMETRICS(void)
Definition: sysparams.c:1737
static void test_SPI_SETBEEP(void)
Definition: sysparams.c:551

Referenced by START_TEST().

◆ test_change_message()

static void test_change_message ( int  action,
int  optional 
)
static

Definition at line 264 of file sysparams.c.

265 {
266  if (change_counter==0 && optional==1)
267  return;
268  ok( 1 == change_counter,
269  "Missed a message: change_counter=%d\n", change_counter );
270  change_counter = 0;
272  ( change_setworkarea_param && action == SPI_SETWORKAREA) ||
274  "Wrong action got %d expected %d\n", change_last_param, action );
275  change_last_param = 0;
276 }
static int change_setworkarea_param
Definition: sysparams.c:167
static int change_last_param
Definition: sysparams.c:168
#define ok(value,...)
Definition: msg.h:41
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
static int change_iconverticalspacing_param
Definition: sysparams.c:167
static int change_counter
Definition: sysparams.c:166
const WCHAR * action
Definition: action.c:7783

Referenced by dotest_spi_iconhorizontalspacing(), dotest_spi_iconverticalspacing(), run_spi_setmouse_test(), test_setborder(), test_SPI_SETBEEP(), test_SPI_SETBORDER(), test_SPI_SETDOUBLECLICKTIME(), test_SPI_SETDOUBLECLKHEIGHT(), test_SPI_SETDOUBLECLKWIDTH(), test_SPI_SETDRAGFULLWINDOWS(), test_SPI_SETFONTSMOOTHING(), test_SPI_SETICONTITLEWRAP(), test_SPI_SETKEYBOARDDELAY(), test_SPI_SETKEYBOARDPREF(), test_SPI_SETKEYBOARDSPEED(), test_SPI_SETLOWPOWERACTIVE(), test_SPI_SETMENUDROPALIGNMENT(), test_SPI_SETMENUSHOWDELAY(), test_SPI_SETMOUSEBUTTONSWAP(), test_SPI_SETMOUSEHOVERHEIGHT(), test_SPI_SETMOUSEHOVERTIME(), test_SPI_SETMOUSEHOVERWIDTH(), test_SPI_SETNONCLIENTMETRICS(), test_SPI_SETPOWEROFFACTIVE(), test_SPI_SETSCREENREADER(), test_SPI_SETSCREENSAVEACTIVE(), test_SPI_SETSCREENSAVETIMEOUT(), test_SPI_SETSHOWSOUNDS(), test_SPI_SETSNAPTODEFBUTTON(), test_SPI_SETWALLPAPER(), test_SPI_SETWHEELSCROLLCHARS(), test_SPI_SETWHEELSCROLLLINES(), and test_SPI_SETWORKAREA().

◆ test_dpi_aware()

static void test_dpi_aware ( void  )
static

Definition at line 2991 of file sysparams.c.

2992 {
2993  BOOL ret;
2994 
2995  if (!pIsProcessDPIAware)
2996  {
2997  win_skip("IsProcessDPIAware not available\n");
2998  return;
2999  }
3000 
3001  ret = pSetProcessDPIAware();
3002  ok(ret, "got %d\n", ret);
3003 
3004  ret = pIsProcessDPIAware();
3005  ok(ret, "got %d\n", ret);
3006 
3007  dpi = real_dpi;
3009 }
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
static void test_GetSystemMetrics(void)
Definition: sysparams.c:2710
int ret
static int real_dpi
Definition: sysparams.c:49
static int dpi
Definition: sysparams.c:49
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_EnumDisplaySettings()

static void test_EnumDisplaySettings ( void  )
static

Definition at line 2928 of file sysparams.c.

2929 {
2930  DEVMODEA devmode;
2931  DWORD val;
2932  HDC hdc;
2933  DWORD num;
2934 
2935  memset(&devmode, 0, sizeof(devmode));
2936  /* Win95 doesn't handle ENUM_CURRENT_SETTINGS correctly */
2938 
2939  hdc = GetDC(0);
2941  ok(devmode.dmBitsPerPel == val ||
2942  broken(devmode.dmDeviceName[0] == 0), /* Win95 */
2943  "GetDeviceCaps(BITSPIXEL) returned %d, EnumDisplaySettings returned %d\n",
2945 
2947  if(devmode.dmBitsPerPel <= 8) {
2948  ok(val == 256, "Screen bpp is %d, NUMCOLORS returned %d\n", devmode.dmBitsPerPel, val);
2949  } else {
2950  ok(val == -1, "Screen bpp is %d, NUMCOLORS returned %d\n", devmode.dmBitsPerPel, val);
2951  }
2952 
2953  ReleaseDC(0, hdc);
2954 
2955  num = 1;
2956  while (1) {
2957  SetLastError (0xdeadbeef);
2958  if (!EnumDisplaySettingsA(NULL, num, &devmode)) {
2959  DWORD le = GetLastError();
2960  ok(le == ERROR_NO_MORE_FILES ||
2961  le == ERROR_MOD_NOT_FOUND /* Win8 */ ||
2962  le == 0xdeadbeef, /* XP, 2003 */
2963  "Expected ERROR_NO_MORE_FILES, ERROR_MOD_NOT_FOUND or 0xdeadbeef, got %d for %d\n", le, num);
2964  break;
2965  }
2966  num++;
2967  }
2968 }
#define BITSPIXEL
Definition: wingdi.h:719
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD dmBitsPerPel
Definition: wingdi.h:1625
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
#define NUMCOLORS
Definition: wingdi.h:724
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static HDC hdc
Definition: sysparams.c:51
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_NO_MORE_FILES
Definition: winerror.h:121
GLuint GLfloat * val
Definition: glext.h:7180
BOOL WINAPI EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEA lpDevMode)
Definition: display.c:312
DEVMODEW devmode
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
#define SetLastError(x)
Definition: compat.h:409
WCHAR dmDeviceName[CCHDEVICENAME]
Definition: wingdi.h:1595
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define broken(x)
Definition: _sntprintf.h:21
#define ERROR_MOD_NOT_FOUND
Definition: compat.h:94
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_error_msg()

static BOOL test_error_msg ( int  rc,
const char name 
)
static

Definition at line 278 of file sysparams.c.

279 {
281 
282  if (rc==0)
283  {
285  {
286  skip("%s not supported on this platform\n", name);
287  }
289  {
290  skip("%s does not have privileges to run\n", name);
291  }
292  else
293  {
294  trace("%s failed for reason: %d. Indicating test failure and skipping remainder of test\n",name,last_error);
295  ok(rc!=0,"SystemParametersInfoA: rc=%d err=%d\n",rc,last_error);
296  }
297  return FALSE;
298  }
299  else
300  {
301  ok(rc!=0,"SystemParametersInfoA: rc=%d err=%d\n",rc,last_error);
302  return TRUE;
303  }
304 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
#define ok(value,...)
#define ERROR_INVALID_SPI_VALUE
Definition: winerror.h:920
unsigned long DWORD
Definition: ntddk_ex.h:95
#define skip(...)
Definition: name.c:36

Referenced by dotest_spi_iconhorizontalspacing(), dotest_spi_iconverticalspacing(), run_spi_setmouse_test(), test_setborder(), test_SPI_ICONHORIZONTALSPACING(), test_SPI_ICONVERTICALSPACING(), test_SPI_SETBEEP(), test_SPI_SETBORDER(), test_SPI_SETDOUBLECLICKTIME(), test_SPI_SETDOUBLECLKHEIGHT(), test_SPI_SETDOUBLECLKWIDTH(), test_SPI_SETDRAGFULLWINDOWS(), test_SPI_SETFASTTASKSWITCH(), test_SPI_SETFONTSMOOTHING(), test_SPI_SETICONMETRICS(), test_SPI_SETICONTITLEWRAP(), test_SPI_SETKEYBOARDDELAY(), test_SPI_SETKEYBOARDPREF(), test_SPI_SETKEYBOARDSPEED(), test_SPI_SETLOWPOWERACTIVE(), test_SPI_SETMENUDROPALIGNMENT(), test_SPI_SETMENUSHOWDELAY(), test_SPI_SETMINIMIZEDMETRICS(), test_SPI_SETMOUSE(), test_SPI_SETMOUSEBUTTONSWAP(), test_SPI_SETMOUSEHOVERHEIGHT(), test_SPI_SETMOUSEHOVERTIME(), test_SPI_SETMOUSEHOVERWIDTH(), test_SPI_SETNONCLIENTMETRICS(), test_SPI_SETPOWEROFFACTIVE(), test_SPI_SETSCREENREADER(), test_SPI_SETSCREENSAVEACTIVE(), test_SPI_SETSCREENSAVETIMEOUT(), test_SPI_SETSHOWSOUNDS(), test_SPI_SETSNAPTODEFBUTTON(), test_SPI_SETWALLPAPER(), test_SPI_SETWHEELSCROLLCHARS(), test_SPI_SETWHEELSCROLLLINES(), and test_SPI_SETWORKAREA().

◆ test_GetAutoRotationState()

static void test_GetAutoRotationState ( void  )
static

Definition at line 3011 of file sysparams.c.

3012 {
3013  AR_STATE state;
3014  BOOL ret;
3015 
3016  if (!pGetAutoRotationState)
3017  {
3018  win_skip("GetAutoRotationState not supported\n");
3019  return;
3020  }
3021 
3022  SetLastError(0xdeadbeef);
3023  ret = pGetAutoRotationState(NULL);
3024  ok(!ret, "Expected GetAutoRotationState to fail\n");
3025  ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
3026 
3027  state = 0;
3028  ret = pGetAutoRotationState(&state);
3029  ok(ret, "Expected GetAutoRotationState to succeed, error %d\n", GetLastError());
3030  ok((state & AR_NOSENSOR) != 0, "Expected AR_NOSENSOR, got %d\n", state);
3031 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
enum tagAR_STATE AR_STATE
#define SetLastError(x)
Definition: compat.h:409
int ret
static int state
Definition: maze.c:121
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_GetSysColorBrush()

static void test_GetSysColorBrush ( void  )
static

Definition at line 2970 of file sysparams.c.

2971 {
2972  HBRUSH hbr;
2973 
2974  SetLastError(0xdeadbeef);
2975  hbr = GetSysColorBrush(-1);
2976  ok(hbr == NULL, "Expected NULL brush\n");
2977  ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError());
2978  /* greater than max index */
2979  hbr = GetSysColorBrush(COLOR_MENUBAR);
2980  if (hbr)
2981  {
2982  SetLastError(0xdeadbeef);
2983  hbr = GetSysColorBrush(COLOR_MENUBAR + 1);
2984  ok(hbr == NULL, "Expected NULL brush\n");
2985  ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError());
2986  }
2987  else
2988  win_skip("COLOR_MENUBAR unsupported\n");
2989 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:409
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_GetSystemMetrics()

static void test_GetSystemMetrics ( void  )
static

Definition at line 2710 of file sysparams.c.

2711 {
2712  TEXTMETRICA tmMenuFont;
2713  UINT IconSpacing, IconVerticalSpacing;
2714  BOOL rc;
2715 
2716  HDC hdc = CreateICA( "Display", 0, 0, 0);
2717  UINT avcwCaption;
2718  INT CaptionWidthfromreg, smicon, broken_val;
2719  MINIMIZEDMETRICS minim;
2720  NONCLIENTMETRICSA ncm;
2721  SIZE screen;
2722 
2723  assert(sizeof(ncm) == 344);
2724 
2725  ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
2726  rc = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2727  ok(rc, "SystemParametersInfoA failed\n");
2728 
2729  ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth) - 1;
2730  rc = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2731  ok(!rc, "SystemParametersInfoA should fail\n");
2732 
2733  ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth) + 1;
2734  SetLastError(0xdeadbeef);
2735  rc = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2736  ok(!rc, "SystemParametersInfoA should fail\n");
2737 
2738  ncm.cbSize = sizeof(ncm); /* Vista added padding */
2739  SetLastError(0xdeadbeef);
2740  rc = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2741  ok(rc || broken(!rc) /* before Vista */, "SystemParametersInfoA failed\n");
2742 
2743  minim.cbSize = sizeof( minim);
2744  ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
2745  SystemParametersInfoA( SPI_GETMINIMIZEDMETRICS, 0, &minim, 0);
2746  rc = SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2747  if( !rc) {
2748  win_skip("SPI_GETNONCLIENTMETRICS is not available\n");
2749  return;
2750  }
2751 
2752  ok(is_font_enumerated(ncm.lfCaptionFont.lfFaceName), "font %s should be enumerated\n", ncm.lfCaptionFont.lfFaceName);
2753  ok(is_font_enumerated(ncm.lfSmCaptionFont.lfFaceName), "font %s should be enumerated\n", ncm.lfSmCaptionFont.lfFaceName);
2754  ok(is_font_enumerated(ncm.lfMenuFont.lfFaceName), "font %s should be enumerated\n", ncm.lfMenuFont.lfFaceName);
2755  ok(is_font_enumerated(ncm.lfStatusFont.lfFaceName), "font %s should be enumerated\n", ncm.lfStatusFont.lfFaceName);
2756  ok(is_font_enumerated(ncm.lfMessageFont.lfFaceName), "font %s should be enumerated\n", ncm.lfMessageFont.lfFaceName);
2757 
2758  /* CaptionWidth from the registry may have different value of iCaptionWidth
2759  * from the non client metrics (observed on WinXP) */
2760  CaptionWidthfromreg = metricfromreg(
2761  "Control Panel\\Desktop\\WindowMetrics","CaptionWidth", dpi);
2762  get_text_metr_size( hdc, &ncm.lfMenuFont, &tmMenuFont, NULL);
2763  get_text_metr_size( hdc, &ncm.lfCaptionFont, NULL, &avcwCaption);
2764  /* FIXME: use icon metric */
2765  if( !SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0, &IconVerticalSpacing, 0))
2766  IconVerticalSpacing = 0;
2767  if( !SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0, &IconSpacing, 0 ))
2768  IconSpacing = 0;
2769  /* reset error counters */
2770  gsm_error_ctr = 0;
2771 
2772  /* the tests: */
2773 
2774  /* SM_CXSCREEN, cannot test these two */
2775  /* SM_CYSCREEN */
2776  ok_gsm( SM_CXVSCROLL, ncm.iScrollWidth);
2777  ok_gsm( SM_CYHSCROLL, ncm.iScrollWidth);
2778  ok_gsm( SM_CYCAPTION, ncm.iCaptionHeight+1);
2779  ok_gsm( SM_CXBORDER, 1);
2780  ok_gsm( SM_CYBORDER, 1);
2781  ok_gsm( SM_CXDLGFRAME, 3);
2782  ok_gsm( SM_CYDLGFRAME, 3);
2783  ok_gsm( SM_CYVTHUMB, ncm.iScrollHeight);
2784  ok_gsm( SM_CXHTHUMB, ncm.iScrollHeight);
2785  /* These don't depend on the Shell Icon Size registry value */
2790  ok_gsm( SM_CYMENU, ncm.iMenuHeight + 1);
2795  /* SM_CYKANJIWINDOW */
2796  /* SM_MOUSEPRESENT */
2797  ok_gsm( SM_CYVSCROLL, ncm.iScrollHeight);
2798  ok_gsm( SM_CXHSCROLL, ncm.iScrollHeight);
2799  /* SM_DEBUG */
2800  /* SM_SWAPBUTTON */
2801  /* SM_RESERVED1 */
2802  /* SM_RESERVED2 */
2803  /* SM_RESERVED3 */
2804  /* SM_RESERVED4 */
2805  ok_gsm( SM_CXMIN, 3 * max( CaptionWidthfromreg >= 0 ? CaptionWidthfromreg : ncm.iCaptionWidth, 8) +
2806  GetSystemMetrics( SM_CYSIZE) + 4 + 4 * avcwCaption + 2 * GetSystemMetrics( SM_CXFRAME));
2810  ncm.iCaptionWidth, /* classic/standard windows style */
2811  GetSystemMetrics( SM_CYCAPTION) - 1 /* WinXP style */
2812  );
2813  ok_gsm( SM_CYSIZE, ncm.iCaptionHeight);
2814  ok_gsm( SM_CXFRAME, ncm.iBorderWidth + 3);
2815  ok_gsm( SM_CYFRAME, ncm.iBorderWidth + 3);
2818  /* SM_CXDOUBLECLK */
2819  /* SM_CYDOUBLECLK */
2820  if( IconSpacing) ok_gsm( SM_CXICONSPACING, IconSpacing);
2821  if( IconVerticalSpacing) ok_gsm( SM_CYICONSPACING, IconVerticalSpacing);
2822  /* SM_MENUDROPALIGNMENT */
2823  /* SM_PENWINDOWS */
2824  /* SM_DBCSENABLED */
2825  /* SM_CMOUSEBUTTONS */
2826  /* SM_SECURE */
2827  ok_gsm( SM_CXEDGE, 2);
2828  ok_gsm( SM_CYEDGE, 2);
2829  /* sign-extension for iHorzGap/iVertGap is broken on Win9x */
2832 
2833  smicon = MulDiv( 16, dpi, USER_DEFAULT_SCREEN_DPI );
2834  if (!pIsProcessDPIAware || pIsProcessDPIAware())
2835  smicon = max( min( smicon, CaptionWidthfromreg - 2), 4 ) & ~1;
2836  todo_wine_if( real_dpi == dpi && smicon != (MulDiv( 16, dpi, USER_DEFAULT_SCREEN_DPI) & ~1) )
2837  {
2838  broken_val = (min( ncm.iCaptionHeight, CaptionWidthfromreg ) - 2) & ~1;
2839  broken_val = min( broken_val, 20 );
2840 
2841  if (smicon == 4)
2842  {
2843  ok_gsm_2( SM_CXSMICON, smicon, 6 );
2844  ok_gsm_2( SM_CYSMICON, smicon, 6 );
2845  }
2846  else if (smicon < broken_val)
2847  {
2848  ok_gsm_2( SM_CXSMICON, smicon, broken_val );
2849  ok_gsm_2( SM_CYSMICON, smicon, broken_val );
2850  }
2851  else
2852  {
2853  ok_gsm( SM_CXSMICON, smicon );
2854  ok_gsm( SM_CYSMICON, smicon );
2855  }
2856  }
2857 
2858  ok_gsm( SM_CYSMCAPTION, ncm.iSmCaptionHeight + 1);
2860  ncm.iSmCaptionWidth, /* classic/standard windows style */
2861  GetSystemMetrics( SM_CYSMCAPTION) - 1, /* WinXP style */
2862  smcxsmsize /* winXP seems to cache this value: setnonclientmetric
2863  does not change it */
2864  );
2866  ok_gsm( SM_CXMENUSIZE, ncm.iMenuWidth);
2867  ok_gsm( SM_CYMENUSIZE, ncm.iMenuHeight);
2868  /* SM_ARRANGE */
2869  ok_gsm( SM_CXMINIMIZED, minim.iWidth + 6);
2873  if (!screen.cx || !screen.cy) /* not supported on NT4 */
2874  {
2877  }
2879  screen.cx - 4 + 2 * GetSystemMetrics(SM_CXFRAME), /* Vista */
2880  screen.cx + 2 * GetSystemMetrics(SM_CXFRAME)); /* Win8 */
2882  screen.cy - 4 + 2 * GetSystemMetrics(SM_CYFRAME), /* Vista */
2883  screen.cy + 2 * GetSystemMetrics(SM_CYFRAME)); /* Win8 */
2884  /* the next two cannot really be tested as they depend on (application)
2885  * toolbars */
2886  /* SM_CXMAXIMIZED */
2887  /* SM_CYMAXIMIZED */
2888  /* SM_NETWORK */
2889  /* */
2890  /* */
2891  /* */
2892  /* SM_CLEANBOOT */
2893  /* SM_CXDRAG */
2894  /* SM_CYDRAG */
2895  /* SM_SHOWSOUNDS */
2897  ((tmMenuFont.tmHeight + tmMenuFont.tmExternalLeading+1)/2)*2-1);
2899  ((tmMenuFont.tmHeight + tmMenuFont.tmExternalLeading+1)/2)*2-1);
2900  /* SM_SLOWMACHINE */
2901  /* SM_MIDEASTENABLED */
2902  /* SM_MOUSEWHEELPRESENT */
2903  /* SM_XVIRTUALSCREEN */
2904  /* SM_YVIRTUALSCREEN */
2905  /* SM_CXVIRTUALSCREEN */
2906  /* SM_CYVIRTUALSCREEN */
2907  /* SM_CMONITORS */
2908  /* SM_SAMEDISPLAYFORMAT */
2909  /* SM_IMMENABLED */
2910  /* SM_CXFOCUSBORDER */
2911  /* SM_CYFOCUSBORDER */
2912  /* SM_TABLETPC */
2913  /* SM_MEDIACENTER */
2914  /* SM_CMETRICS */
2915  /* end of tests */
2916  if( gsm_error_ctr ) { /* if any errors where found */
2917  trace( "BorderWidth %d CaptionWidth %d CaptionHeight %d IconSpacing %d IconVerticalSpacing %d\n",
2918  ncm.iBorderWidth, ncm.iCaptionWidth, ncm.iCaptionHeight, IconSpacing, IconVerticalSpacing);
2919  trace( "MenuHeight %d MenuWidth %d ScrollHeight %d ScrollWidth %d SmCaptionHeight %d SmCaptionWidth %d\n",
2920  ncm.iMenuHeight, ncm.iMenuWidth, ncm.iScrollHeight, ncm.iScrollWidth, ncm.iSmCaptionHeight, ncm.iSmCaptionWidth);
2921  trace( "Captionfontchar width %d MenuFont %d,%d CaptionWidth from registry: %d screen %d,%d\n",
2922  avcwCaption, tmMenuFont.tmHeight, tmMenuFont.tmExternalLeading, CaptionWidthfromreg, screen.cx, screen.cy);
2923  }
2924 
2925  DeleteDC(hdc);
2926 }
#define SM_CXICONSPACING
Definition: winuser.h:991
#define trace(...)
Definition: kmt_test.h:217
#define max(a, b)
Definition: svc.c:63
#define SM_CYHSCROLL
Definition: winuser.h:952
#define SM_CYSIZE
Definition: winuser.h:982
#define ok_gsm_2(i, e1, e2)
Definition: sysparams.c:2667
#define SM_CYMENUSIZE
Definition: winuser.h:1008
#define SM_CYMINTRACK
Definition: winuser.h:988
#define SM_CXVIRTUALSCREEN
Definition: winuser.h:1028
#define SPI_ICONHORIZONTALSPACING
Definition: winuser.h:1344
#define SM_CXMINIMIZED
Definition: winuser.h:1010
#define ok_gsm_3(i, e1, e2, e3)
Definition: sysparams.c:2675
static HDC
Definition: imagelist.c:92
#define SM_CYVSCROLL
Definition: winuser.h:971
#define SM_CXMENUCHECK
Definition: winuser.h:1021
#define SM_CYCURSOR
Definition: winuser.h:965
#define assert(x)
Definition: debug.h:53
#define SM_CXEDGE
Definition: winuser.h:998
#define SM_CYSMICON
Definition: winuser.h:1003
static BOOL is_font_enumerated(const char *name)
Definition: sysparams.c:2690
#define SM_CYMAXTRACK
Definition: winuser.h:1013
#define SM_CYFRAME
Definition: winuser.h:986
#define SM_CXFRAME
Definition: winuser.h:984
int32_t INT
Definition: typedefs.h:56
#define SM_CXMINSPACING
Definition: winuser.h:1000
HDC WINAPI CreateICA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ const DEVMODEA *)
#define SM_CXSCREEN
Definition: winuser.h:949
#define SM_CYMENUCHECK
Definition: winuser.h:1022
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SM_CYMAXIMIZED
Definition: winuser.h:1015
#define SM_CYDLGFRAME
Definition: winuser.h:958
static HDC hdc
Definition: sysparams.c:51
#define ok(value,...)
#define SM_CXICON
Definition: winuser.h:962
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SM_CXHTHUMB
Definition: winuser.h:961
smooth NULL
Definition: ftsmooth.c:416
#define SM_CYEDGE
Definition: winuser.h:999
#define SM_CYVTHUMB
Definition: winuser.h:960
#define ok_gsm(i, e)
Definition: sysparams.c:2660
#define SM_CYMIN
Definition: winuser.h:980
#define SM_CYVIRTUALSCREEN
Definition: winuser.h:1029
static void get_text_metr_size(HDC hdc, LOGFONTA *plf, TEXTMETRICA *ptm, UINT *psz)
Definition: sysparams.c:2638
static int gsm_error_ctr
Definition: sysparams.c:2658
#define todo_wine_if(is_todo)
Definition: test.h:155
#define SM_CYSMSIZE
Definition: winuser.h:1006
#define SM_CYSCREEN
Definition: winuser.h:950
#define SM_CYCAPTION
Definition: winuser.h:953
#define SM_CXHSCROLL
Definition: winuser.h:972
LONG tmHeight
Definition: wingdi.h:2339
#define SM_CXCURSOR
Definition: winuser.h:964
#define SM_CXMAXIMIZED
Definition: winuser.h:1014
#define SM_CXDLGFRAME
Definition: winuser.h:956
#define SM_CXMINTRACK
Definition: winuser.h:987
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
#define SM_CXSMSIZE
Definition: winuser.h:1005
int WINAPI GetSystemMetrics(_In_ int)
#define SetLastError(x)
Definition: compat.h:409
#define SM_CXSMICON
Definition: winuser.h:1002
LONG tmExternalLeading
Definition: wingdi.h:2343
#define SM_CYBORDER
Definition: winuser.h:955
#define SM_CYICON
Definition: winuser.h:963
#define SM_CYMINIMIZED
Definition: winuser.h:1011
#define SM_CYICONSPACING
Definition: winuser.h:992
#define SM_CXBORDER
Definition: winuser.h:954
#define broken(x)
Definition: _sntprintf.h:21
char screen[SCREENY][SCREENX]
Definition: polytest.cpp:65
#define SM_CYMINSPACING
Definition: winuser.h:1001
static int real_dpi
Definition: sysparams.c:49
BOOL WINAPI DeleteDC(_In_ HDC)
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
#define SM_CXVSCROLL
Definition: winuser.h:951
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:461
#define SM_CXMAXTRACK
Definition: winuser.h:1012
#define SM_CYFULLSCREEN
Definition: winuser.h:968
#define SM_CXSIZE
Definition: winuser.h:981
#define SM_CXFULLSCREEN
Definition: winuser.h:967
#define SM_CYMENU
Definition: winuser.h:966
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2846
static int dpi
Definition: sysparams.c:49
#define SM_CYSMCAPTION
Definition: winuser.h:1004
#define win_skip
Definition: test.h:141
static UINT smcxsmsize
Definition: sysparams.c:1485
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
static int get_cursor_size(int size)
Definition: sysparams.c:2702
#define SM_CXMIN
Definition: winuser.h:979
#define SM_CXMENUSIZE
Definition: winuser.h:1007

Referenced by START_TEST(), test_dpi_aware(), and test_SPI_SETNONCLIENTMETRICS().

◆ test_setborder()

static BOOL test_setborder ( UINT  curr_val,
int  usesetborder,
int  dpi 
)
static

Definition at line 758 of file sysparams.c.

759 {
760  BOOL rc;
761  UINT border, regval;
762  INT frame;
763  NONCLIENTMETRICSA ncm;
764 
765  ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
766  rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
767  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
768  if( usesetborder) {
770  if (!test_error_msg(rc,"SPI_SETBORDER")) return FALSE;
771  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
773  } else { /* set non client metrics */
774  ncm.iBorderWidth = curr_val;
775  rc=SystemParametersInfoA( SPI_SETNONCLIENTMETRICS, 0, &ncm, SPIF_UPDATEINIFILE|
777  if (!test_error_msg(rc,"SPI_SETNONCLIENTMETRICS")) return FALSE;
778  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
779  test_change_message( SPI_SETNONCLIENTMETRICS, 1 );
780  }
781  if( curr_val) { /* skip if 0, some windows versions return 0 others 1 */
783  if( regval != curr_val)
785  ok( regval==curr_val, "wrong value in registry %d, expected %d\n", regval, curr_val);
786  }
787  /* minimum border width is 1 */
788  if (curr_val == 0) curr_val = 1;
789  /* should be the same as the non client metrics */
790  rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
791  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
792  eq( (UINT)ncm.iBorderWidth, curr_val, "NonClientMetric.iBorderWidth", "%d");
793  /* and from SPI_GETBORDER */
795  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
796  eq( border, curr_val, "SPI_{GET,SET}BORDER", "%d");
797  /* test some SystemMetrics */
798  frame = curr_val + GetSystemMetrics( SM_CXDLGFRAME );
799  eq( frame, GetSystemMetrics( SM_CXFRAME ), "SM_CXFRAME", "%d" );
800  eq( frame, GetSystemMetrics( SM_CYFRAME ), "SM_CYFRAME", "%d" );
801  eq( frame, GetSystemMetrics( SM_CXSIZEFRAME ), "SM_CXSIZEFRAME", "%d" );
802  eq( frame, GetSystemMetrics( SM_CYSIZEFRAME ), "SM_CYSIZEFRAME", "%d" );
803  return TRUE;
804 }
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SM_CYFRAME
Definition: winuser.h:986
#define SM_CXFRAME
Definition: winuser.h:984
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SPI_SETBORDER_VALNAME
Definition: sysparams.c:65
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SM_CYSIZEFRAME
Definition: winuser.h:985
#define SPI_SETBORDER
Definition: winuser.h:1340
#define SM_CXSIZEFRAME
Definition: winuser.h:983
#define SM_CXDLGFRAME
Definition: winuser.h:956
GLint GLint GLsizei GLsizei GLsizei GLint border
Definition: gl.h:1546
int WINAPI GetSystemMetrics(_In_ int)
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPI_SETBORDER_REGKEY
Definition: sysparams.c:63
#define SPI_GETBORDER
Definition: winuser.h:1339
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int UINT
Definition: ndis.h:50
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:461
#define SPI_SETBORDER_REGKEY2
Definition: sysparams.c:64
static int dpi
Definition: sysparams.c:49
#define eq(received, expected, label, type)
Definition: sysparams.c:53

Referenced by test_SPI_SETBORDER().

◆ test_SPI_ICONHORIZONTALSPACING()

static void test_SPI_ICONHORIZONTALSPACING ( void  )
static

Definition at line 940 of file sysparams.c.

941 {
942  BOOL rc;
943  INT old_spacing;
944 
945  trace("testing SPI_ICONHORIZONTALSPACING\n");
946  SetLastError(0xdeadbeef);
947  /* default value: 75 */
948  rc=SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0, &old_spacing, 0 );
949  if (!test_error_msg(rc,"SPI_ICONHORIZONTALSPACING"))
950  return;
951  /* do not increase the value as it would upset the user's icon layout */
952  if (!dotest_spi_iconhorizontalspacing( old_spacing - 1)) return;
953  dotest_spi_iconhorizontalspacing( 10); /* minimum is 32 */
954  /* restore */
956  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
957 }
#define trace(...)
Definition: kmt_test.h:217
#define SPI_ICONHORIZONTALSPACING
Definition: winuser.h:1344
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static BOOL dotest_spi_iconhorizontalspacing(INT curr_val)
Definition: sysparams.c:906

Referenced by SysParamsThreadFunc().

◆ test_SPI_ICONVERTICALSPACING()

static void test_SPI_ICONVERTICALSPACING ( void  )
static

Definition at line 1109 of file sysparams.c.

1110 {
1111  BOOL rc;
1112  INT old_spacing;
1113 
1114  trace("testing SPI_ICONVERTICALSPACING\n");
1115  SetLastError(0xdeadbeef);
1116  /* default value: 75 */
1117  rc=SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0, &old_spacing, 0 );
1118  if (!test_error_msg(rc,"SPI_ICONVERTICALSPACING"))
1119  return;
1120  /* do not increase the value as it would upset the user's icon layout */
1121  if (!dotest_spi_iconverticalspacing( old_spacing - 1)) return;
1122  /* same tests with a value less than the minimum 32 */
1124  /* restore */
1125  rc=SystemParametersInfoA( SPI_ICONVERTICALSPACING, old_spacing, 0,
1127  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1128 }
#define trace(...)
Definition: kmt_test.h:217
static BOOL dotest_spi_iconverticalspacing(INT curr_val)
Definition: sysparams.c:1075
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETBEEP()

static void test_SPI_SETBEEP ( void  )
static

Definition at line 551 of file sysparams.c.

552 {
553  BOOL rc;
554  BOOL old_b;
555  BOOL b;
556  BOOL curr_val;
557 
558  trace("testing SPI_{GET,SET}BEEP\n");
559  SetLastError(0xdeadbeef);
560  rc=SystemParametersInfoA( SPI_GETBEEP, 0, &old_b, 0 );
561  if (!test_error_msg(rc,"SPI_{GET,SET}BEEP"))
562  return;
563 
564  curr_val = TRUE;
566  if (!test_error_msg(rc,"SPI_SETBEEP")) return;
567  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
571  curr_val ? "Yes" : "No" );
572  rc=SystemParametersInfoA( SPI_GETBEEP, 0, &b, 0 );
573  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
574  eq( b, curr_val, "SPI_{GET,SET}BEEP", "%d" );
575  rc=SystemParametersInfoW( SPI_GETBEEP, 0, &b, 0 );
577  {
578  ok(rc, "SystemParametersInfoW: rc=%d err=%d\n", rc, GetLastError());
579  eq( b, curr_val, "SystemParametersInfoW", "%d" );
580  }
581 
582  /* is a message sent for the second change? */
584  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
586 
587  curr_val = FALSE;
591  ok(rc, "SystemParametersInfo: rc=%d err=%d\n", rc, GetLastError());
595  curr_val ? "Yes" : "No" );
596  rc=SystemParametersInfoA( SPI_GETBEEP, 0, &b, 0 );
597  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
598  eq( b, curr_val, "SPI_{GET,SET}BEEP", "%d" );
599  rc=SystemParametersInfoW( SPI_GETBEEP, 0, &b, 0 );
601  {
602  ok(rc, "SystemParametersInfoW: rc=%d err=%d\n", rc, GetLastError());
603  eq( b, curr_val, "SystemParametersInfoW", "%d" );
604  }
605  ok( MessageBeep( MB_OK ), "Return value of MessageBeep when sound is disabled\n" );
606 
608  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
609 }
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SPI_SETBEEP
Definition: winuser.h:1336
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
#define test_reg_key(subKey, valName, testValue)
Definition: sysparams.c:446
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define b
Definition: ke_i.h:79
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define SPI_SETBEEP_REGKEY
Definition: sysparams.c:57
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
BOOL WINAPI MessageBeep(_In_ UINT)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define SPI_SETBEEP_VALNAME
Definition: sysparams.c:58
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define MB_OK
Definition: winuser.h:784
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
#define SPI_GETBEEP
Definition: winuser.h:1335
#define eq(received, expected, label, type)
Definition: sysparams.c:53

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETBORDER()

static void test_SPI_SETBORDER ( void  )
static

Definition at line 806 of file sysparams.c.

807 {
808  BOOL rc;
809  UINT old_border;
810  NONCLIENTMETRICSA ncmsave;
811  INT CaptionWidth,
812  PaddedBorderWidth;
813 
814  ncmsave.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
815  rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, 0, &ncmsave, 0);
816  if( !rc) {
817  win_skip("SPI_GETNONCLIENTMETRICS is not available\n");
818  return;
819  }
820  /* CaptionWidth from the registry may have different value of iCaptionWidth
821  * from the non client metrics (observed on WinXP).
822  * Fix this so we can safely restore settings with the nonclientmetrics */
823  CaptionWidth = metricfromreg(
824  "Control Panel\\Desktop\\WindowMetrics","CaptionWidth", dpi);
825  ncmsave.iCaptionWidth = CaptionWidth;
826 
827  /* These tests hang when XFree86 4.0 for Windows is running (tested on
828  * WinNT, SP2, Cygwin/XFree 4.1.0. Skip the test when XFree86 is
829  * running.
830  */
831  if (FindWindowA( NULL, "Cygwin/XFree86" ))
832  return;
833 
834  trace("testing SPI_{GET,SET}BORDER\n");
835 
836  SetLastError(0xdeadbeef);
837  rc=SystemParametersInfoA( SPI_GETBORDER, 0, &old_border, 0 );
838  if (!test_error_msg(rc,"SPI_{GET,SET}BORDER"))
839  return;
840  /* FIXME: include new PaddedBorderWidth parameter */
841  PaddedBorderWidth = ncmsave.iBorderWidth - old_border;
842  if( PaddedBorderWidth){
843  win_skip( "Cannot reliably restore border width yet (PaddedBorderWidth = %d)\n",
844  PaddedBorderWidth);
845  return;
846  }
847  /* This will restore sane values if the test hang previous run. */
848  if ( old_border == 7 || old_border == 20 )
849  old_border = 1;
850 
851  /* The SPI_SETBORDER seems to be buggy on Win9x/ME (looks like you need to
852  * do it twice to make the intended change). So skip parts of the tests on
853  * those platforms */
854  if( !iswin9x) {
855  /* win2k3 fails if you set the same border twice, or if size is 0 */
856  if (!test_setborder(2, 1, dpi)) return;
857  test_setborder(1, 1, dpi);
858  test_setborder(3, 1, dpi);
859  }
860  if (!test_setborder(1, 0, dpi)) return;
861  test_setborder(0, 0, dpi);
862  test_setborder(3, 0, dpi);
863 
864  rc=SystemParametersInfoA( SPI_SETNONCLIENTMETRICS, 0, &ncmsave,
866  test_change_message( SPI_SETNONCLIENTMETRICS, 1 );
867  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
868 }
#define trace(...)
Definition: kmt_test.h:217
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL test_setborder(UINT curr_val, int usesetborder, int dpi)
Definition: sysparams.c:758
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPI_GETBORDER
Definition: winuser.h:1339
HWND WINAPI FindWindowA(_In_opt_ LPCSTR, _In_opt_ LPCSTR)
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int UINT
Definition: ndis.h:50
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:461
static BOOL iswin9x
Definition: sysparams.c:50
static int dpi
Definition: sysparams.c:49
#define win_skip
Definition: test.h:141

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETDOUBLECLICKTIME()

static void test_SPI_SETDOUBLECLICKTIME ( void  )
static

Definition at line 1290 of file sysparams.c.

1291 {
1292  BOOL rc;
1293  UINT curr_val;
1294  UINT saved_val;
1295  UINT old_time;
1296  char buf[10];
1297 
1298  trace("testing SPI_{GET,SET}DOUBLECLICKTIME\n");
1299  old_time = GetDoubleClickTime();
1300 
1301  curr_val = 0;
1302  SetLastError(0xdeadbeef);
1305  if (!test_error_msg(rc,"SPI_{GET,SET}DOUBLECLICKTIME"))
1306  return;
1307 
1309  sprintf( buf, "%d", curr_val );
1312  curr_val = 500; /* used value for 0 */
1313  eq( GetDoubleClickTime(), curr_val, "GetDoubleClickTime", "%d" );
1314 
1315  curr_val = 1000;
1318  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1320  sprintf( buf, "%d", curr_val );
1323  eq( GetDoubleClickTime(), curr_val, "GetDoubleClickTime", "%d" );
1324 
1325  saved_val = curr_val;
1326 
1327  curr_val = 0;
1328  SetDoubleClickTime( curr_val );
1329  sprintf( buf, "%d", saved_val );
1332  curr_val = 500; /* used value for 0 */
1333  eq( GetDoubleClickTime(), curr_val, "GetDoubleClickTime", "%d" );
1334 
1335  curr_val = 1000;
1336  SetDoubleClickTime( curr_val );
1337  sprintf( buf, "%d", saved_val );
1340  eq( GetDoubleClickTime(), curr_val, "GetDoubleClickTime", "%d" );
1341 
1343  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1344 }
#define trace(...)
Definition: kmt_test.h:217
BOOL WINAPI SetDoubleClickTime(_In_ UINT)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SPI_SETDOUBLECLICKTIME_REGKEY
Definition: sysparams.c:114
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
#define SPI_SETDOUBLECLICKTIME_VALNAME
Definition: sysparams.c:115
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define test_reg_key(subKey, valName, testValue)
Definition: sysparams.c:446
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1363
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
unsigned int UINT
Definition: ndis.h:50
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
UINT WINAPI GetDoubleClickTime(void)
Definition: ntwrapper.h:314
#define eq(received, expected, label, type)
Definition: sysparams.c:53

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETDOUBLECLKHEIGHT()

static void test_SPI_SETDOUBLECLKHEIGHT ( void  )
static

Definition at line 1256 of file sysparams.c.

1257 {
1258  BOOL rc;
1259  INT old_height;
1260  const UINT vals[]={0,10000};
1261  unsigned int i;
1262 
1263  trace("testing SPI_{GET,SET}DOUBLECLKHEIGHT\n");
1264  old_height = GetSystemMetrics( SM_CYDOUBLECLK );
1265 
1266  for (i=0;i<sizeof(vals)/sizeof(*vals);i++)
1267  {
1268  char buf[10];
1269 
1270  SetLastError(0xdeadbeef);
1273  if (!test_error_msg(rc,"SPI_{GET,SET}DOUBLECLKHEIGHT"))
1274  return;
1275 
1277  sprintf( buf, "%d", vals[i] );
1281  eq( GetSystemMetrics( SM_CYDOUBLECLK ), (int)vals[i],
1282  "SM_CYDOUBLECLK", "%d" );
1283  }
1284 
1285  rc=SystemParametersInfoA( SPI_SETDOUBLECLKHEIGHT, old_height, 0,
1287  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1288 }
#define trace(...)
Definition: kmt_test.h:217
#define SM_CYDOUBLECLK
Definition: winuser.h:990
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SPI_SETDOUBLECLKHEIGHT_VALNAME
Definition: sysparams.c:113
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
int32_t INT
Definition: typedefs.h:56
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define test_reg_key_ex(subKey1, subKey2, valName, testValue)
Definition: sysparams.c:450
int WINAPI GetSystemMetrics(_In_ int)
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPI_SETDOUBLECLKHEIGHT_REGKEY2
Definition: sysparams.c:112
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
unsigned int UINT
Definition: ndis.h:50
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define SPI_SETDOUBLECLKHEIGHT_REGKEY1
Definition: sysparams.c:111
#define SPI_SETDOUBLECLKHEIGHT
Definition: winuser.h:1361
#define eq(received, expected, label, type)
Definition: sysparams.c:53

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETDOUBLECLKWIDTH()

static void test_SPI_SETDOUBLECLKWIDTH ( void  )
static

Definition at line 1222 of file sysparams.c.

1223 {
1224  BOOL rc;
1225  INT old_width;
1226  const UINT vals[]={0,10000};
1227  unsigned int i;
1228 
1229  trace("testing SPI_{GET,SET}DOUBLECLKWIDTH\n");
1230  old_width = GetSystemMetrics( SM_CXDOUBLECLK );
1231 
1232  for (i=0;i<sizeof(vals)/sizeof(*vals);i++)
1233  {
1234  char buf[10];
1235 
1236  SetLastError(0xdeadbeef);
1239  if (!test_error_msg(rc,"SPI_{GET,SET}DOUBLECLKWIDTH"))
1240  return;
1241 
1243  sprintf( buf, "%d", vals[i] );
1247  eq( GetSystemMetrics( SM_CXDOUBLECLK ), (int)vals[i],
1248  "SM_CXDOUBLECLK", "%d" );
1249  }
1250 
1251  rc=SystemParametersInfoA( SPI_SETDOUBLECLKWIDTH, old_width, 0,
1253  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1254 }
#define trace(...)
Definition: kmt_test.h:217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SPI_SETDOUBLECLKWIDTH_REGKEY1
Definition: sysparams.c:108
#define SPI_SETDOUBLECLKWIDTH
Definition: winuser.h:1360
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
int32_t INT
Definition: typedefs.h:56
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define test_reg_key_ex(subKey1, subKey2, valName, testValue)
Definition: sysparams.c:450
int WINAPI GetSystemMetrics(_In_ int)
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
unsigned int UINT
Definition: ndis.h:50
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define SPI_SETDOUBLECLKWIDTH_VALNAME
Definition: sysparams.c:110
#define SPI_SETDOUBLECLKWIDTH_REGKEY2
Definition: sysparams.c:109
#define eq(received, expected, label, type)
Definition: sysparams.c:53
#define SM_CXDOUBLECLK
Definition: winuser.h:989

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETDRAGFULLWINDOWS()

static void test_SPI_SETDRAGFULLWINDOWS ( void  )
static

Definition at line 1396 of file sysparams.c.

1397 {
1398  BOOL rc;
1399  BOOL old_b;
1400  const UINT vals[]={TRUE,FALSE};
1401  unsigned int i;
1402 
1403  trace("testing SPI_{GET,SET}DRAGFULLWINDOWS\n");
1404  SetLastError(0xdeadbeef);
1405  rc=SystemParametersInfoA( SPI_GETDRAGFULLWINDOWS, 0, &old_b, 0 );
1406 
1407  /* SPI_{GET,SET}DRAGFULLWINDOWS is not implemented on Win95 */
1408  if (!test_error_msg(rc,"SPI_{GET,SET}DRAGFULLWINDOWS"))
1409  return;
1410 
1411  for (i=0;i<sizeof(vals)/sizeof(*vals);i++)
1412  {
1413  UINT v;
1414 
1415  rc=SystemParametersInfoA( SPI_SETDRAGFULLWINDOWS, vals[i], 0,
1417  if (!test_error_msg(rc,"SPI_SETDRAGFULLWINDOWS")) return;
1418  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1419  test_change_message( SPI_SETDRAGFULLWINDOWS, 0 );
1422  vals[i] ? "1" : "0" );
1423 
1424  rc=SystemParametersInfoA( SPI_GETDRAGFULLWINDOWS, 0, &v, 0 );
1425  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1426  eq( v, vals[i], "SPI_{GET,SET}DRAGFULLWINDOWS", "%d" );
1427  }
1428 
1429  rc=SystemParametersInfoA( SPI_SETDRAGFULLWINDOWS, old_b, 0, SPIF_UPDATEINIFILE );
1430  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1431 }
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
#define SPI_SETDRAGFULLWINDOWS_REGKEY
Definition: sysparams.c:139
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
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
#define test_reg_key(subKey, valName, testValue)
Definition: sysparams.c:446
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
const GLdouble * v
Definition: gl.h:2040
#define SPI_SETDRAGFULLWINDOWS_VALNAME
Definition: sysparams.c:140
unsigned int UINT
Definition: ndis.h:50
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define eq(received, expected, label, type)
Definition: sysparams.c:53

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETFASTTASKSWITCH()

static void test_SPI_SETFASTTASKSWITCH ( void  )
static

Definition at line 1380 of file sysparams.c.

1381 {
1382  BOOL rc;
1383  BOOL v;
1384 
1385  trace("testing SPI_GETFASTTASKSWITCH\n");
1386  SetLastError(0xdeadbeef);
1388  if (!test_error_msg(rc,"SPI_{GET,SET}FASTTASKSWITCH"))
1389  return;
1390 
1391  /* there is not a single Windows platform on which SPI_GETFASTTASKSWITCH
1392  * works. That sure simplifies testing!
1393  */
1394 }
#define trace(...)
Definition: kmt_test.h:217
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPI_GETFASTTASKSWITCH
Definition: winuser.h:1366
const GLdouble * v
Definition: gl.h:2040

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETFONTSMOOTHING()

static void test_SPI_SETFONTSMOOTHING ( void  )
static

Definition at line 2016 of file sysparams.c.

2017 {
2018  BOOL rc;
2019  BOOL old_b;
2020  DWORD old_type, old_contrast, old_orient;
2021  const UINT vals[]={0xffffffff,0,1,2};
2022  unsigned int i;
2023 
2024  trace("testing SPI_{GET,SET}FONTSMOOTHING\n");
2025  if( iswin9x) return; /* 95/98/ME don't seem to implement this fully */
2026  SetLastError(0xdeadbeef);
2027  rc=SystemParametersInfoA( SPI_GETFONTSMOOTHING, 0, &old_b, 0 );
2028  if (!test_error_msg(rc,"SPI_{GET,SET}FONTSMOOTHING"))
2029  return;
2030  SystemParametersInfoA( SPI_GETFONTSMOOTHINGTYPE, 0, &old_type, 0 );
2031  SystemParametersInfoA( SPI_GETFONTSMOOTHINGCONTRAST, 0, &old_contrast, 0 );
2032  SystemParametersInfoA( SPI_GETFONTSMOOTHINGORIENTATION, 0, &old_orient, 0 );
2033 
2034  for (i=0;i<sizeof(vals)/sizeof(*vals);i++)
2035  {
2036  UINT v;
2037 
2038  rc=SystemParametersInfoA( SPI_SETFONTSMOOTHING, vals[i], 0,
2040  if (!test_error_msg(rc,"SPI_SETFONTSMOOTHING")) return;
2041  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2042  test_change_message( SPI_SETFONTSMOOTHING, 0 );
2045  vals[i] ? "2" : "0" );
2046 
2047  rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGTYPE, 0, UlongToPtr(vals[i]),
2049  if (!test_error_msg(rc,"SPI_SETFONTSMOOTHINGTYPE")) return;
2050  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2051  test_change_message( SPI_SETFONTSMOOTHINGTYPE, 0 );
2054 
2055  rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGCONTRAST, 0, UlongToPtr(vals[i]),
2057  if (!test_error_msg(rc,"SPI_SETFONTSMOOTHINGCONTRAST")) return;
2058  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2059  test_change_message( SPI_SETFONTSMOOTHINGCONTRAST, 0 );
2062 
2063  rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGORIENTATION, 0, UlongToPtr(vals[i]),
2065  if (!test_error_msg(rc,"SPI_SETFONTSMOOTHINGORIENTATION")) return;
2066  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2067  test_change_message( SPI_SETFONTSMOOTHINGORIENTATION, 0 );
2070 
2071  rc=SystemParametersInfoA( SPI_GETFONTSMOOTHING, 0, &v, 0 );
2072  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2073  eq( v, vals[i] ? 1 : 0, "SPI_GETFONTSMOOTHING", "%d" );
2074 
2075  rc=SystemParametersInfoA( SPI_GETFONTSMOOTHINGTYPE, 0, &v, 0 );
2076  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2077  ok( v == vals[i], "wrong value %x/%x\n", v, vals[i] );
2078 
2079  rc=SystemParametersInfoA( SPI_GETFONTSMOOTHINGCONTRAST, 0, &v, 0 );
2080  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2081  ok( v == vals[i], "wrong value %x/%x\n", v, vals[i] );
2082 
2083  rc=SystemParametersInfoA( SPI_GETFONTSMOOTHINGORIENTATION, 0, &v, 0 );
2084  ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2085  ok( v == vals[i], "wrong value %x/%x\n", v, vals[i] );
2086  }
2087 
2088  rc=SystemParametersInfoA( SPI_SETFONTSMOOTHING, old_b, 0, SPIF_UPDATEINIFILE );
2089  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2090  rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGTYPE, old_type, 0, SPIF_UPDATEINIFILE );
2091  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2092  rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGCONTRAST, old_contrast, 0, SPIF_UPDATEINIFILE );
2093  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2094  rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGORIENTATION, old_orient, 0, SPIF_UPDATEINIFILE );
2095  ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2096 }
#define trace(...)
Definition: kmt_test.h:217
#define SPI_SETFONTSMOOTHING_VALNAME
Definition: sysparams.c:131
#define test_reg_key_dword(subKey, valName, testValue)
Definition: sysparams.c:456
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SPI_SETFONTSMOOTHINGORIENTATION_VALNAME
Definition: sysparams.c:134
#define SPI_SETFONTSMOOTHING_REGKEY
Definition: sysparams.c:130
static void test_change_message(int action, int optional)
Definition: sysparams.c:264
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
#define test_reg_key(subKey, valName, testValue)
Definition: sysparams.c:446
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SPI_SETFONTSMOOTHINGCONTRAST_VALNAME
Definition: sysparams.c:133
#define UlongToPtr(u)
Definition: config.h:106
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:278
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
const GLdouble * v
Definition: gl.h:2040
unsigned int UINT
Definition: ndis.h:50
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
#define SPI_SETFONTSMOOTHINGTYPE_VALNAME
Definition: sysparams.c:132
static BOOL iswin9x
Definition: sysparams.c:50
#define eq(received, expected, label, type)
Definition: sysparams.c:53

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETGRIDGRANULARITY()

static void test_SPI_SETGRIDGRANULARITY ( void  )
static

Definition at line 1032 of file sysparams.c.

1033 {
1034  /* ??? */;
1035 }

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETICONMETRICS()

static void test_SPI_SETICONMETRICS ( void  )
static

Definition at line 1737 of file sysp