ReactOS 0.4.16-dev-197-g92996da
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 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 UINT (WINAPI *pGetDpiForSystem)(void)
 
static UINT UINT *static DPI_AWARENESS_CONTEXT (WINAPI *pGetThreadDpiAwarenessContext)(void)
 
static DPI_AWARENESS (WINAPI *pGetAwarenessFromDpiAwarenessContext)(DPI_AWARENESS_CONTEXT)
 
static INT (WINAPI *pGetSystemMetricsForDpi)(INT
 
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 int get_tmheightW (LOGFONTW *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 compare_font (const LOGFONTW *lf1, const LOGFONTW *lf2, int dpi, int custom_dpi, int line)
 
static void test_metrics_for_dpi (int custom_dpi)
 
static void test_EnumDisplaySettings (void)
 
static void test_GetSysColorBrush (void)
 
static void test_dpi_stock_objects (HDC hdc)
 
static void scale_point_dpi (POINT *pt, UINT src_dpi, UINT target_dpi)
 
static void scale_rect_dpi (RECT *rect, UINT src_dpi, UINT target_dpi)
 
static void scale_point_dpi_aware (POINT *pt, DPI_AWARENESS from, DPI_AWARENESS to)
 
static void scale_rect_dpi_aware (RECT *rect, DPI_AWARENESS from, DPI_AWARENESS to)
 
static void test_dpi_mapping (void)
 
static void test_dpi_aware (void)
 
static void test_dpi_context (void)
 
static LRESULT CALLBACK dpi_winproc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void test_dpi_window (void)
 
static void test_GetAutoRotationState (void)
 
 START_TEST (sysparams)
 

Variables

static LPDEVMODEA
 
static HWND
 
static DWORD
 
static LPVOID
 
static UINT
 
static BOOL
 
static BOOL strict
 
static int dpi
 
static int real_dpi
 
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

◆ eq

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

Definition at line 61 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
DWORD exp
Definition: msg.c:16058
static int gsm_error_ctr
Definition: sysparams.c:2646
int WINAPI GetSystemMetrics(_In_ int)

Definition at line 2648 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);\
}
double __cdecl exp2(double)

Definition at line 2655 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);\
}

Definition at line 2663 of file sysparams.c.

◆ SPI_CAPTIONFONT_VALNAME

#define SPI_CAPTIONFONT_VALNAME   "CaptionFont"

Definition at line 79 of file sysparams.c.

◆ SPI_CAPTIONHEIGHT_VALNAME

#define SPI_CAPTIONHEIGHT_VALNAME   "CaptionHeight"

Definition at line 78 of file sysparams.c.

◆ SPI_CAPTIONWIDTH_VALNAME

#define SPI_CAPTIONWIDTH_VALNAME   "CaptionWidth"

Definition at line 77 of file sysparams.c.

◆ SPI_GETDESKWALLPAPER

#define SPI_GETDESKWALLPAPER   0x0073

Definition at line 34 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_REGKEY

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

Definition at line 91 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_REGKEY2

#define SPI_ICONHORIZONTALSPACING_REGKEY2   "Control Panel\\Desktop"

Definition at line 92 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_VALNAME

#define SPI_ICONHORIZONTALSPACING_VALNAME   "IconSpacing"

Definition at line 93 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_REGKEY

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

Definition at line 94 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_REGKEY2

#define SPI_ICONVERTICALSPACING_REGKEY2   "Control Panel\\Desktop"

Definition at line 95 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_VALNAME

#define SPI_ICONVERTICALSPACING_VALNAME   "IconVerticalSpacing"

Definition at line 96 of file sysparams.c.

◆ SPI_MENUFONT_VALNAME

#define SPI_MENUFONT_VALNAME   "MenuFont"

Definition at line 85 of file sysparams.c.

◆ SPI_MENUHEIGHT_VALNAME

#define SPI_MENUHEIGHT_VALNAME   "MenuHeight"

Definition at line 84 of file sysparams.c.

◆ SPI_MENUWIDTH_VALNAME

#define SPI_MENUWIDTH_VALNAME   "MenuWidth"

Definition at line 83 of file sysparams.c.

◆ SPI_MESSAGEFONT_VALNAME

#define SPI_MESSAGEFONT_VALNAME   "MessageFont"

Definition at line 87 of file sysparams.c.

◆ SPI_METRIC_REGKEY

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

Definition at line 74 of file sysparams.c.

◆ SPI_MINARRANGE_VALNAME

#define SPI_MINARRANGE_VALNAME   "MinArrange"

Definition at line 101 of file sysparams.c.

◆ SPI_MINHORZGAP_VALNAME

#define SPI_MINHORZGAP_VALNAME   "MinHorzGap"

Definition at line 99 of file sysparams.c.

◆ SPI_MINIMIZEDMETRICS_REGKEY

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

Definition at line 97 of file sysparams.c.

◆ SPI_MINVERTGAP_VALNAME

#define SPI_MINVERTGAP_VALNAME   "MinVertGap"

Definition at line 100 of file sysparams.c.

◆ SPI_MINWIDTH_VALNAME

#define SPI_MINWIDTH_VALNAME   "MinWidth"

Definition at line 98 of file sysparams.c.

◆ SPI_SCROLLHEIGHT_VALNAME

#define SPI_SCROLLHEIGHT_VALNAME   "ScrollHeight"

Definition at line 76 of file sysparams.c.

◆ SPI_SCROLLWIDTH_VALNAME

#define SPI_SCROLLWIDTH_VALNAME   "ScrollWidth"

Definition at line 75 of file sysparams.c.

◆ SPI_SETBEEP_REGKEY

#define SPI_SETBEEP_REGKEY   "Control Panel\\Sound"

Definition at line 65 of file sysparams.c.

◆ SPI_SETBEEP_VALNAME

#define SPI_SETBEEP_VALNAME   "Beep"

Definition at line 66 of file sysparams.c.

◆ SPI_SETBORDER_REGKEY

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

Definition at line 71 of file sysparams.c.

◆ SPI_SETBORDER_REGKEY2

#define SPI_SETBORDER_REGKEY2   "Control Panel\\Desktop"

Definition at line 72 of file sysparams.c.

◆ SPI_SETBORDER_VALNAME

#define SPI_SETBORDER_VALNAME   "BorderWidth"

Definition at line 73 of file sysparams.c.

◆ SPI_SETDESKWALLPAPER_REGKEY

#define SPI_SETDESKWALLPAPER_REGKEY   "Control Panel\\Desktop"

Definition at line 163 of file sysparams.c.

◆ SPI_SETDESKWALLPAPER_VALNAME

#define SPI_SETDESKWALLPAPER_VALNAME   "Wallpaper"

Definition at line 164 of file sysparams.c.

◆ SPI_SETDOUBLECLICKTIME_REGKEY

#define SPI_SETDOUBLECLICKTIME_REGKEY   "Control Panel\\Mouse"

Definition at line 122 of file sysparams.c.

◆ SPI_SETDOUBLECLICKTIME_VALNAME

#define SPI_SETDOUBLECLICKTIME_VALNAME   "DoubleClickSpeed"

Definition at line 123 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_REGKEY1

#define SPI_SETDOUBLECLKHEIGHT_REGKEY1   "Control Panel\\Mouse"

Definition at line 119 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_REGKEY2

#define SPI_SETDOUBLECLKHEIGHT_REGKEY2   "Control Panel\\Desktop"

Definition at line 120 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_VALNAME

#define SPI_SETDOUBLECLKHEIGHT_VALNAME   "DoubleClickHeight"

Definition at line 121 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_REGKEY1

#define SPI_SETDOUBLECLKWIDTH_REGKEY1   "Control Panel\\Mouse"

Definition at line 116 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_REGKEY2

#define SPI_SETDOUBLECLKWIDTH_REGKEY2   "Control Panel\\Desktop"

Definition at line 117 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_VALNAME

#define SPI_SETDOUBLECLKWIDTH_VALNAME   "DoubleClickWidth"

Definition at line 118 of file sysparams.c.

◆ SPI_SETDRAGFULLWINDOWS_REGKEY

#define SPI_SETDRAGFULLWINDOWS_REGKEY   "Control Panel\\Desktop"

Definition at line 147 of file sysparams.c.

◆ SPI_SETDRAGFULLWINDOWS_VALNAME

#define SPI_SETDRAGFULLWINDOWS_VALNAME   "DragFullWindows"

Definition at line 148 of file sysparams.c.

◆ SPI_SETFONTSMOOTHING_REGKEY

#define SPI_SETFONTSMOOTHING_REGKEY   "Control Panel\\Desktop"

Definition at line 138 of file sysparams.c.

◆ SPI_SETFONTSMOOTHING_VALNAME

#define SPI_SETFONTSMOOTHING_VALNAME   "FontSmoothing"

Definition at line 139 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGCONTRAST_VALNAME

#define SPI_SETFONTSMOOTHINGCONTRAST_VALNAME   "FontSmoothingGamma"

Definition at line 141 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGORIENTATION_VALNAME

#define SPI_SETFONTSMOOTHINGORIENTATION_VALNAME   "FontSmoothingOrientation"

Definition at line 142 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGTYPE_VALNAME

#define SPI_SETFONTSMOOTHINGTYPE_VALNAME   "FontSmoothingType"

Definition at line 140 of file sysparams.c.

◆ SPI_SETGRIDGRANULARITY_REGKEY

#define SPI_SETGRIDGRANULARITY_REGKEY   "Control Panel\\Desktop"

Definition at line 106 of file sysparams.c.

◆ SPI_SETGRIDGRANULARITY_VALNAME

#define SPI_SETGRIDGRANULARITY_VALNAME   "GridGranularity"

Definition at line 107 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_REGKEY1

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

Definition at line 110 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_REGKEY2

#define SPI_SETICONTITLEWRAP_REGKEY2   "Control Panel\\Desktop"

Definition at line 111 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_VALNAME

#define SPI_SETICONTITLEWRAP_VALNAME   "IconTitleWrap"

Definition at line 112 of file sysparams.c.

◆ SPI_SETKEYBOARDDELAY_REGKEY

#define SPI_SETKEYBOARDDELAY_REGKEY   "Control Panel\\Keyboard"

Definition at line 108 of file sysparams.c.

◆ SPI_SETKEYBOARDDELAY_VALNAME

#define SPI_SETKEYBOARDDELAY_VALNAME   "KeyboardDelay"

Definition at line 109 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_REGKEY

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

Definition at line 130 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_REGKEY_LEGACY

#define SPI_SETKEYBOARDPREF_REGKEY_LEGACY   "Control Panel\\Accessibility"

Definition at line 132 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_VALNAME

#define SPI_SETKEYBOARDPREF_VALNAME   "On"

Definition at line 131 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_VALNAME_LEGACY

#define SPI_SETKEYBOARDPREF_VALNAME_LEGACY   "Keyboard Preference"

Definition at line 133 of file sysparams.c.

◆ SPI_SETKEYBOARDSPEED_REGKEY

#define SPI_SETKEYBOARDSPEED_REGKEY   "Control Panel\\Keyboard"

Definition at line 89 of file sysparams.c.

◆ SPI_SETKEYBOARDSPEED_VALNAME

#define SPI_SETKEYBOARDSPEED_VALNAME   "KeyboardSpeed"

Definition at line 90 of file sysparams.c.

◆ SPI_SETLOWPOWERACTIVE_REGKEY

#define SPI_SETLOWPOWERACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 143 of file sysparams.c.

◆ SPI_SETLOWPOWERACTIVE_VALNAME

#define SPI_SETLOWPOWERACTIVE_VALNAME   "LowPowerActive"

Definition at line 144 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_REGKEY1

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

Definition at line 113 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_REGKEY2

#define SPI_SETMENUDROPALIGNMENT_REGKEY2   "Control Panel\\Desktop"

Definition at line 114 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_VALNAME

#define SPI_SETMENUDROPALIGNMENT_VALNAME   "MenuDropAlignment"

Definition at line 115 of file sysparams.c.

◆ SPI_SETMENUSHOWDELAY_REGKEY

#define SPI_SETMENUSHOWDELAY_REGKEY   "Control Panel\\Desktop"

Definition at line 161 of file sysparams.c.

◆ SPI_SETMENUSHOWDELAY_VALNAME

#define SPI_SETMENUSHOWDELAY_VALNAME   "MenuShowDelay"

Definition at line 162 of file sysparams.c.

◆ SPI_SETMOUSE_REGKEY

#define SPI_SETMOUSE_REGKEY   "Control Panel\\Mouse"

Definition at line 67 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME1

#define SPI_SETMOUSE_VALNAME1   "MouseThreshold1"

Definition at line 68 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME2

#define SPI_SETMOUSE_VALNAME2   "MouseThreshold2"

Definition at line 69 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME3

#define SPI_SETMOUSE_VALNAME3   "MouseSpeed"

Definition at line 70 of file sysparams.c.

◆ SPI_SETMOUSEBUTTONSWAP_REGKEY

#define SPI_SETMOUSEBUTTONSWAP_REGKEY   "Control Panel\\Mouse"

Definition at line 124 of file sysparams.c.

◆ SPI_SETMOUSEBUTTONSWAP_VALNAME

#define SPI_SETMOUSEBUTTONSWAP_VALNAME   "SwapMouseButtons"

Definition at line 125 of file sysparams.c.

◆ SPI_SETMOUSEHOVERHEIGHT_REGKEY

#define SPI_SETMOUSEHOVERHEIGHT_REGKEY   "Control Panel\\Mouse"

Definition at line 153 of file sysparams.c.

◆ SPI_SETMOUSEHOVERHEIGHT_VALNAME

#define SPI_SETMOUSEHOVERHEIGHT_VALNAME   "MouseHoverHeight"

Definition at line 154 of file sysparams.c.

◆ SPI_SETMOUSEHOVERTIME_REGKEY

#define SPI_SETMOUSEHOVERTIME_REGKEY   "Control Panel\\Mouse"

Definition at line 155 of file sysparams.c.

◆ SPI_SETMOUSEHOVERTIME_VALNAME

#define SPI_SETMOUSEHOVERTIME_VALNAME   "MouseHoverTime"

Definition at line 156 of file sysparams.c.

◆ SPI_SETMOUSEHOVERWIDTH_REGKEY

#define SPI_SETMOUSEHOVERWIDTH_REGKEY   "Control Panel\\Mouse"

Definition at line 151 of file sysparams.c.

◆ SPI_SETMOUSEHOVERWIDTH_VALNAME

#define SPI_SETMOUSEHOVERWIDTH_VALNAME   "MouseHoverWidth"

Definition at line 152 of file sysparams.c.

◆ SPI_SETMOUSESCROLLCHARS_REGKEY

#define SPI_SETMOUSESCROLLCHARS_REGKEY   "Control Panel\\Desktop"

Definition at line 157 of file sysparams.c.

◆ SPI_SETMOUSESCROLLCHARS_VALNAME

#define SPI_SETMOUSESCROLLCHARS_VALNAME   "WheelScrollChars"

Definition at line 158 of file sysparams.c.

◆ SPI_SETMOUSESCROLLLINES_REGKEY

#define SPI_SETMOUSESCROLLLINES_REGKEY   "Control Panel\\Desktop"

Definition at line 159 of file sysparams.c.

◆ SPI_SETMOUSESCROLLLINES_VALNAME

#define SPI_SETMOUSESCROLLLINES_VALNAME   "WheelScrollLines"

Definition at line 160 of file sysparams.c.

◆ SPI_SETPOWEROFFACTIVE_REGKEY

#define SPI_SETPOWEROFFACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 145 of file sysparams.c.

◆ SPI_SETPOWEROFFACTIVE_VALNAME

#define SPI_SETPOWEROFFACTIVE_VALNAME   "PowerOffActive"

Definition at line 146 of file sysparams.c.

◆ SPI_SETSCREENREADER_REGKEY

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

Definition at line 134 of file sysparams.c.

◆ SPI_SETSCREENREADER_REGKEY_LEGACY

#define SPI_SETSCREENREADER_REGKEY_LEGACY   "Control Panel\\Accessibility"

Definition at line 136 of file sysparams.c.

◆ SPI_SETSCREENREADER_VALNAME

#define SPI_SETSCREENREADER_VALNAME   "On"

Definition at line 135 of file sysparams.c.

◆ SPI_SETSCREENREADER_VALNAME_LEGACY

#define SPI_SETSCREENREADER_VALNAME_LEGACY   "Blind Access"

Definition at line 137 of file sysparams.c.

◆ SPI_SETSCREENSAVEACTIVE_REGKEY

#define SPI_SETSCREENSAVEACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 104 of file sysparams.c.

◆ SPI_SETSCREENSAVEACTIVE_VALNAME

#define SPI_SETSCREENSAVEACTIVE_VALNAME   "ScreenSaveActive"

Definition at line 105 of file sysparams.c.

◆ SPI_SETSCREENSAVETIMEOUT_REGKEY

#define SPI_SETSCREENSAVETIMEOUT_REGKEY   "Control Panel\\Desktop"

Definition at line 102 of file sysparams.c.

◆ SPI_SETSCREENSAVETIMEOUT_VALNAME

#define SPI_SETSCREENSAVETIMEOUT_VALNAME   "ScreenSaveTimeOut"

Definition at line 103 of file sysparams.c.

◆ SPI_SETSHOWSOUNDS_REGKEY

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

Definition at line 128 of file sysparams.c.

◆ SPI_SETSHOWSOUNDS_VALNAME

#define SPI_SETSHOWSOUNDS_VALNAME   "On"

Definition at line 129 of file sysparams.c.

◆ SPI_SETSNAPTODEFBUTTON_REGKEY

#define SPI_SETSNAPTODEFBUTTON_REGKEY   "Control Panel\\Mouse"

Definition at line 149 of file sysparams.c.

◆ SPI_SETSNAPTODEFBUTTON_VALNAME

#define SPI_SETSNAPTODEFBUTTON_VALNAME   "SnapToDefaultButton"

Definition at line 150 of file sysparams.c.

◆ SPI_SETWORKAREA_REGKEY

#define SPI_SETWORKAREA_REGKEY   "Control Panel\\Desktop"

Definition at line 126 of file sysparams.c.

◆ SPI_SETWORKAREA_VALNAME

#define SPI_SETWORKAREA_VALNAME   "WINE_WorkArea"

Definition at line 127 of file sysparams.c.

◆ SPI_SMCAPTIONFONT_VALNAME

#define SPI_SMCAPTIONFONT_VALNAME   "SmCaptionFont"

Definition at line 82 of file sysparams.c.

◆ SPI_SMCAPTIONHEIGHT_VALNAME

#define SPI_SMCAPTIONHEIGHT_VALNAME   "SmCaptionHeight"

Definition at line 81 of file sysparams.c.

◆ SPI_SMCAPTIONWIDTH_VALNAME

#define SPI_SMCAPTIONWIDTH_VALNAME   "SmCaptionWidth"

Definition at line 80 of file sysparams.c.

◆ SPI_STATUSFONT_VALNAME

#define SPI_STATUSFONT_VALNAME   "StatusFont"

Definition at line 86 of file sysparams.c.

◆ TEST_NONCLIENTMETRICS_REG

#define TEST_NONCLIENTMETRICS_REG (   ncm)
Value:
do { \
/*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); } while(0)
#define SPI_MESSAGEFONT_VALNAME
Definition: sysparams.c:87
#define SPI_SCROLLHEIGHT_VALNAME
Definition: sysparams.c:76
#define SPI_CAPTIONFONT_VALNAME
Definition: sysparams.c:79
#define SPI_MENUFONT_VALNAME
Definition: sysparams.c:85
#define SPI_SCROLLWIDTH_VALNAME
Definition: sysparams.c:75
#define SPI_SMCAPTIONFONT_VALNAME
Definition: sysparams.c:82
#define SPI_CAPTIONHEIGHT_VALNAME
Definition: sysparams.c:78
#define SPI_MENUHEIGHT_VALNAME
Definition: sysparams.c:84
#define SPI_SMCAPTIONHEIGHT_VALNAME
Definition: sysparams.c:81
#define SPI_MENUWIDTH_VALNAME
Definition: sysparams.c:83
#define SPI_STATUSFONT_VALNAME
Definition: sysparams.c:86
#define SPI_SMCAPTIONWIDTH_VALNAME
Definition: sysparams.c:80
#define SPI_METRIC_REGKEY
Definition: sysparams.c:74

Definition at line 1450 of file sysparams.c.

◆ test_reg_font

#define test_reg_font (   KEY,
  VAL,
  LF 
)
Value:
do { \
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);\
} while(0)
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static int real_dpi
Definition: sysparams.c:59
static int dpi
Definition: sysparams.c:59
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
Definition: btrfs.h:143
LONG lfHeight
Definition: dimm.idl:42
LONG lfWeight
Definition: dimm.idl:46
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
LONG lfWidth
Definition: dimm.idl:43
#define LF
Definition: telnetd.h:24
#define VAL(data, px, pl, pos)
Definition: driver.h:91

Definition at line 1439 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 461 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 471 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 465 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 467 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 469 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 463 of file sysparams.c.

◆ test_reg_metric

#define test_reg_metric (   KEY,
  VAL,
  val 
)
Value:
do { \
INT regval;\
regval = metricfromreg( KEY, VAL, dpi);\
ok( regval==val, "wrong value \"%s\" in registry %d, expected %d\n", VAL, regval, val);\
} while(0)
GLuint GLfloat * val
Definition: glext.h:7180
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:476
int32_t INT
Definition: typedefs.h:58

Definition at line 1426 of file sysparams.c.

◆ test_reg_metric2

#define test_reg_metric2 (   KEY1,
  KEY2,
  VAL,
  val 
)
Value:
do { \
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);\
} while(0)

Definition at line 1432 of file sysparams.c.

◆ WINE_CURRENT_USER_REGKEY

#define WINE_CURRENT_USER_REGKEY   "Wine"

Definition at line 167 of file sysparams.c.

Typedef Documentation

◆ LPLOGFONT16

Function Documentation

◆ _GdiGetCharDimensions()

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

Definition at line 2608 of file sysparams.c.

2609{
2610 SIZE sz;
2611 static const CHAR alphabet[] = {
2612 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
2613 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
2614 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
2615
2616 if(lptm && !GetTextMetricsA(hdc, lptm)) return 0;
2617
2618 if(!GetTextExtentPointA(hdc, alphabet, 52, &sz)) return 0;
2619
2620 if (height) *height = sz.cy;
2621 return (sz.cx / 26 + 1) / 2;
2622}
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
HDC hdc
Definition: main.c:9
static LPTEXTMETRICW lptm
Definition: font.c:42
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
BOOL WINAPI GetTextExtentPointA(_In_ HDC hdc, _In_reads_(c) LPCSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
char CHAR
Definition: xmlstorage.h:175

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 325 of file sysparams.c.

327{
329 DWORD valueLen;
330 DWORD type;
331 HKEY hKey;
332 LONG rc;
333 int found=0;
334
335 *value='\0';
336 valueLen=sizeof(value);
337 RegOpenKeyA( HKEY_CURRENT_USER, subKey1, &hKey );
338 rc=RegQueryValueExA( hKey, valName1, NULL, &type, (LPBYTE)value, &valueLen );
339 RegCloseKey( hKey );
340 if (rc==ERROR_SUCCESS)
341 {
342 ok( type == exp_type, "wrong type %u/%u\n", type, exp_type );
343 switch (exp_type)
344 {
345 case REG_DWORD:
346 ok( *(DWORD *)value == *(DWORD *)exp_value,
347 "Wrong value in registry: %s %s %08x/%08x\n",
348 subKey1, valName1, *(DWORD *)value, *(DWORD *)exp_value );
349 break;
350 case REG_SZ:
351 ok( !strcmp( exp_value, value ),
352 "Wrong value in registry: %s %s '%s' instead of '%s'\n",
353 subKey1, valName1, value, (const char *)exp_value );
354 break;
355 }
356 found++;
357 }
358 else if (strict)
359 {
360 ok(0,"Missing registry entry: subKey=%s, valName=%s\n",
361 subKey1, valName1);
362 }
363 if (valName2)
364 {
365 *value='\0';
366 valueLen=sizeof(value);
367 RegOpenKeyA( HKEY_CURRENT_USER, subKey1, &hKey );
368 rc=RegQueryValueExA( hKey, valName2, NULL, &type, (LPBYTE)value, &valueLen );
369 RegCloseKey( hKey );
370 if (rc==ERROR_SUCCESS)
371 {
372 ok( type == exp_type, "wrong type %u/%u\n", type, exp_type );
373 switch (exp_type)
374 {
375 case REG_DWORD:
376 ok( *(DWORD *)value == *(DWORD *)exp_value,
377 "Wrong value in registry: %s %s %08x/%08x\n",
378 subKey1, valName1, *(DWORD *)value, *(DWORD *)exp_value );
379 break;
380 case REG_SZ:
381 ok( !strcmp( exp_value, value ),
382 "Wrong value in registry: %s %s '%s' instead of '%s'\n",
383 subKey1, valName1, value, (const char *)exp_value );
384 break;
385 }
386 found++;
387 }
388 else if (strict)
389 {
390 ok( 0,"Missing registry entry: subKey=%s, valName=%s\n",
391 subKey1, valName2 );
392 }
393 }
394 if (subKey2 && !strict)
395 {
396 *value='\0';
397 valueLen=sizeof(value);
398 RegOpenKeyA( HKEY_CURRENT_USER, subKey2, &hKey );
399 rc=RegQueryValueExA( hKey, valName1, NULL, &type, (LPBYTE)value, &valueLen );
400 RegCloseKey( hKey );
401 if (rc==ERROR_SUCCESS)
402 {
403 ok( type == exp_type, "wrong type %u/%u\n", type, exp_type );
404 switch (exp_type)
405 {
406 case REG_DWORD:
407 ok( *(DWORD *)value == *(DWORD *)exp_value,
408 "Wrong value in registry: %s %s %08x/%08x\n",
409 subKey1, valName1, *(DWORD *)value, *(DWORD *)exp_value );
410 break;
411 case REG_SZ:
412 ok( !strcmp( exp_value, value ),
413 "Wrong value in registry: %s %s '%s' instead of '%s'\n",
414 subKey1, valName1, value, (const char *)exp_value );
415 break;
416 }
417 found++;
418 }
419 else if (strict)
420 {
421 ok( 0,"Missing registry entry: subKey=%s, valName=%s\n",
422 subKey2, valName1 );
423 }
424 if (valName2)
425 {
426 *value='\0';
427 valueLen=sizeof(value);
428 RegOpenKeyA( HKEY_CURRENT_USER, subKey2, &hKey );
429 rc=RegQueryValueExA( hKey, valName2, NULL, &type, (LPBYTE)value, &valueLen );
430 RegCloseKey( hKey );
431 if (rc==ERROR_SUCCESS)
432 {
433 ok( type == exp_type, "wrong type %u/%u\n", type, exp_type );
434 switch (exp_type)
435 {
436 case REG_DWORD:
437 ok( *(DWORD *)value == *(DWORD *)exp_value,
438 "Wrong value in registry: %s %s %08x/%08x\n",
439 subKey1, valName1, *(DWORD *)value, *(DWORD *)exp_value );
440 break;
441 case REG_SZ:
442 ok( !strcmp( exp_value, value ),
443 "Wrong value in registry: %s %s '%s' instead of '%s'\n",
444 subKey1, valName1, value, (const char *)exp_value );
445 break;
446 }
447 found++;
448 }
449 else if (strict)
450 {
451 ok( 0,"Missing registry entry: subKey=%s, valName=%s\n",
452 subKey2, valName2 );
453 }
454 }
455 }
456 ok(found || optional,
457 "Missing registry values: %s or %s in keys: %s or %s\n",
458 valName1, (valName2?valName2:"<n/a>"), subKey1, (subKey2?subKey2:"<n/a>") );
459}
@ optional
Definition: SystemMenu.c:34
#define ok(value,...)
Definition: atltest.h:57
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
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:4009
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define REG_SZ
Definition: layer.c:22
static BOOL strict
Definition: sysparams.c:58
long LONG
Definition: pedump.c:60
#define REG_DWORD
Definition: sdbapi.c:596
unsigned char * LPBYTE
Definition: typedefs.h:53
Definition: pdh_main.c:94
#define HKEY_CURRENT_USER
Definition: winreg.h:11

◆ BOOL()

static BOOL ( WINAPI pIsProcessDPIAware)
static

◆ compare_font()

static void compare_font ( const LOGFONTW lf1,
const LOGFONTW lf2,
int  dpi,
int  custom_dpi,
int  line 
)
static

Definition at line 2918 of file sysparams.c.

2919{
2920 ok_(__FILE__,line)( lf1->lfHeight == MulDiv( lf2->lfHeight, dpi, custom_dpi ),
2921 "wrong lfHeight %d vs %d\n", lf1->lfHeight, lf2->lfHeight );
2922 ok_(__FILE__,line)( abs( lf1->lfWidth - MulDiv( lf2->lfWidth, dpi, custom_dpi )) <= 1,
2923 "wrong lfWidth %d vs %d\n", lf1->lfWidth, lf2->lfWidth );
2924 ok_(__FILE__,line)( !memcmp( &lf1->lfEscapement, &lf2->lfEscapement,
2925 offsetof( LOGFONTW, lfFaceName ) - offsetof( LOGFONTW, lfEscapement )),
2926 "font differs\n" );
2927 ok_(__FILE__,line)( !lstrcmpW( lf1->lfFaceName, lf2->lfFaceName ), "wrong face name %s vs %s\n",
2929}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ok_(x1, x2)
Definition: atltest.h:61
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
#define abs(i)
Definition: fconv.c:206
#define wine_dbgstr_w
Definition: kernel32.h:34
#define offsetof(TYPE, MEMBER)
LONG lfHeight
Definition: dimm.idl:59
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
LONG lfWidth
Definition: dimm.idl:60
LONG lfEscapement
Definition: dimm.idl:61
Definition: parser.c:49

Referenced by test_metrics_for_dpi().

◆ dotest_spi_iconhorizontalspacing()

static BOOL dotest_spi_iconhorizontalspacing ( INT  curr_val)
static

Definition at line 900 of file sysparams.c.

901{
902 BOOL rc;
903 INT spacing, regval, min_val = MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI );
904 ICONMETRICSA im;
905
908 if (!test_error_msg(rc,"SPI_ICONHORIZONTALSPACING")) return FALSE;
909 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
911 curr_val = max( curr_val, min_val );
912 /* The registry keys depend on the Windows version and the values too
913 * let's test (works on win95,ME,NT4,2k,XP)
914 */
916 if( regval != curr_val)
918 ok( curr_val == regval,
919 "wrong value in registry %d, expected %d\n", regval, curr_val);
920 /* compare with what SPI_ICONHORIZONTALSPACING returns */
922 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
923 eq( spacing, curr_val, "ICONHORIZONTALSPACING", "%d");
924 /* and with a system metrics */
925 eq( GetSystemMetrics( SM_CXICONSPACING ), curr_val, "SM_CXICONSPACING", "%d" );
926 /* and with what SPI_GETICONMETRICS returns */
927 im.cbSize = sizeof(ICONMETRICSA);
928 rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im, FALSE );
929 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
930 eq( im.iHorzSpacing, curr_val, "SPI_GETICONMETRICS", "%d" );
931 return TRUE;
932}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SPI_ICONHORIZONTALSPACING_REGKEY2
Definition: sysparams.c:92
#define eq(received, expected, label, type)
Definition: sysparams.c:61
static void test_change_message(int action, int optional)
Definition: sysparams.c:279
#define SPI_ICONHORIZONTALSPACING_REGKEY
Definition: sysparams.c:91
#define SPI_ICONHORIZONTALSPACING_VALNAME
Definition: sysparams.c:93
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:293
#define max(a, b)
Definition: svc.c:63
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SPIF_SENDCHANGE
Definition: winuser.h:1575
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1574
BOOL WINAPI SystemParametersInfoA(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define SPI_ICONHORIZONTALSPACING
Definition: winuser.h:1365
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:4931
#define SM_CXICONSPACING
Definition: winuser.h:1004

Referenced by test_SPI_ICONHORIZONTALSPACING().

◆ dotest_spi_iconverticalspacing()

static BOOL dotest_spi_iconverticalspacing ( INT  curr_val)
static

Definition at line 1069 of file sysparams.c.

1070{
1071 BOOL rc;
1072 INT spacing, regval, min_val = MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI );
1073 ICONMETRICSA im;
1074
1077 if (!test_error_msg(rc,"SPI_ICONVERTICALSPACING")) return FALSE;
1078 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1080 curr_val = max( curr_val, min_val );
1081 /* The registry keys depend on the Windows version and the values too
1082 * let's test (works on win95,ME,NT4,2k,XP)
1083 */
1085 if( regval != curr_val)
1087 ok( curr_val == regval,
1088 "wrong value in registry %d, expected %d\n", regval, curr_val);
1089 /* compare with what SPI_ICONVERTICALSPACING returns */
1090 rc=SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0, &spacing, 0 );
1091 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1092 eq( spacing, curr_val, "ICONVERTICALSPACING", "%d" );
1093 /* and with a system metrics */
1094 eq( GetSystemMetrics( SM_CYICONSPACING ), curr_val, "SM_CYICONSPACING", "%d" );
1095 /* and with what SPI_GETICONMETRICS returns */
1096 im.cbSize = sizeof(ICONMETRICSA);
1097 rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im, FALSE );
1098 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1099 eq( im.iVertSpacing, curr_val, "SPI_GETICONMETRICS", "%d" );
1100 return TRUE;
1101}
#define SPI_ICONVERTICALSPACING_REGKEY2
Definition: sysparams.c:95
#define SPI_ICONVERTICALSPACING_VALNAME
Definition: sysparams.c:96
#define SPI_ICONVERTICALSPACING_REGKEY
Definition: sysparams.c:94
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1376
#define SM_CYICONSPACING
Definition: winuser.h:1005

Referenced by test_SPI_ICONVERTICALSPACING().

◆ DPI_AWARENESS()

static DPI_AWARENESS ( WINAPI pGetAwarenessFromDpiAwarenessContext)
static

◆ DPI_AWARENESS_CONTEXT()

static DPI_AWARENESS_CONTEXT ( WINAPI pGetThreadDpiAwarenessContext)
static

◆ dpi_winproc()

static LRESULT CALLBACK dpi_winproc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 3733 of file sysparams.c.

3734{
3735 DPI_AWARENESS_CONTEXT ctx = pGetWindowDpiAwarenessContext( hwnd );
3736 DPI_AWARENESS_CONTEXT ctx2 = pGetThreadDpiAwarenessContext();
3737 DWORD pos, pos2;
3738
3739 ok( pGetAwarenessFromDpiAwarenessContext( ctx ) == pGetAwarenessFromDpiAwarenessContext( ctx2 ),
3740 "msg %04x wrong awareness %p / %p\n", msg, ctx, ctx2 );
3741 pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3742 pos = GetMessagePos();
3743 pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3744 pos2 = GetMessagePos();
3745 ok( pos == pos2, "wrong pos %08x / %08x\n", pos, pos2 );
3746 pSetThreadDpiAwarenessContext( ctx2 );
3747 return DefWindowProcA( hwnd, msg, wp, lp );
3748}
#define msg(x)
Definition: auth_time.c:54
static UINT UINT *static DPI_AWARENESS_CONTEXT(WINAPI *pGetThreadDpiAwarenessContext)(void)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define DPI_AWARENESS_CONTEXT_UNAWARE
Definition: windef.h:292
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
Definition: windef.h:294
DWORD WINAPI GetMessagePos(void)
Definition: message.c:1351
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by START_TEST(), and test_dpi_window().

◆ 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 2673 of file sysparams.c.

2674{
2675 return lstrcmpiA(elf->lfFaceName, (const char *)lparam);
2676}
@ lparam
Definition: SystemMenu.c:31
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4224

Referenced by is_font_enumerated().

◆ get_cursor_size()

static int get_cursor_size ( int  size)
static

Definition at line 2690 of file sysparams.c.

2691{
2692 /* only certain sizes are allowed for cursors */
2693 if (size >= 64) return 64;
2694 if (size >= 48) return 48;
2695 return 32;
2696}
GLsizeiptr size
Definition: glext.h:5919

Referenced by test_GetSystemMetrics().

◆ get_real_dpi()

static DWORD get_real_dpi ( void  )
static

Definition at line 200 of file sysparams.c.

201{
202 DWORD dpi;
203
204 if (pSetThreadDpiAwarenessContext)
205 {
206 DPI_AWARENESS_CONTEXT context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
207 dpi = pGetDpiForSystem();
208 pSetThreadDpiAwarenessContext( context );
209 return dpi;
210 }
211 if (get_reg_dword(HKEY_CURRENT_USER, "Control Panel\\Desktop", "LogPixels", &dpi))
212 return dpi;
213 if (get_reg_dword(HKEY_CURRENT_CONFIG, "Software\\Fonts", "LogPixels", &dpi))
214 return dpi;
216}
static BOOL get_reg_dword(HKEY base, const char *key_name, const char *value_name, DWORD *value)
Definition: sysparams.c:181
Definition: http.c:7252
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
Definition: windef.h:293
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15

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 181 of file sysparams.c.

182{
183 HKEY key;
184 DWORD type, data, size = sizeof(data);
185 BOOL ret = FALSE;
186
188 {
189 if (RegQueryValueExA(key, value_name, NULL, &type, (void *)&data, &size) == ERROR_SUCCESS &&
190 type == REG_DWORD)
191 {
192 *value = data;
193 ret = TRUE;
194 }
196 }
197 return ret;
198}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
Definition: copy.c:22
int ret

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 2626 of file sysparams.c.

2627{
2628 HFONT hfont, hfontsav;
2630 if( !ptm) ptm = &tm;
2631 hfont = CreateFontIndirectA( plf);
2632 if( !hfont || ( hfontsav = SelectObject( hdc, hfont)) == NULL ) {
2633 ptm->tmHeight = -1;
2634 if( psz) *psz = 10;
2635 if( hfont) DeleteObject( hfont);
2636 return;
2637 }
2638 GetTextMetricsA( hdc, ptm);
2639 if( psz)
2640 if( !(*psz = _GdiGetCharDimensions( hdc, ptm, NULL)))
2641 *psz = 10;
2642 SelectObject( hdc, hfontsav);
2644}
static HFONT hfont
pKey DeleteObject()
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static LONG _GdiGetCharDimensions(HDC hdc, LPTEXTMETRICA lptm, LONG *height)
Definition: sysparams.c:2608
LONG tmHeight
Definition: wingdi.h:2361
Definition: time.h:68
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546

Referenced by test_GetSystemMetrics().

◆ get_tmheight()

static int get_tmheight ( LOGFONTA plf,
int  flag 
)
static

Definition at line 1467 of file sysparams.c.

1468{
1470 HDC hdc = GetDC(0);
1475 ReleaseDC( 0, hdc );
1476 return tm.tmHeight + (flag ? tm.tmExternalLeading : 0);
1477}
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
static HDC
Definition: imagelist.c:88
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by test_SPI_SETNONCLIENTMETRICS().

◆ get_tmheightW()

static int get_tmheightW ( LOGFONTW plf,
int  flag 
)
static

Definition at line 1479 of file sysparams.c.

1480{
1482 HDC hdc = GetDC(0);
1487 ReleaseDC( 0, hdc );
1488 return tm.tmHeight + (flag ? tm.tmExternalLeading : 0);
1489}
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)

Referenced by test_metrics_for_dpi().

◆ INT()

static INT ( WINAPI pGetSystemMetricsForDpi)
static

◆ is_font_enumerated()

static BOOL is_font_enumerated ( const char name)
static

Definition at line 2678 of file sysparams.c.

2679{
2681 BOOL ret = FALSE;
2682
2684 ret = TRUE;
2685
2686 DeleteDC(hdc);
2687 return ret;
2688}
static INT CALLBACK enum_all_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam)
Definition: sysparams.c:2673
Definition: name.c:39
LONG_PTR LPARAM
Definition: windef.h:208
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI EnumFontFamiliesA(_In_ HDC, _In_opt_ LPCSTR, _In_ FONTENUMPROCA, _In_ LPARAM)
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by test_GetSystemMetrics().

◆ lffromreg()

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

Definition at line 514 of file sysparams.c.

515{
516 HKEY hkey;
517 LOGFONTW lfw;
518 DWORD ret, size, type;
519
520 RegOpenKeyA( HKEY_CURRENT_USER, keyname, &hkey );
521 size = sizeof( lfw);
522 ret=RegQueryValueExA( hkey, valname, NULL, &type, (LPBYTE)&lfw, &size );
523 RegCloseKey( hkey );
524 ok( ret == ERROR_SUCCESS, "Key \"%s\" value \"%s\" not found\n", keyname, valname);
525 if( ret != ERROR_SUCCESS)
526 return FALSE;
527 if( size <= sizeof( LOGFONT16)) {
528 LOGFONT16 *plf16 = (LOGFONT16*) &lfw;
529 plf->lfHeight = plf16->lfHeight;
530 plf->lfWidth = plf16->lfWidth;
531 plf->lfEscapement = plf16->lfEscapement;
532 plf->lfOrientation = plf16->lfOrientation;
533 plf->lfWeight = plf16->lfWeight;
534 plf->lfItalic = plf16->lfItalic;
535 plf->lfUnderline = plf16->lfUnderline;
536 plf->lfStrikeOut = plf16->lfStrikeOut;
537 plf->lfCharSet = plf16->lfCharSet;
538 plf->lfOutPrecision = plf16->lfOutPrecision;
539 plf->lfClipPrecision = plf16->lfClipPrecision;
540 plf->lfQuality = plf16->lfQuality;
542 memcpy( plf->lfFaceName, plf16->lfFaceName, LF_FACESIZE );
543 } else if( size <= sizeof( LOGFONTA)) {
544 plf = (LOGFONTA*) &lfw;
545 } else {
546 plf->lfHeight = lfw.lfHeight;
547 plf->lfWidth = lfw.lfWidth;
548 plf->lfEscapement = lfw.lfEscapement;
549 plf->lfOrientation = lfw.lfOrientation;
550 plf->lfWeight = lfw.lfWeight;
551 plf->lfItalic = lfw.lfItalic;
552 plf->lfUnderline = lfw.lfUnderline;
553 plf->lfStrikeOut = lfw.lfStrikeOut;
554 plf->lfCharSet = lfw.lfCharSet;
557 plf->lfQuality = lfw.lfQuality;
561
562 }
563 return TRUE;
564}
#define LF_FACESIZE
Definition: dimm.idl:39
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BYTE lfStrikeOut
Definition: sysparams.c:504
BYTE lfCharSet
Definition: sysparams.c:505
BYTE lfPitchAndFamily
Definition: sysparams.c:509
BYTE lfClipPrecision
Definition: sysparams.c:507
CHAR lfFaceName[LF_FACESIZE]
Definition: sysparams.c:510
BYTE lfUnderline
Definition: sysparams.c:503
INT16 lfWeight
Definition: sysparams.c:501
INT16 lfHeight
Definition: sysparams.c:497
INT16 lfEscapement
Definition: sysparams.c:499
INT16 lfWidth
Definition: sysparams.c:498
BYTE lfOutPrecision
Definition: sysparams.c:506
BYTE lfQuality
Definition: sysparams.c:508
BYTE lfItalic
Definition: sysparams.c:502
INT16 lfOrientation
Definition: sysparams.c:500
BYTE lfStrikeOut
Definition: dimm.idl:49
BYTE lfClipPrecision
Definition: dimm.idl:52
BYTE lfUnderline
Definition: dimm.idl:48
BYTE lfQuality
Definition: dimm.idl:53
BYTE lfOutPrecision
Definition: dimm.idl:51
LONG lfOrientation
Definition: dimm.idl:45
BYTE lfItalic
Definition: dimm.idl:47
BYTE lfPitchAndFamily
Definition: dimm.idl:54
LONG lfEscapement
Definition: dimm.idl:44
BYTE lfCharSet
Definition: dimm.idl:50
BYTE lfOutPrecision
Definition: dimm.idl:68
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
LONG lfWeight
Definition: dimm.idl:63
LONG lfOrientation
Definition: dimm.idl:62
BYTE lfUnderline
Definition: dimm.idl:65
BYTE lfClipPrecision
Definition: dimm.idl:69
BYTE lfCharSet
Definition: dimm.idl:67
BYTE lfQuality
Definition: dimm.idl:70
BYTE lfPitchAndFamily
Definition: dimm.idl:71

◆ LONG()

static LONG ( WINAPI pChangeDisplaySettingsExA)
static

◆ metricfromreg()

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

Definition at line 476 of file sysparams.c.

477{
478 HKEY hkey;
479 char buf[64];
480 DWORD ret;
481 DWORD size, type;
482 int value;
483
484 RegOpenKeyA( HKEY_CURRENT_USER, keyname, &hkey );
485 size = sizeof(buf);
486 ret=RegQueryValueExA( hkey, valname, NULL, &type, (LPBYTE)buf, &size );
487 RegCloseKey( hkey );
488 if( ret != ERROR_SUCCESS) return -1;
489 value = atoi( buf);
490 if( value < 0)
491 value = ( -value * dpi + 720) / 1440;
492 return value;
493}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)

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 635 of file sysparams.c.

636{
637 BOOL rc;
638 INT mi[3];
639 static int aw_turn = 0;
640
641 char buf[20];
642 int i;
643
644 aw_turn++;
645 rc = FALSE;
646 SetLastError(0xdeadbeef);
647 if (aw_turn % 2) /* call unicode on odd (non even) calls */
649 else
651 if (!test_error_msg(rc,"SPI_SETMOUSE")) return FALSE;
652
653 ok(rc, "SystemParametersInfo: rc=%d err=%d\n", rc, GetLastError());
655 for (i = 0; i < 3; i++)
656 {
657 sprintf( buf, "%d", curr_val[i] );
659 }
660
662 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
663 for (i = 0; i < 3; i++)
664 {
665 ok(mi[i] == curr_val[i],
666 "incorrect value for %d: %d != %d\n", i, mi[i], curr_val[i]);
667 }
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 if (0)
678 {
679 /* FIXME: this always fails for me - AJ */
680 for (i = 0; i < nchange; i++)
681 {
682 POINT mv;
684 mouse_event( MOUSEEVENTF_MOVE, req_change[i].x, req_change[i].y, 0, 0 );
685 GetCursorPos( &mv );
686 ok( proj_change[i].x == mv.x, "Projected dx and real dx comparison. May fail under high load.\n" );
687 ok( proj_change[i].y == mv.y, "Projected dy equals real dy. May fail under high load.\n" );
688 }
689 }
690 return TRUE;
691}
#define SetLastError(x)
Definition: compat.h:752
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static const char * setmouse_valuenames[3]
Definition: sysparams.c:626
#define SPI_SETMOUSE_REGKEY
Definition: sysparams.c:67
#define test_reg_key(subKey, valName, testValue)
Definition: sysparams.c:461
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
static MONITORINFO mi
Definition: win.c:7338
#define MOUSEEVENTF_ABSOLUTE
Definition: winuser.h:1197
void WINAPI mouse_event(_In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ ULONG_PTR)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2722
#define SPI_GETMOUSE
Definition: winuser.h:1358
#define MOUSEEVENTF_MOVE
Definition: winuser.h:1186
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define SPI_SETMOUSE
Definition: winuser.h:1359

Referenced by test_SPI_SETMOUSE().

◆ scale_point_dpi()

static void scale_point_dpi ( POINT pt,
UINT  src_dpi,
UINT  target_dpi 
)
static

Definition at line 3182 of file sysparams.c.

3183{
3184 pt->x = MulDiv( pt->x, target_dpi, src_dpi );
3185 pt->y = MulDiv( pt->y, target_dpi, src_dpi );
3186}
#define pt(x, y)
Definition: drawing.c:79

Referenced by scale_point_dpi_aware().

◆ scale_point_dpi_aware()

static void scale_point_dpi_aware ( POINT pt,
DPI_AWARENESS  from,
DPI_AWARENESS  to 
)
static

Definition at line 3196 of file sysparams.c.

3197{
3202}
static void scale_point_dpi(POINT *pt, UINT src_dpi, UINT target_dpi)
Definition: sysparams.c:3182
CardRegion * from
Definition: spigame.cpp:19
@ DPI_AWARENESS_UNAWARE
Definition: windef.h:287

Referenced by test_dpi_mapping().

◆ scale_rect_dpi()

static void scale_rect_dpi ( RECT rect,
UINT  src_dpi,
UINT  target_dpi 
)
static

Definition at line 3188 of file sysparams.c.

3189{
3190 rect->left = MulDiv( rect->left, target_dpi, src_dpi );
3191 rect->top = MulDiv( rect->top, target_dpi, src_dpi );
3192 rect->right = MulDiv( rect->right, target_dpi, src_dpi );
3193 rect->bottom = MulDiv( rect->bottom, target_dpi, src_dpi );
3194}
& rect
Definition: startmenu.cpp:1413

Referenced by scale_rect_dpi_aware(), and test_dpi_mapping().

◆ scale_rect_dpi_aware()

static void scale_rect_dpi_aware ( RECT rect,
DPI_AWARENESS  from,
DPI_AWARENESS  to 
)
static

Definition at line 3204 of file sysparams.c.

3205{
3210}
static void scale_rect_dpi(RECT *rect, UINT src_dpi, UINT target_dpi)
Definition: sysparams.c:3188

Referenced by test_dpi_mapping().

◆ START_TEST()

START_TEST ( sysparams  )

Definition at line 3892 of file sysparams.c.

3893{
3894 int argc;
3895 char** argv;
3896 WNDCLASSA wc;
3897 MSG msg;
3898 HDC hdc;
3902
3903 hdll = GetModuleHandleA("user32.dll");
3904 pChangeDisplaySettingsExA = (void*)GetProcAddress(hdll, "ChangeDisplaySettingsExA");
3905 pIsProcessDPIAware = (void*)GetProcAddress(hdll, "IsProcessDPIAware");
3906 pSetProcessDPIAware = (void*)GetProcAddress(hdll, "SetProcessDPIAware");
3907 pGetDpiForSystem = (void*)GetProcAddress(hdll, "GetDpiForSystem");
3908 pGetDpiForWindow = (void*)GetProcAddress(hdll, "GetDpiForWindow");
3909 pGetDpiForMonitorInternal = (void*)GetProcAddress(hdll, "GetDpiForMonitorInternal");
3910 pSetProcessDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetProcessDpiAwarenessContext");
3911 pGetProcessDpiAwarenessInternal = (void*)GetProcAddress(hdll, "GetProcessDpiAwarenessInternal");
3912 pSetProcessDpiAwarenessInternal = (void*)GetProcAddress(hdll, "SetProcessDpiAwarenessInternal");
3913 pGetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetThreadDpiAwarenessContext");
3914 pSetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetThreadDpiAwarenessContext");
3915 pGetWindowDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetWindowDpiAwarenessContext");
3916 pGetAwarenessFromDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetAwarenessFromDpiAwarenessContext");
3917 pIsValidDpiAwarenessContext = (void*)GetProcAddress(hdll, "IsValidDpiAwarenessContext");
3918 pGetSystemMetricsForDpi = (void*)GetProcAddress(hdll, "GetSystemMetricsForDpi");
3919 pSystemParametersInfoForDpi = (void*)GetProcAddress(hdll, "SystemParametersInfoForDpi");
3920 pAdjustWindowRectExForDpi = (void*)GetProcAddress(hdll, "AdjustWindowRectExForDpi");
3921 pLogicalToPhysicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "LogicalToPhysicalPointForPerMonitorDPI");
3922 pPhysicalToLogicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "PhysicalToLogicalPointForPerMonitorDPI");
3923 pGetAutoRotationState = (void*)GetProcAddress(hdll, "GetAutoRotationState");
3924
3926 hdc = GetDC(0);
3929 trace("dpi %d real_dpi %d\n", dpi, real_dpi);
3930 ReleaseDC( 0, hdc);
3931
3932 /* This test requires interactivity, if we don't have it, give up */
3935
3937 strict=(argc >= 3 && strcmp(argv[2],"strict")==0);
3938 trace("strict=%d\n",strict);
3939
3940 trace("testing GetSystemMetrics with your current desktop settings\n");
3942 test_metrics_for_dpi( 192 );
3946
3947 change_counter = 0;
3949
3950 wc.lpszClassName = "SysParamsTestClass";
3953 wc.hInstance = hInstance;
3955 wc.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW );
3956 wc.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
3957 wc.lpszMenuName = 0;
3958 wc.cbClsExtra = 0;
3959 wc.cbWndExtra = 0;
3960 RegisterClassA( &wc );
3961 wc.lpszClassName = "DpiTestClass";
3963 RegisterClassA( &wc );
3964
3965 ghTestWnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application",
3966 WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, hInstance, NULL );
3967
3969 assert( hThread );
3971
3972 while( GetMessageA( &msg, 0, 0, 0 )) {
3975 }
3976
3977 if (pSetThreadDpiAwarenessContext)
3978 {
3982 }
3983 else win_skip( "SetThreadDpiAwarenessContext not supported\n" );
3984
3986}
static int argc
Definition: ServiceArgs.c:12
#define trace
Definition: atltest.h:70
HINSTANCE hInstance
Definition: charmap.c:19
#define CloseHandle
Definition: compat.h:739
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
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:137
#define assert(x)
Definition: debug.h:53
DWORD dwThreadId
Definition: fdebug.c:31
static void test_EnumDisplaySettings(void)
Definition: sysparams.c:3077
static DWORD WINAPI SysParamsThreadFunc(LPVOID lpParam)
Definition: sysparams.c:2550
static int change_last_param
Definition: sysparams.c:176
static void test_dpi_context(void)
Definition: sysparams.c:3532
static LRESULT CALLBACK dpi_winproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: sysparams.c:3733
static void test_dpi_mapping(void)
Definition: sysparams.c:3212
static void test_dpi_window(void)
Definition: sysparams.c:3750
static void test_GetSysColorBrush(void)
Definition: sysparams.c:3117
static void test_GetAutoRotationState(void)
Definition: sysparams.c:3871
static int change_counter
Definition: sysparams.c:174
static DWORD get_real_dpi(void)
Definition: sysparams.c:200
static void test_GetSystemMetrics(void)
Definition: sysparams.c:2698
static LRESULT CALLBACK SysParamsTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: sysparams.c:218
static void test_dpi_aware(void)
Definition: sysparams.c:3510
static HWND ghTestWnd
Definition: sysparams.c:169
static void test_metrics_for_dpi(int custom_dpi)
Definition: sysparams.c:2931
#define argv
Definition: mplay32.c:18
HANDLE hThread
Definition: wizard.c:28
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define win_skip
Definition: test.h:163
int winetest_get_mainargs(char ***pargv)
static PVOID hdll
Definition: shimdbg.c:126
HBRUSH hbrBackground
Definition: winuser.h:3173
HICON hIcon
Definition: winuser.h:3171
HINSTANCE hInstance
Definition: winuser.h:3170
HCURSOR hCursor
Definition: winuser.h:3172
int cbWndExtra
Definition: winuser.h:3169
UINT style
Definition: winuser.h:3166
LPCSTR lpszMenuName
Definition: winuser.h:3174
LPCSTR lpszClassName
Definition: winuser.h:3175
WNDPROC lpfnWndProc
Definition: winuser.h:3167
int cbClsExtra
Definition: winuser.h:3168
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define CS_VREDRAW
Definition: winuser.h:658
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:921
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4318
#define SPI_SETBEEP
Definition: winuser.h:1357
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
#define IDI_APPLICATION
Definition: winuser.h:704
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE hInstance, _In_ LPCSTR lpIconName)
Definition: cursoricon.c:2112
#define CS_OWNDC
Definition: winuser.h:655
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2142
const char * LPCSTR
Definition: xmlstorage.h:183

◆ SysParamsTestWndProc()

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

Definition at line 218 of file sysparams.c.

220{
221 switch (msg) {
222
223 case WM_DISPLAYCHANGE:
224 ok(displaychange_ok, "Unexpected WM_DISPLAYCHANGE message\n");
228 break;
229
230 case WM_SETTINGCHANGE:
231 if (change_counter>0) {
232 /* ignore these messages caused by resizing of toolbars */
233 if( wParam == SPI_SETWORKAREA){
235 break;
236 } else if( wParam == SPI_ICONVERTICALSPACING) {
238 break;
239 } else if( displaychange_test_active)
240 break;
241 if( !change_last_param){
243 break;
244 }
245 ok(0,"too many changes counter=%d last change=%d\n",
249 break;
250 }
253 if( wParam == SPI_SETWORKAREA)
257 else
259 break;
260
261 case WM_DESTROY:
262 PostQuitMessage( 0 );
263 break;
264
265 /* drop through */
266 default:
267 return( DefWindowProcA( hWnd, msg, wParam, lParam ) );
268 }
269
270 return 0;
271}
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static BOOL displaychange_test_active
Definition: sysparams.c:178
static BOOL displaychange_ok
Definition: sysparams.c:178
static int change_setworkarea_param
Definition: sysparams.c:175
static HANDLE displaychange_sem
Definition: sysparams.c:179
static int change_iconverticalspacing_param
Definition: sysparams.c:175
static int last_bpp
Definition: sysparams.c:177
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseSemaphore(IN HANDLE hSemaphore, IN LONG lReleaseCount, IN LPLONG lpPreviousCount)
Definition: synch.c:542
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SETTINGCHANGE
Definition: winuser.h:1632
#define WM_DESTROY
Definition: winuser.h:1612

Referenced by START_TEST().

◆ SysParamsThreadFunc()

static DWORD WINAPI SysParamsThreadFunc ( LPVOID  lpParam)
static

Definition at line 2550 of file sysparams.c.

2551{
2552 test_SPI_SETBEEP(); /* 1 */
2553 test_SPI_SETMOUSE(); /* 4 */
2554 test_SPI_SETBORDER(); /* 6 */
2555 test_SPI_SETKEYBOARDSPEED(); /* 10 */
2559 test_SPI_SETGRIDGRANULARITY(); /* 19 */
2560 test_SPI_SETKEYBOARDDELAY(); /* 23 */
2562 test_SPI_SETICONTITLEWRAP(); /* 26 */
2564 test_SPI_SETDOUBLECLKWIDTH(); /* 29 */
2565 test_SPI_SETDOUBLECLKHEIGHT(); /* 30 */
2566 test_SPI_SETDOUBLECLICKTIME(); /* 32 */
2567 test_SPI_SETMOUSEBUTTONSWAP(); /* 33 */
2568 test_SPI_SETFASTTASKSWITCH(); /* 36 */
2569 test_SPI_SETDRAGFULLWINDOWS(); /* 37 */
2570 /* test_WM_DISPLAYCHANGE seems to be somewhat buggy on
2571 * some versions of Windows (Vista, Win2k8, Win7B) in that
2572 * not all metrics are properly restored. Problems are
2573 * SM_CXMAXTRACK, SM_CYMAXTRACK
2574 * Fortunately setting the Non-Client metrics like in
2575 * test_SPI_SETNONCLIENTMETRICS will correct this. That is why
2576 * we do the DISPLAY change now... */
2580 test_SPI_SETICONMETRICS(); /* 46 */
2581 test_SPI_SETWORKAREA(); /* 47 */
2582 test_SPI_SETSHOWSOUNDS(); /* 57 */
2583 test_SPI_SETKEYBOARDPREF(); /* 69 */
2584 test_SPI_SETSCREENREADER(); /* 71 */
2585 test_SPI_SETFONTSMOOTHING(); /* 75 */
2586 test_SPI_SETLOWPOWERACTIVE(); /* 85 */
2587 test_SPI_SETPOWEROFFACTIVE(); /* 86 */
2588 test_SPI_SETSNAPTODEFBUTTON(); /* 95 */
2589 test_SPI_SETMOUSEHOVERWIDTH(); /* 99 */
2590 test_SPI_SETMOUSEHOVERHEIGHT(); /* 101 */
2591 test_SPI_SETMOUSEHOVERTIME(); /* 103 */
2592 test_SPI_SETWHEELSCROLLLINES(); /* 105 */
2593 test_SPI_SETMENUSHOWDELAY(); /* 107 */
2594 test_SPI_SETWHEELSCROLLCHARS(); /* 108 */
2595 test_SPI_SETWALLPAPER(); /* 115 */
2596
2597
2599 return 0;
2600}
static void test_SPI_SETSCREENREADER(void)
Definition: sysparams.c:1986
static void test_SPI_SETBORDER(void)
Definition: sysparams.c:805
static void test_SPI_SETWHEELSCROLLLINES(void)
Definition: sysparams.c:2328
static void test_SPI_SETICONMETRICS(void)
Definition: sysparams.c:1743
static void test_SPI_SETKEYBOARDDELAY(void)
Definition: sysparams.c:1031
static void test_SPI_SETLOWPOWERACTIVE(void)
Definition: sysparams.c:2102
static void test_SPI_SETSHOWSOUNDS(void)
Definition: sysparams.c:1914
static void test_SPI_SETKEYBOARDSPEED(void)
Definition: sysparams.c:864
static void test_SPI_SETICONTITLEWRAP(void)
Definition: sysparams.c:1124
static void test_SPI_SETWALLPAPER(void)
Definition: sysparams.c:2444
static void test_SPI_SETBEEP(void)
Definition: sysparams.c:566
static void test_SPI_SETMOUSEHOVERWIDTH(void)
Definition: sysparams.c:2213
static void test_SPI_SETMOUSEBUTTONSWAP(void)
Definition: sysparams.c:1339
static void test_SPI_SETKEYBOARDPREF(void)
Definition: sysparams.c:1951
static void test_SPI_SETSCREENSAVEACTIVE(void)
Definition: sysparams.c:990
static void test_SPI_SETDOUBLECLICKTIME(void)
Definition: sysparams.c:1283
static void test_SPI_SETMOUSE(void)
Definition: sysparams.c:693
static void test_WM_DISPLAYCHANGE(void)
Definition: sysparams.c:2468
static void test_SPI_SETFONTSMOOTHING(void)
Definition: sysparams.c:2021
static void test_SPI_SETMINIMIZEDMETRICS(void)
Definition: sysparams.c:1617
static void test_SPI_SETWHEELSCROLLCHARS(void)
Definition: sysparams.c:2406
static void test_SPI_SETDRAGFULLWINDOWS(void)
Definition: sysparams.c:1389
static void test_SPI_SETPOWEROFFACTIVE(void)
Definition: sysparams.c:2140
static void test_SPI_SETSNAPTODEFBUTTON(void)
Definition: sysparams.c:2178
static void test_SPI_SETWORKAREA(void)
Definition: sysparams.c:1862
static void test_SPI_SETMOUSEHOVERTIME(void)
Definition: sysparams.c:2287
static void test_SPI_SETFASTTASKSWITCH(void)
Definition: sysparams.c:1373
static void test_SPI_ICONVERTICALSPACING(void)
Definition: sysparams.c:1103
static void test_SPI_SETMENUSHOWDELAY(void)
Definition: sysparams.c:2367
static void test_SPI_SETDOUBLECLKWIDTH(void)
Definition: sysparams.c:1215
static void test_SPI_SETMENUDROPALIGNMENT(void)
Definition: sysparams.c:1176
static void test_SPI_ICONHORIZONTALSPACING(void)
Definition: sysparams.c:934
static void test_SPI_SETGRIDGRANULARITY(void)
Definition: sysparams.c:1026
static void test_SPI_SETDOUBLECLKHEIGHT(void)
Definition: sysparams.c:1249
static void test_SPI_SETSCREENSAVETIMEOUT(void)
Definition: sysparams.c:953
static void test_SPI_SETNONCLIENTMETRICS(void)
Definition: sysparams.c:1494
static void test_SPI_SETMOUSEHOVERHEIGHT(void)
Definition: sysparams.c:2250
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by START_TEST().

◆ test_change_message()

static void test_change_message ( int  action,
int  optional 
)
static

Definition at line 279 of file sysparams.c.

280{
281 if (change_counter==0 && optional==1)
282 return;
283 ok( 1 == change_counter,
284 "Missed a message: change_counter=%d\n", change_counter );
285 change_counter = 0;
287 ( change_setworkarea_param && action == SPI_SETWORKAREA) ||
289 "Wrong action got %d expected %d\n", change_last_param, action );
291}
const WCHAR * action
Definition: action.c:7509

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 3510 of file sysparams.c.

3511{
3512 BOOL ret;
3513
3514 if (!pIsProcessDPIAware)
3515 {
3516 win_skip("IsProcessDPIAware not available\n");
3517 return;
3518 }
3519
3520 ret = pSetProcessDPIAware();
3521 ok(ret, "got %d\n", ret);
3522
3523 ret = pIsProcessDPIAware();
3524 ok(ret, "got %d\n", ret);
3525
3526 dpi = real_dpi;
3529 test_metrics_for_dpi( 192 );
3530}

Referenced by START_TEST().

◆ test_dpi_context()

static void test_dpi_context ( void  )
static

Definition at line 3532 of file sysparams.c.

3533{
3534 DPI_AWARENESS awareness;
3536 ULONG_PTR i, flags;
3537 BOOL ret;
3538 UINT dpi;
3539 HDC hdc = GetDC( 0 );
3540
3541 context = pGetThreadDpiAwarenessContext();
3542 /* Windows 10 >= 1709 adds extra 0x6000 flags */
3543 flags = (ULONG_PTR)context & 0x6000;
3544 todo_wine
3545 ok( context == (DPI_AWARENESS_CONTEXT)(0x10 | flags), "wrong context %p\n", context );
3546 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3547 todo_wine
3548 ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness );
3549 todo_wine
3550 ok( !pIsProcessDPIAware(), "already aware\n" );
3551 dpi = pGetDpiForSystem();
3553 ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3556 ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3557 SetLastError( 0xdeadbeef );
3558 ret = pSetProcessDpiAwarenessContext( NULL );
3559 ok( !ret, "got %d\n", ret );
3560 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3561 SetLastError( 0xdeadbeef );
3562 ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)-6 );
3563 ok( !ret, "got %d\n", ret );
3564 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3565 ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
3566 todo_wine
3567 ok( ret, "got %d\n", ret );
3568 ok( pIsProcessDPIAware(), "not aware\n" );
3569 real_dpi = pGetDpiForSystem();
3570 SetLastError( 0xdeadbeef );
3571 ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
3572 ok( !ret, "got %d\n", ret );
3573 ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
3574 SetLastError( 0xdeadbeef );
3575 ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3576 ok( !ret, "got %d\n", ret );
3577 ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
3578
3579 ret = pSetProcessDpiAwarenessInternal( DPI_AWARENESS_INVALID );
3580 ok( !ret, "got %d\n", ret );
3581 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3582 ret = pSetProcessDpiAwarenessInternal( DPI_AWARENESS_UNAWARE );
3583 ok( !ret, "got %d\n", ret );
3584 ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
3585 ret = pGetProcessDpiAwarenessInternal( 0, &awareness );
3586 ok( ret, "got %d\n", ret );
3587 todo_wine
3588 ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness );
3589 ret = pGetProcessDpiAwarenessInternal( GetCurrentProcess(), &awareness );
3590 ok( ret, "got %d\n", ret );
3591 todo_wine
3592 ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness );
3593 ret = pGetProcessDpiAwarenessInternal( (HANDLE)0xdeadbeef, &awareness );
3594 ok( ret, "got %d\n", ret );
3595 ok( awareness == DPI_AWARENESS_UNAWARE, "wrong value %d\n", awareness );
3596
3597 ret = pIsProcessDPIAware();
3598 ok(ret, "got %d\n", ret);
3599 context = pGetThreadDpiAwarenessContext();
3600 todo_wine
3601 ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3602 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3603 todo_wine
3604 ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness );
3605 SetLastError( 0xdeadbeef );
3606 context = pSetThreadDpiAwarenessContext( 0 );
3607 ok( !context, "got %p\n", context );
3608 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3609 SetLastError( 0xdeadbeef );
3610 context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)-6 );
3611 ok( !context, "got %p\n", context );
3612 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3613 context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3614 todo_wine
3615 ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
3616 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3617 todo_wine
3618 ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness );
3619 dpi = pGetDpiForSystem();
3620 ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3622 ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3623 ok( !pIsProcessDPIAware(), "still aware\n" );
3624 context = pGetThreadDpiAwarenessContext();
3625 ok( context == (DPI_AWARENESS_CONTEXT)(0x10 | flags), "wrong context %p\n", context );
3626 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3627 ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness );
3628 context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3629 ok( context == (DPI_AWARENESS_CONTEXT)(0x10 | flags), "wrong context %p\n", context );
3630 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3631 ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness );
3632 dpi = pGetDpiForSystem();
3633 ok( dpi == real_dpi, "wrong dpi %u/%u\n", dpi, real_dpi );
3635 ok( dpi == real_dpi, "wrong dpi %u\n", dpi );
3636 context = pGetThreadDpiAwarenessContext();
3637 ok( context == (DPI_AWARENESS_CONTEXT)0x12, "wrong context %p\n", context );
3638 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3639 ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness );
3640 context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
3641 ok( context == (DPI_AWARENESS_CONTEXT)0x12, "wrong context %p\n", context );
3642 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3643 ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness );
3644 dpi = pGetDpiForSystem();
3645 ok( dpi == real_dpi, "wrong dpi %u/%u\n", dpi, real_dpi );
3647 ok( dpi == real_dpi, "wrong dpi %u\n", dpi );
3648 ok( pIsProcessDPIAware(), "not aware\n" );
3649 context = pGetThreadDpiAwarenessContext();
3650 ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3651 context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000010 | flags) );
3652 ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3653 context = pGetThreadDpiAwarenessContext();
3654 todo_wine
3655 ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3656 context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000011 | flags) );
3657 todo_wine
3658 ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
3659 context = pGetThreadDpiAwarenessContext();
3660 todo_wine
3661 ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3662 context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x12 );
3663 todo_wine
3664 ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
3665 context = pSetThreadDpiAwarenessContext( context );
3666 ok( context == (DPI_AWARENESS_CONTEXT)(0x12), "wrong context %p\n", context );
3667 context = pGetThreadDpiAwarenessContext();
3668 todo_wine
3669 ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3670 for (i = 0; i < 0x100; i++)
3671 {
3672 awareness = pGetAwarenessFromDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)i );
3673 switch (i)
3674 {
3675 case 0x10:
3676 case 0x11:
3677 case 0x12:
3678 ok( awareness == (i & ~0x10), "%lx: wrong value %u\n", i, awareness );
3679 ok( pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)i ), "%lx: not valid\n", i );
3680 break;
3681 default:
3682 ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", i, awareness );
3683 ok( !pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)i ), "%lx: valid\n", i );
3684 break;
3685 }
3686 awareness = pGetAwarenessFromDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(i | 0x80000000) );
3687 switch (i)
3688 {
3689 case 0x10:
3690 case 0x11:
3691 case 0x12:
3692 ok( awareness == (i & ~0x10), "%lx: wrong value %u\n", i | 0x80000000, awareness );
3693 ok( pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(i | 0x80000000) ),
3694 "%lx: not valid\n", i | 0x80000000 );
3695 break;
3696 default:
3697 ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", i | 0x80000000, awareness );
3698 ok( !pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(i | 0x80000000) ),
3699 "%lx: valid\n", i | 0x80000000 );
3700 break;
3701 }
3702 awareness = pGetAwarenessFromDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3703 switch (~i)
3704 {
3708 ok( awareness == i, "%lx: wrong value %u\n", ~i, awareness );
3709 ok( pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i ), "%lx: not valid\n", ~i );
3710 break;
3712 if (pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i ))
3713 ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "%lx: wrong value %u\n", ~i, awareness );
3714 else
3715 ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", ~i, awareness );
3716 break;
3718 if (pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i ))
3719 ok( awareness == DPI_AWARENESS_UNAWARE, "%lx: wrong value %u\n", ~i, awareness );
3720 else
3721 ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", ~i, awareness );
3722 break;
3723 default:
3724 ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", ~i, awareness );
3725 ok( !pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i ), "%lx: valid\n", ~i );
3726 break;
3727 }
3728 }
3730 ReleaseDC( 0, hdc );
3731}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define GetCurrentProcess()
Definition: compat.h:759
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define ULONG_PTR
Definition: config.h:101
GLbitfield flags
Definition: glext.h:7161
#define todo_wine_if(is_todo)
Definition: custom.c:86
#define todo_wine
Definition: custom.c:89
static void test_dpi_stock_objects(HDC hdc)
Definition: sysparams.c:3138
unsigned int UINT
Definition: ndis.h:50
uint32_t ULONG_PTR
Definition: typedefs.h:65
DPI_AWARENESS
Definition: windef.h:285
@ DPI_AWARENESS_PER_MONITOR_AWARE
Definition: windef.h:289
@ DPI_AWARENESS_SYSTEM_AWARE
Definition: windef.h:288
@ DPI_AWARENESS_INVALID
Definition: windef.h:286
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
Definition: windef.h:295
#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED
Definition: windef.h:296
#define LOGPIXELSX
Definition: wingdi.h:718

Referenced by START_TEST().

◆ test_dpi_mapping()

static void test_dpi_mapping ( void  )
static

Definition at line 3212 of file sysparams.c.

3213{
3214 HWND hwnd, child;
3215 HDC hdc;
3216 UINT win_dpi, units;
3217 POINT point;
3218 BOOL ret;
3219 HRGN rgn, update;
3220 RECT rect, orig, client, desktop, expect;
3221 ULONG_PTR i, j, k;
3222 WINDOWPLACEMENT wpl_orig, wpl;
3223 HMONITOR monitor;
3224 MONITORINFO mon_info;
3226
3227 if (!pLogicalToPhysicalPointForPerMonitorDPI)
3228 {
3229 win_skip( "LogicalToPhysicalPointForPerMonitorDPI not supported\n" );
3230 return;
3231 }
3232 context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3233 GetWindowRect( GetDesktopWindow(), &desktop );
3235 {
3236 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3237 /* test desktop rect */
3239 expect = desktop;
3241 ok( EqualRect( &expect, &rect ), "%lu: wrong desktop rect %s expected %s\n",
3244 ok( EqualRect( &expect, &rect ), "%lu: wrong desktop rect %s expected %s\n",
3247 ok( EqualRect( &expect, &rect ), "%lu: wrong virt desktop rect %s expected %s\n",
3249 SetRect( &rect, 0, 0, 1, 1 );
3250 monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
3251 ok( monitor != 0, "failed to get monitor\n" );
3252 mon_info.cbSize = sizeof(mon_info);
3253 ok( GetMonitorInfoW( monitor, &mon_info ), "GetMonitorInfoExW failed\n" );
3254 ok( EqualRect( &expect, &mon_info.rcMonitor ), "%lu: wrong monitor rect %s expected %s\n",
3256 hdc = CreateDCA( "display", NULL, NULL, NULL );
3258 ok( EqualRect( &expect, &rect ), "%lu: wrong caps desktop rect %s expected %s\n",
3261 ok( EqualRect( &desktop, &rect ), "%lu: wrong caps virt desktop rect %s expected %s\n",
3262 i, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&desktop) );
3263 DeleteDC( hdc );
3264 /* test message window rect */
3265 hwnd = CreateWindowA( "SysParamsTestClass", "test", WS_CHILD,
3266 10, 10, 20, 20, HWND_MESSAGE, 0, GetModuleHandleA(0), NULL );
3268 SetRect( &expect, 0, 0, 100, 100 );
3270 ok( EqualRect( &expect, &rect ), "%lu: wrong message rect %s expected %s\n",
3273 }
3275 {
3276 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3277 hwnd = CreateWindowA( "SysParamsTestClass", "test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
3278 193, 177, 295, 303, 0, 0, GetModuleHandleA(0), NULL );
3279 ok( hwnd != 0, "creating window failed err %u\n", GetLastError());
3280 child = CreateWindowA( "SysParamsTestClass", "child", WS_CHILD | WS_VISIBLE,
3281 50, 60, 70, 80, hwnd, 0, GetModuleHandleA(0), NULL );
3282 ok( child != 0, "creating child failed err %u\n", GetLastError());
3283 GetWindowRect( hwnd, &orig );
3284 SetRect( &rect, 0, 0, 0, 0 );
3285 pAdjustWindowRectExForDpi( &rect, WS_OVERLAPPEDWINDOW, FALSE, 0, pGetDpiForWindow( hwnd ));
3286 SetRect( &client, orig.left - rect.left, orig.top - rect.top,
3287 orig.right - rect.right, orig.bottom - rect.bottom );
3290 GetWindowPlacement( hwnd, &wpl_orig );
3292
3294 {
3295 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3296 /* test window rect */
3297 GetWindowRect( hwnd, &rect );
3298 expect = orig;
3300 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong window rect %s expected %s\n",
3302 /* test client rect */
3303 GetClientRect( hwnd, &rect );
3304 expect = client;
3305 OffsetRect( &expect, -expect.left, -expect.top );
3307 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong client rect %s expected %s\n",
3309 /* test window placement */
3310 GetWindowPlacement( hwnd, &wpl );
3311 point = wpl_orig.ptMinPosition;
3312 if (point.x != -1 || point.y != -1) scale_point_dpi_aware( &point, i, j );
3313 ok( wpl.ptMinPosition.x == point.x && wpl.ptMinPosition.y == point.y,
3314 "%lu/%lu: wrong placement min pos %d,%d expected %d,%d\n", i, j,
3315 wpl.ptMinPosition.x, wpl.ptMinPosition.y, point.x, point.y );
3316 point = wpl_orig.ptMaxPosition;
3317 if (point.x != -1 || point.y != -1) scale_point_dpi_aware( &point, i, j );
3318 ok( wpl.ptMaxPosition.x == point.x && wpl.ptMaxPosition.y == point.y,
3319 "%lu/%lu: wrong placement max pos %d,%d expected %d,%d\n", i, j,
3320 wpl.ptMaxPosition.x, wpl.ptMaxPosition.y, point.x, point.y );
3321 expect = wpl_orig.rcNormalPosition;
3324 "%lu/%lu: wrong placement rect %s expect %s\n", i, j,
3326 /* test DC rect */
3327 hdc = GetDC( hwnd );
3328 GetClipBox( hdc, &rect );
3329 SetRect( &expect, 0, 0, client.right - client.left, client.bottom - client.top );
3330 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong clip box %s expected %s\n",
3332 /* test DC resolution */
3334 expect = desktop;
3336 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong DC resolution %s expected %s\n",
3339 ok( EqualRect( &desktop, &rect ), "%lu/%lu: wrong desktop resolution %s expected %s\n",
3340 i, j, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&desktop) );
3341 ReleaseDC( hwnd, hdc );
3342 /* test DC win rect */
3343 hdc = GetWindowDC( hwnd );
3344 GetClipBox( hdc, &rect );
3345 SetRect( &expect, 0, 0, 295, 303 );
3346 todo_wine
3347 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong clip box win DC %s expected %s\n",
3349 ReleaseDC( hwnd, hdc );
3350 /* test window invalidation */
3351 UpdateWindow( hwnd );
3352 update = CreateRectRgn( 0, 0, 0, 0 );
3353 ret = GetUpdateRgn( hwnd, update, FALSE );
3354 ok( ret == NULLREGION, "update region not empty\n" );
3355 rgn = CreateRectRgn( 20, 20, 25, 25 );
3357 {
3358 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~k );
3359 RedrawWindow( hwnd, 0, rgn, RDW_INVALIDATE );
3360 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3361 GetUpdateRgn( hwnd, update, FALSE );
3362 GetRgnBox( update, &rect );
3363 SetRect( &expect, 20, 20, 25, 25 );
3364 ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update region %s expected %s\n",
3368 ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update rect %s expected %s\n",
3370 UpdateWindow( hwnd );
3371 }
3373 {
3374 RedrawWindow( hwnd, 0, rgn, RDW_INVALIDATE );
3375 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~k );
3376 GetUpdateRgn( hwnd, update, FALSE );
3377 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3378 GetRgnBox( update, &rect );
3379 SetRect( &expect, 20, 20, 25, 25 );
3380 ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update region %s expected %s\n",
3384 ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update rect %s expected %s\n",
3386 UpdateWindow( hwnd );
3387 }
3388 /* test desktop window invalidation */
3389 pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3390 GetClientRect( hwnd, &rect );
3391 InflateRect( &rect, -50, -50 );
3392 expect = rect;
3393 MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
3394 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3396 GetUpdateRgn( hwnd, update, TRUE );
3397 GetRgnBox( update, &rect );
3399 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong update region %s expected %s\n",
3403 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong update rect %s expected %s\n",
3405 UpdateWindow( hwnd );
3406 DeleteObject( update );
3407 /* test dialog units */
3409 point.x = LOWORD( units );
3410 point.y = HIWORD( units );
3412 ok( LOWORD(ret) == point.x && HIWORD(ret) == point.y, "%lu/%lu: wrong units %d,%d / %d,%d\n",
3413 i, j, LOWORD(ret), HIWORD(ret), point.x, point.y );
3414 /* test window points mapping */
3415 SetRect( &rect, 0, 0, 100, 100 );
3416 rect.right = rect.left + 100;
3417 rect.bottom = rect.top + 100;
3418 MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
3419 expect = client;
3421 expect.right = expect.left + 100;
3422 expect.bottom = expect.top + 100;
3423 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong MapWindowPoints rect %s expected %s\n",
3425 SetRect( &rect, 50, 60, 70, 80 );
3427 SetRect( &expect, 40, 30, 60, 80 );
3428 OffsetRect( &expect, -rect.left, -rect.top );
3429 SetRect( &rect, 40, 30, 60, 80 );
3430 MapWindowPoints( hwnd, child, (POINT *)&rect, 2 );
3431 ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong MapWindowPoints child rect %s expected %s\n",
3433 /* test logical<->physical coords mapping */
3434 win_dpi = pGetDpiForWindow( hwnd );
3435 if (i == DPI_AWARENESS_UNAWARE)
3436 ok( win_dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", win_dpi );
3437 else if (i == DPI_AWARENESS_SYSTEM_AWARE)
3438 ok( win_dpi == real_dpi, "wrong dpi %u / %u\n", win_dpi, real_dpi );
3439 point.x = 373;
3440 point.y = 377;
3441 ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3442 ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3443 ok( point.x == MulDiv( 373, real_dpi, win_dpi ) &&
3444 point.y == MulDiv( 377, real_dpi, win_dpi ),
3445 "%lu/%lu: wrong pos %d,%d dpi %u\n", i, j, point.x, point.y, win_dpi );
3446 point.x = 405;
3447 point.y = 423;
3448 ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3449 ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3450 ok( point.x == MulDiv( 405, win_dpi, real_dpi ) &&
3451 point.y == MulDiv( 423, win_dpi, real_dpi ),
3452 "%lu/%lu: wrong pos %d,%d dpi %u\n", i, j, point.x, point.y, win_dpi );
3453 /* point outside the window fails, but note that Windows (wrongly) checks against the
3454 * window rect transformed relative to the thread's awareness */
3455 GetWindowRect( hwnd, &rect );
3456 point.x = rect.left - 1;
3457 point.y = rect.top;
3458 ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3459 ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3460 point.x++;
3461 point.y--;
3462 ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3463 ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3464 point.y++;
3465 ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3466 ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3467 point.x = rect.right;
3468 point.y = rect.bottom + 1;
3469 ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3470 ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3471 point.x++;
3472 point.y--;
3473 ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3474 ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3475 point.x--;
3476 ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3477 ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3478 /* get physical window rect */
3479 pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3480 GetWindowRect( hwnd, &rect );
3481 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3482 point.x = rect.left - 1;
3483 point.y = rect.top;
3484 ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3485 ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3486 point.x++;
3487 point.y--;
3488 ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3489 ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3490 point.y++;
3491 ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3492 ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3493 point.x = rect.right;
3494 point.y = rect.bottom + 1;
3495 ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3496 ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3497 point.x++;
3498 point.y--;
3499 ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3500 ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3501 point.x--;
3502 ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3503 ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3504 }
3506 }
3507 pSetThreadDpiAwarenessContext( context );
3508}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
POINTL point
Definition: edittest.c:50
GLfloat units
Definition: glext.h:11727
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 GLint GLint j
Definition: glfuncs.h:250
static HWND child
Definition: cursoricon.c:298
static void scale_point_dpi_aware(POINT *pt, DPI_AWARENESS from, DPI_AWARENESS to)
Definition: sysparams.c:3196
static void scale_rect_dpi_aware(RECT *rect, DPI_AWARENESS from, DPI_AWARENESS to)
Definition: sysparams.c:3204
int k
Definition: mpi.c:3369
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
static FILE * client
Definition: client.c:41
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
POINT ptMaxPosition
Definition: winuser.h:3297
RECT rcNormalPosition
Definition: winuser.h:3298
POINT ptMinPosition
Definition: winuser.h:3296
RECT rcMonitor
Definition: winuser.h:3788
DWORD cbSize
Definition: winuser.h:3787
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define HIWORD(l)
Definition: typedefs.h:247
#define HORZRES
Definition: wingdi.h:716
int WINAPI GetClipBox(_In_ HDC, _Out_ LPRECT)
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define NULLREGION
Definition: wingdi.h:361
HDC WINAPI CreateDCA(_In_opt_ LPCSTR pszDriver, _In_opt_ LPCSTR pszDevice, _In_opt_ LPCSTR pszOutput, _In_opt_ const DEVMODEA *pdmInit)
#define VERTRES
Definition: wingdi.h:717
#define DESKTOPHORZRES
Definition: wingdi.h:742
#define DESKTOPVERTRES
Definition: wingdi.h:743
int WINAPI GetRgnBox(_In_ HRGN, _Out_ LPRECT)
#define HWND_MESSAGE
Definition: winuser.h:1213
#define SM_CYVIRTUALSCREEN
Definition: winuser.h:1042
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
HDC WINAPI GetWindowDC(_In_opt_ HWND)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SM_CYSCREEN
Definition: winuser.h:963
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define SW_MINIMIZE
Definition: winuser.h:779
#define GA_PARENT
Definition: winuser.h:2791
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define SM_CXVIRTUALSCREEN
Definition: winuser.h:1041
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define RDW_ALLCHILDREN
Definition: winuser.h:1224
#define RDW_FRAME
Definition: winuser.h:1215
int WINAPI GetUpdateRgn(_In_ HWND, _In_ HRGN, _In_ BOOL)
BOOL WINAPI UpdateWindow(_In_ HWND)
LONG WINAPI GetDialogBaseUnits(void)
Definition: dialog.c:2144
#define SW_RESTORE
Definition: winuser.h:782
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SM_CXSCREEN
Definition: winuser.h:962
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
#define RDW_INVALIDATE
Definition: winuser.h:1217
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by START_TEST().

◆ test_dpi_stock_objects()

static void test_dpi_stock_objects ( HDC  hdc)
static

Definition at line 3138 of file sysparams.c.

3139{
3141 HGDIOBJ obj[STOCK_LAST + 1], obj2[STOCK_LAST + 1];
3142 LOGFONTW lf, lf2;
3143 UINT i, dpi;
3144
3145 context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3147 ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3148 ok( !pIsProcessDPIAware(), "not aware\n" );
3149 for (i = 0; i <= STOCK_LAST; i++) obj[i] = GetStockObject( i );
3150
3151 pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
3153 ok( dpi == real_dpi, "wrong dpi %u\n", dpi );
3154 ok( pIsProcessDPIAware(), "not aware\n" );
3155 for (i = 0; i <= STOCK_LAST; i++) obj2[i] = GetStockObject( i );
3156
3157 for (i = 0; i <= STOCK_LAST; i++)
3158 {
3159 switch (i)
3160 {
3161 case OEM_FIXED_FONT:
3162 case SYSTEM_FIXED_FONT:
3163 ok( obj[i] != obj2[i], "%u: same object\n", i );
3164 break;
3165 case SYSTEM_FONT:
3166 case DEFAULT_GUI_FONT:
3167 ok( obj[i] != obj2[i], "%u: same object\n", i );
3168 GetObjectW( obj[i], sizeof(lf), &lf );
3169 GetObjectW( obj2[i], sizeof(lf2), &lf2 );
3171 "%u: wrong height %d / %d\n", i, lf.lfHeight, lf2.lfHeight );
3172 break;
3173 default:
3174 ok( obj[i] == obj2[i], "%u: different object\n", i );
3175 break;
3176 }
3177 }
3178
3179 pSetThreadDpiAwarenessContext( context );
3180}
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define STOCK_LAST
Definition: wingdi.h:923
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
#define SYSTEM_FIXED_FONT
Definition: wingdi.h:912
#define OEM_FIXED_FONT
Definition: wingdi.h:910
#define SYSTEM_FONT
Definition: wingdi.h:911

Referenced by test_dpi_context().

◆ test_dpi_window()

static void test_dpi_window ( void  )
static

Definition at line 3750 of file sysparams.c.

3751{
3753 DPI_AWARENESS awareness;
3754 ULONG_PTR i, j;
3755 UINT dpi;
3756 HWND hwnd, child, ret;
3757 MSG msg = { 0, WM_USER + 1, 0, 0 };
3758
3759 if (!pGetWindowDpiAwarenessContext)
3760 {
3761 win_skip( "GetWindowDpiAwarenessContext not supported\n" );
3762 return;
3763 }
3764 orig = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3766 {
3767 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3768 hwnd = CreateWindowA( "DpiTestClass", "Test",
3769 WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL );
3770 ok( hwnd != 0, "failed to create window\n" );
3771 context = pGetWindowDpiAwarenessContext( hwnd );
3772 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3773 ok( awareness == i, "%lu: wrong awareness %u\n", i, awareness );
3774 dpi = pGetDpiForWindow( hwnd );
3776 "%lu: got %u / %u\n", i, dpi, real_dpi );
3777 if (pGetDpiForMonitorInternal)
3778 {
3779 BOOL res;
3780 SetLastError( 0xdeadbeef );
3781 res = pGetDpiForMonitorInternal( MonitorFromWindow( hwnd, 0 ), 0, &dpi, NULL );
3782 ok( !res, "succeeded\n" );
3783 ok( GetLastError() == ERROR_INVALID_ADDRESS, "wrong error %u\n", GetLastError() );
3784 SetLastError( 0xdeadbeef );
3785 res = pGetDpiForMonitorInternal( MonitorFromWindow( hwnd, 0 ), 3, &dpi, &dpi );
3786 ok( !res, "succeeded\n" );
3787 ok( GetLastError() == ERROR_BAD_ARGUMENTS, "wrong error %u\n", GetLastError() );
3788 SetLastError( 0xdeadbeef );
3789 res = pGetDpiForMonitorInternal( MonitorFromWindow( hwnd, 0 ), 3, &dpi, NULL );
3790 ok( !res, "succeeded\n" );
3791 ok( GetLastError() == ERROR_BAD_ARGUMENTS, "wrong error %u\n", GetLastError() );
3792 res = pGetDpiForMonitorInternal( MonitorFromWindow( hwnd, 0 ), 0, &dpi, &dpi );
3793 ok( res, "failed err %u\n", GetLastError() );
3795 "%lu: got %u / %u\n", i, dpi, real_dpi );
3796 }
3797 msg.hwnd = hwnd;
3799 {
3800 pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3801 SendMessageA( hwnd, WM_USER, 0, 0 );
3803 CallWindowProcA( dpi_winproc, hwnd, WM_USER + 2, 0, 0 );
3804 child = CreateWindowA( "DpiTestClass", "Test",
3805 WS_CHILD, 0, 0, 100, 100, hwnd, 0, GetModuleHandleA(0), NULL );
3806 context = pGetWindowDpiAwarenessContext( child );
3807 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3808 ok( awareness == i, "%lu/%lu: wrong awareness %u\n", i, j, awareness );
3809 dpi = pGetDpiForWindow( child );
3811 "%lu/%lu: got %u / %u\n", i, j, dpi, real_dpi );
3812 ret = SetParent( child, NULL );
3813 ok( ret != 0, "SetParent failed err %u\n", GetLastError() );
3814 context = pGetWindowDpiAwarenessContext( child );
3815 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3816 ok( awareness == i, "%lu/%lu: wrong awareness %u\n", i, j, awareness );
3817 dpi = pGetDpiForWindow( child );
3819 "%lu/%lu: got %u / %u\n", i, j, dpi, real_dpi );
3821 child = CreateWindowA( "DpiTestClass", "Test",
3822 WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL );
3823 context = pGetWindowDpiAwarenessContext( child );
3824 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3825 ok( awareness == j, "%lu/%lu: wrong awareness %u\n", i, j, awareness );
3826 dpi = pGetDpiForWindow( child );
3828 "%lu/%lu: got %u / %u\n", i, j, dpi, real_dpi );
3829 ret = SetParent( child, hwnd );
3830 ok( ret != 0 || GetLastError() == ERROR_INVALID_STATE,
3831 "SetParent failed err %u\n", GetLastError() );
3832 context = pGetWindowDpiAwarenessContext( child );
3833 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3834 ok( awareness == (ret ? i : j), "%lu/%lu: wrong awareness %u\n", i, j, awareness );
3835 dpi = pGetDpiForWindow( child );
3837 "%lu/%lu: got %u / %u\n", i, j, dpi, real_dpi );
3839 }
3841 }
3842
3843 SetLastError( 0xdeadbeef );
3844 context = pGetWindowDpiAwarenessContext( (HWND)0xdeadbeef );
3845 ok( !context, "got %p\n", context );
3846 ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %u\n", GetLastError() );
3847 SetLastError( 0xdeadbeef );
3848 dpi = pGetDpiForWindow( (HWND)0xdeadbeef );
3849 ok( !dpi, "got %u\n", dpi );
3851 "wrong error %u\n", GetLastError() );
3852
3853 SetLastError( 0xdeadbeef );
3854 context = pGetWindowDpiAwarenessContext( GetDesktopWindow() );
3855 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3856 ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness );
3857 dpi = pGetDpiForWindow( GetDesktopWindow() );
3858 ok( dpi == real_dpi, "got %u / %u\n", dpi, real_dpi );
3859
3860 pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3861 SetLastError( 0xdeadbeef );
3862 context = pGetWindowDpiAwarenessContext( GetDesktopWindow() );
3863 awareness = pGetAwarenessFromDpiAwarenessContext( context );
3864 ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness );
3865 dpi = pGetDpiForWindow( GetDesktopWindow() );
3866 ok( dpi == real_dpi, "got %u / %u\n", dpi, real_dpi );
3867
3868 pSetThreadDpiAwarenessContext( orig );
3869}
#define ERROR_INVALID_ADDRESS
Definition: compat.h:106
GLuint res
Definition: glext.h:9613
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define ERROR_INVALID_STATE
Definition: winerror.h:1316
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:232
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define WM_USER
Definition: winuser.h:1898
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by START_TEST().

◆ test_EnumDisplaySettings()

static void test_EnumDisplaySettings ( void  )
static

Definition at line 3077 of file sysparams.c.

3078{
3080 DWORD val;
3081 HDC hdc;
3082 DWORD num;
3083
3084 memset(&devmode, 0, sizeof(devmode));
3086
3087 hdc = GetDC(0);
3090 "GetDeviceCaps(BITSPIXEL) returned %d, EnumDisplaySettings returned %d\n",
3092
3094 if(devmode.dmBitsPerPel <= 8) {
3095 ok(val == 256, "Screen bpp is %d, NUMCOLORS returned %d\n", devmode.dmBitsPerPel, val);
3096 } else {
3097 ok(val == -1, "Screen bpp is %d, NUMCOLORS returned %d\n", devmode.dmBitsPerPel, val);
3098 }
3099
3100 ReleaseDC(0, hdc);
3101
3102 num = 1;
3103 while (1) {
3104 SetLastError (0xdeadbeef);
3106 DWORD le = GetLastError();
3107 ok(le == ERROR_NO_MORE_FILES ||
3108 le == ERROR_MOD_NOT_FOUND /* Win8 */ ||
3109 le == 0xdeadbeef, /* XP, 2003 */
3110 "Expected ERROR_NO_MORE_FILES, ERROR_MOD_NOT_FOUND or 0xdeadbeef, got %d for %d\n", le, num);
3111 break;
3112 }
3113 num++;
3114 }
3115}
DEVMODEW devmode
#define ERROR_MOD_NOT_FOUND
Definition: compat.h:104
GLuint GLuint num
Definition: glext.h:9618
#define memset(x, y, z)
Definition: compat.h:39
DWORD dmBitsPerPel
Definition: wingdi.h:1647
BOOL WINAPI EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEA lpDevMode)
Definition: display.c:312
#define ERROR_NO_MORE_FILES
Definition: winerror.h:121
#define NUMCOLORS
Definition: wingdi.h:725
#define BITSPIXEL
Definition: wingdi.h:720
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179

Referenced by START_TEST().

◆ test_error_msg()

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

Definition at line 293 of file sysparams.c.

294{
296
297 if (rc==0)
298 {
300 {
301 skip("%s not supported on this platform\n", name);
302 }
304 {
305 skip("%s does not have privileges to run\n", name);
306 }
307 else
308 {
309 trace("%s failed for reason: %d. Indicating test failure and skipping remainder of test\n",name,last_error);
310 ok(rc!=0,"SystemParametersInfoA: rc=%d err=%d\n",rc,last_error);
311 }
312 return FALSE;
313 }
314 else
315 {
316 ok(rc!=0,"SystemParametersInfoA: rc=%d err=%d\n",rc,last_error);
317 return TRUE;
318 }
319}
#define skip(...)
Definition: atltest.h:64
#define ERROR_INVALID_SPI_VALUE
Definition: winerror.h:920

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 3871 of file sysparams.c.

3872{
3874 BOOL ret;
3875
3876 if (!pGetAutoRotationState)
3877 {
3878 win_skip("GetAutoRotationState not supported\n");
3879 return;
3880 }
3881
3882 SetLastError(0xdeadbeef);
3883 ret = pGetAutoRotationState(NULL);
3884 ok(!ret, "Expected GetAutoRotationState to fail\n");
3885 ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
3886
3887 state = 0;
3888 ret = pGetAutoRotationState(&state);
3889 ok(ret, "Expected GetAutoRotationState to succeed, error %d\n", GetLastError());
3890}
static int state
Definition: maze.c:121
enum tagAR_STATE AR_STATE

Referenced by START_TEST().

◆ test_GetSysColorBrush()

static void test_GetSysColorBrush ( void  )
static

Definition at line 3117 of file sysparams.c.

3118{
3119 HBRUSH hbr;
3120
3121 SetLastError(0xdeadbeef);
3122 hbr = GetSysColorBrush(-1);
3123 ok(hbr == NULL, "Expected NULL brush\n");
3124 ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError());
3125 /* greater than max index */
3126 hbr = GetSysColorBrush(COLOR_MENUBAR);
3127 if (hbr)
3128 {
3129 SetLastError(0xdeadbeef);
3130 hbr = GetSysColorBrush(COLOR_MENUBAR + 1);
3131 ok(hbr == NULL, "Expected NULL brush\n");
3132 ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError());
3133 }
3134 else
3135 win_skip("COLOR_MENUBAR unsupported\n");
3136}
HBRUSH WINAPI GetSysColorBrush(_In_ int)

Referenced by START_TEST().

◆ test_GetSystemMetrics()

static void test_GetSystemMetrics ( void  )
static

Definition at line 2698 of file sysparams.c.

2699{
2700 TEXTMETRICA tmMenuFont;
2701 UINT IconSpacing, IconVerticalSpacing;
2702 BOOL rc;
2703
2704 HDC hdc = CreateICA( "Display", 0, 0, 0);
2705 UINT avcwCaption;
2706 INT CaptionWidthfromreg, smicon, broken_val;
2707 MINIMIZEDMETRICS minim;
2708 NONCLIENTMETRICSA ncm;
2709 SIZE screen;
2710
2711 assert(sizeof(ncm) == 344);
2712
2713 ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
2714 rc = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2715 ok(rc, "SystemParametersInfoA failed\n");
2716
2717 ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth) - 1;
2718 rc = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2719 ok(!rc, "SystemParametersInfoA should fail\n");
2720
2721 ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth) + 1;
2722 SetLastError(0xdeadbeef);
2723 rc = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2724 ok(!rc, "SystemParametersInfoA should fail\n");
2725
2726 ncm.cbSize = sizeof(ncm); /* Vista added padding */
2727 SetLastError(0xdeadbeef);
2728 ncm.iPaddedBorderWidth = 0xcccc;
2729 rc = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2730 ok(rc || broken(!rc) /* before Vista */, "SystemParametersInfoA failed\n");
2731 if (rc) ok( ncm.iPaddedBorderWidth == 0, "wrong iPaddedBorderWidth %u\n", ncm.iPaddedBorderWidth );
2732
2733 minim.cbSize = sizeof( minim);
2734 ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
2735 SystemParametersInfoA( SPI_GETMINIMIZEDMETRICS, 0, &minim, 0);
2736 rc = SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
2737 if( !rc) {
2738 win_skip("SPI_GETNONCLIENTMETRICS is not available\n");
2739 return;
2740 }
2741
2742 ok(is_font_enumerated(ncm.lfCaptionFont.lfFaceName), "font %s should be enumerated\n", ncm.lfCaptionFont.lfFaceName);
2743 ok(is_font_enumerated(ncm.lfSmCaptionFont.lfFaceName), "font %s should be enumerated\n", ncm.lfSmCaptionFont.lfFaceName);
2744 ok(is_font_enumerated(ncm.lfMenuFont.lfFaceName), "font %s should be enumerated\n", ncm.lfMenuFont.lfFaceName);
2745 ok(is_font_enumerated(ncm.lfStatusFont.lfFaceName), "font %s should be enumerated\n", ncm.lfStatusFont.lfFaceName);
2746 ok(is_font_enumerated(ncm.lfMessageFont.lfFaceName), "font %s should be enumerated\n", ncm.lfMessageFont.lfFaceName);
2747
2748 /* CaptionWidth from the registry may have different value of iCaptionWidth
2749 * from the non client metrics (observed on WinXP) */
2750 CaptionWidthfromreg = metricfromreg(
2751 "Control Panel\\Desktop\\WindowMetrics","CaptionWidth", dpi);
2752 get_text_metr_size( hdc, &ncm.lfMenuFont, &tmMenuFont, NULL);
2753 get_text_metr_size( hdc, &ncm.lfCaptionFont, NULL, &avcwCaption);
2754 /* FIXME: use icon metric */
2755 if( !SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0, &IconVerticalSpacing, 0))
2756 IconVerticalSpacing = 0;
2757 if( !SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0, &IconSpacing, 0 ))
2758 IconSpacing = 0;
2759 /* reset error counters */
2760 gsm_error_ctr = 0;
2761
2762 /* the tests: */
2763
2764 /* SM_CXSCREEN, cannot test these two */
2765 /* SM_CYSCREEN */
2766 ok_gsm( SM_CXVSCROLL, ncm.iScrollWidth);
2767 ok_gsm( SM_CYHSCROLL, ncm.iScrollWidth);
2768 ok_gsm( SM_CYCAPTION, ncm.iCaptionHeight+1);
2769 ok_gsm( SM_CXBORDER, 1);
2770 ok_gsm( SM_CYBORDER, 1);
2771 ok_gsm( SM_CXDLGFRAME, 3);
2772 ok_gsm( SM_CYDLGFRAME, 3);
2773 ok_gsm( SM_CYVTHUMB, ncm.iScrollHeight);
2774 ok_gsm( SM_CXHTHUMB, ncm.iScrollHeight);
2775 /* These don't depend on the Shell Icon Size registry value */
2780 ok_gsm( SM_CYMENU, ncm.iMenuHeight + 1);
2785 /* SM_CYKANJIWINDOW */
2786 /* SM_MOUSEPRESENT */
2787 ok_gsm( SM_CYVSCROLL, ncm.iScrollHeight);
2788 ok_gsm( SM_CXHSCROLL, ncm.iScrollHeight);
2789 /* SM_DEBUG */
2790 /* SM_SWAPBUTTON */
2791 /* SM_RESERVED1 */
2792 /* SM_RESERVED2 */
2793 /* SM_RESERVED3 */
2794 /* SM_RESERVED4 */
2795 ok_gsm( SM_CXMIN, 3 * max( CaptionWidthfromreg >= 0 ? CaptionWidthfromreg : ncm.iCaptionWidth, 8) +
2796 GetSystemMetrics( SM_CYSIZE) + 4 + 4 * avcwCaption + 2 * GetSystemMetrics( SM_CXFRAME));
2800 ncm.iCaptionWidth, /* classic/standard windows style */
2801 GetSystemMetrics( SM_CYCAPTION) - 1 /* WinXP style */
2802 );
2803 ok_gsm( SM_CYSIZE, ncm.iCaptionHeight);
2804 ok_gsm( SM_CXFRAME, ncm.iBorderWidth + 3);
2805 ok_gsm( SM_CYFRAME, ncm.iBorderWidth + 3);
2808 /* SM_CXDOUBLECLK */
2809 /* SM_CYDOUBLECLK */
2810 if( IconSpacing) ok_gsm( SM_CXICONSPACING, IconSpacing);
2811 if( IconVerticalSpacing) ok_gsm( SM_CYICONSPACING, IconVerticalSpacing);
2812 /* SM_MENUDROPALIGNMENT */
2813 /* SM_PENWINDOWS */
2814 /* SM_DBCSENABLED */
2815 /* SM_CMOUSEBUTTONS */
2816 /* SM_SECURE */
2817 ok_gsm( SM_CXEDGE, 2);
2818 ok_gsm( SM_CYEDGE, 2);
2819 /* sign-extension for iHorzGap/iVertGap is broken on Win9x */
2822
2823 smicon = MulDiv( 16, dpi, USER_DEFAULT_SCREEN_DPI );
2824 if (!pIsProcessDPIAware || pIsProcessDPIAware())
2825 smicon = max( min( smicon, CaptionWidthfromreg - 2), 4 ) & ~1;
2826 todo_wine_if( real_dpi == dpi && smicon != (MulDiv( 16, dpi, USER_DEFAULT_SCREEN_DPI) & ~1) )
2827 {
2828 broken_val = (min( ncm.iCaptionHeight, CaptionWidthfromreg ) - 2) & ~1;
2829 broken_val = min( broken_val, 20 );
2830
2831 if (smicon == 4)
2832 {
2833 ok_gsm_2( SM_CXSMICON, smicon, 6 );
2834 ok_gsm_2( SM_CYSMICON, smicon, 6 );
2835 }
2836 else if (smicon < broken_val)
2837 {
2838 ok_gsm_2( SM_CXSMICON, smicon, broken_val );
2839 ok_gsm_2( SM_CYSMICON, smicon, broken_val );
2840 }
2841 else
2842 {
2843 ok_gsm( SM_CXSMICON, smicon );
2844 ok_gsm( SM_CYSMICON, smicon );
2845 }
2846 }
2847
2848 ok_gsm( SM_CYSMCAPTION, ncm.iSmCaptionHeight + 1);
2850 ncm.iSmCaptionWidth, /* classic/standard windows style */
2851 GetSystemMetrics( SM_CYSMCAPTION) - 1, /* WinXP style */
2852 smcxsmsize /* winXP seems to cache this value: setnonclientmetric
2853 does not change it */
2854 );
2856 ok_gsm( SM_CXMENUSIZE, ncm.iMenuWidth);
2857 ok_gsm( SM_CYMENUSIZE, ncm.iMenuHeight);
2858 /* SM_ARRANGE */
2859 ok_gsm( SM_CXMINIMIZED, minim.iWidth + 6);
2863 if (!screen.cx || !screen.cy) /* not supported on NT4 */
2864 {
2867 }
2869 screen.cx - 4 + 2 * GetSystemMetrics(SM_CXFRAME), /* Vista */
2870 screen.cx + 2 * GetSystemMetrics(SM_CXFRAME)); /* Win8 */
2872 screen.cy - 4 + 2 * GetSystemMetrics(SM_CYFRAME), /* Vista */
2873 screen.cy + 2 * GetSystemMetrics(SM_CYFRAME)); /* Win8 */
2874 /* the next two cannot really be tested as they depend on (application)
2875 * toolbars */
2876 /* SM_CXMAXIMIZED */
2877 /* SM_CYMAXIMIZED */
2878 /* SM_NETWORK */
2879 /* */
2880 /* */
2881 /* */
2882 /* SM_CLEANBOOT */
2883 /* SM_CXDRAG */
2884 /* SM_CYDRAG */
2885 /* SM_SHOWSOUNDS */
2887 ((tmMenuFont.tmHeight + tmMenuFont.tmExternalLeading+1)/2)*2-1);
2889 ((tmMenuFont.tmHeight + tmMenuFont.tmExternalLeading+1)/2)*2-1);
2890 /* SM_SLOWMACHINE */
2891 /* SM_MIDEASTENABLED */
2892 /* SM_MOUSEWHEELPRESENT */
2893 /* SM_XVIRTUALSCREEN */
2894 /* SM_YVIRTUALSCREEN */
2895 /* SM_CXVIRTUALSCREEN */
2896 /* SM_CYVIRTUALSCREEN */
2897 /* SM_CMONITORS */
2898 /* SM_SAMEDISPLAYFORMAT */
2899 /* SM_IMMENABLED */
2900 /* SM_CXFOCUSBORDER */
2901 /* SM_CYFOCUSBORDER */
2902 /* SM_TABLETPC */
2903 /* SM_MEDIACENTER */
2904 /* SM_CMETRICS */
2905 /* end of tests */
2906 if( gsm_error_ctr ) { /* if any errors where found */
2907 trace( "BorderWidth %d CaptionWidth %d CaptionHeight %d IconSpacing %d IconVerticalSpacing %d\n",
2908 ncm.iBorderWidth, ncm.iCaptionWidth, ncm.iCaptionHeight, IconSpacing, IconVerticalSpacing);
2909 trace( "MenuHeight %d MenuWidth %d ScrollHeight %d ScrollWidth %d SmCaptionHeight %d SmCaptionWidth %d\n",
2910 ncm.iMenuHeight, ncm.iMenuWidth, ncm.iScrollHeight, ncm.iScrollWidth, ncm.iSmCaptionHeight, ncm.iSmCaptionWidth);
2911 trace( "Captionfontchar width %d MenuFont %d,%d CaptionWidth from registry: %d screen %d,%d\n",
2912 avcwCaption, tmMenuFont.tmHeight, tmMenuFont.tmExternalLeading, CaptionWidthfromreg, screen.cx, screen.cy);
2913 }
2914
2915 DeleteDC(hdc);
2916}
#define broken(x)
Definition: atltest.h:178
static UINT smcxsmsize
Definition: sysparams.c:1492
#define ok_gsm_2(i, e1, e2)
Definition: sysparams.c:2655
static BOOL is_font_enumerated(const char *name)
Definition: sysparams.c:2678
static void get_text_metr_size(HDC hdc, LOGFONTA *plf, TEXTMETRICA *ptm, UINT *psz)
Definition: sysparams.c:2626
#define ok_gsm_3(i, e1, e2, e3)
Definition: sysparams.c:2663
#define ok_gsm(i, e)
Definition: sysparams.c:2648
static int get_cursor_size(int size)
Definition: sysparams.c:2690
#define min(a, b)
Definition: monoChain.cc:55
char screen[SCREENY][SCREENX]
Definition: polytest.cpp:65
LONG tmExternalLeading
Definition: wingdi.h:2365
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
HDC WINAPI CreateICA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ const DEVMODEA *)
#define SM_CXMINIMIZED
Definition: winuser.h:1023
#define SM_CYEDGE
Definition: winuser.h:1012
#define SM_CXHTHUMB
Definition: winuser.h:974
#define SM_CXEDGE
Definition: winuser.h:1011
#define SM_CYVSCROLL
Definition: winuser.h:984
#define SM_CXMENUCHECK
Definition: winuser.h:1034
#define SM_CYSIZE
Definition: winuser.h:995
#define SM_CXMINTRACK
Definition: winuser.h:1000
#define SM_CXVSCROLL
Definition: winuser.h:964
#define SM_CYVTHUMB
Definition: winuser.h:973
#define SM_CYMINIMIZED
Definition: winuser.h:1024
#define SM_CXFRAME
Definition: winuser.h:997
#define SM_CYMENU
Definition: winuser.h:979
#define SM_CYSMICON
Definition: winuser.h:1016
#define SM_CXSIZE
Definition: winuser.h:994
#define SM_CYFRAME
Definition: winuser.h:999
#define SM_CYHSCROLL
Definition: winuser.h:965
#define SM_CXFULLSCREEN
Definition: winuser.h:980
#define SM_CXMIN
Definition: winuser.h:992
#define SM_CYBORDER
Definition: winuser.h:968
#define SM_CXSMICON
Definition: winuser.h:1015
#define SM_CYMIN
Definition: winuser.h:993
#define SM_CYMENUCHECK
Definition: winuser.h:1035
#define SM_CYICON
Definition: winuser.h:976
#define SM_CXMAXTRACK
Definition: winuser.h:1025
#define SM_CXMAXIMIZED
Definition: winuser.h:1027
#define SM_CYMINSPACING
Definition: winuser.h:1014
#define SM_CXSMSIZE
Definition: winuser.h:1018
#define SM_CXBORDER
Definition: winuser.h:967
#define SM_CYMAXTRACK
Definition: winuser.h:1026
#define SM_CYFULLSCREEN
Definition: winuser.h:981
#define SM_CXDLGFRAME
Definition: winuser.h:969
#define SM_CXHSCROLL
Definition: winuser.h:985
#define SM_CXMENUSIZE
Definition: winuser.h:1020
#define SM_CYSMCAPTION
Definition: winuser.h:1017
#define SM_CYSMSIZE
Definition: winuser.h:1019
#define SM_CYDLGFRAME
Definition: winuser.h:971
#define SM_CYMENUSIZE
Definition: winuser.h:1021
#define SM_CYCURSOR
Definition: winuser.h:978
#define SM_CXICON
Definition: winuser.h:975
#define SM_CYMAXIMIZED
Definition: winuser.h:1028
#define SM_CYCAPTION
Definition: winuser.h:966
#define SM_CYMINTRACK
Definition: winuser.h:1001
#define SM_CXMINSPACING
Definition: winuser.h:1013
#define SM_CXCURSOR
Definition: winuser.h:977

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

◆ test_metrics_for_dpi()

static void test_metrics_for_dpi ( int  custom_dpi)
static

Definition at line 2931 of file sysparams.c.

2932{
2933 int i, val;
2934 NONCLIENTMETRICSW ncm1, ncm2;
2935 ICONMETRICSW im1, im2;
2936 LOGFONTW lf1, lf2;
2937 BOOL ret;
2938
2939 if (!pSystemParametersInfoForDpi)
2940 {
2941 win_skip( "custom dpi metrics not supported\n" );
2942 return;
2943 }
2944
2945 ncm1.cbSize = sizeof(ncm1);
2946 ret = SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, sizeof(ncm1), &ncm1, FALSE );
2947 ok( ret, "SystemParametersInfoW failed err %u\n", GetLastError() );
2948 ncm2.cbSize = sizeof(ncm2);
2949 ret = pSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, sizeof(ncm2), &ncm2, FALSE, custom_dpi );
2950 ok( ret, "SystemParametersInfoForDpi failed err %u\n", GetLastError() );
2951
2952 for (i = 0; i < 92; i++)
2953 {
2954 int ret1 = GetSystemMetrics( i );
2955 int ret2 = pGetSystemMetricsForDpi( i, custom_dpi );
2956 switch (i)
2957 {
2958 case SM_CXVSCROLL:
2959 case SM_CYHSCROLL:
2960 case SM_CYVTHUMB:
2961 case SM_CXHTHUMB:
2962 case SM_CXICON:
2963 case SM_CYICON:
2964 case SM_CYVSCROLL:
2965 case SM_CXHSCROLL:
2966 case SM_CYSIZE:
2967 case SM_CXICONSPACING:
2968 case SM_CYICONSPACING:
2969 case SM_CXSMSIZE:
2970 case SM_CYSMSIZE:
2971 case SM_CYMENUSIZE:
2972 ok( ret1 == MulDiv( ret2, dpi, custom_dpi ), "%u: wrong value %u vs %u\n", i, ret1, ret2 );
2973 break;
2974 case SM_CXSIZE:
2975 ok( ret1 == ncm1.iCaptionWidth && ret2 == ncm2.iCaptionWidth,
2976 "%u: wrong value %u vs %u caption %u vs %u\n",
2977 i, ret1, ret2, ncm1.iCaptionWidth, ncm2.iCaptionWidth );
2978 break;
2979 case SM_CXCURSOR:
2980 case SM_CYCURSOR:
2981 val = MulDiv( 32, custom_dpi, USER_DEFAULT_SCREEN_DPI );
2982 if (val < 48) val = 32;
2983 else if (val < 64) val = 48;
2984 else val = 64;
2985 ok( val == ret2, "%u: wrong value %u vs %u\n", i, ret1, ret2 );
2986 break;
2987 case SM_CYCAPTION:
2988 case SM_CYSMCAPTION:
2989 case SM_CYMENU:
2990 ok( ret1 - 1 == MulDiv( ret2 - 1, dpi, custom_dpi ), "%u: wrong value %u vs %u\n", i, ret1, ret2 );
2991 break;
2992 case SM_CXMENUSIZE:
2993 ok( ret1 / 8 == MulDiv( ret2, dpi, custom_dpi ) / 8, "%u: wrong value %u vs %u\n", i, ret1, ret2 );
2994 break;
2995 case SM_CXFRAME:
2996 case SM_CYFRAME:
2997 ok( ret1 == ncm1.iBorderWidth + 3 && ret2 == ncm2.iBorderWidth + 3,
2998 "%u: wrong value %u vs %u borders %u+%u vs %u+%u\n", i, ret1, ret2,
2999 ncm1.iBorderWidth, ncm1.iPaddedBorderWidth, ncm2.iBorderWidth, ncm2.iPaddedBorderWidth );
3000 break;
3001 case SM_CXSMICON:
3002 case SM_CYSMICON:
3003 ok( ret1 == (MulDiv( 16, dpi, USER_DEFAULT_SCREEN_DPI ) & ~1) &&
3004 ret2 == (MulDiv( 16, custom_dpi, USER_DEFAULT_SCREEN_DPI ) & ~1),
3005 "%u: wrong value %u vs %u\n", i, ret1, ret2 );
3006 break;
3007 case SM_CXMENUCHECK:
3008 case SM_CYMENUCHECK:
3009 ok( ret1 == ((get_tmheightW( &ncm1.lfMenuFont, 1 ) - 1) | 1) &&
3010 ret2 == ((get_tmheightW( &ncm2.lfMenuFont, 1 ) - 1) | 1),
3011 "%u: wrong value %u vs %u font %u vs %u\n", i, ret1, ret2,
3012 get_tmheightW( &ncm1.lfMenuFont, 1 ), get_tmheightW( &ncm2.lfMenuFont, 1 ));
3013 break;
3014 default:
3015 ok( ret1 == ret2, "%u: wrong value %u vs %u\n", i, ret1, ret2 );
3016 break;
3017 }
3018 }
3019 im1.cbSize = sizeof(im1);
3020 ret = SystemParametersInfoW( SPI_GETICONMETRICS, sizeof(im1), &im1, FALSE );
3021 ok( ret, "SystemParametersInfoW failed err %u\n", GetLastError() );
3022 im2.cbSize = sizeof(im2);
3023 ret = pSystemParametersInfoForDpi( SPI_GETICONMETRICS, sizeof(im2), &im2, FALSE, custom_dpi );
3024 ok( ret, "SystemParametersInfoForDpi failed err %u\n", GetLastError() );
3025 ok( im1.iHorzSpacing == MulDiv( im2.iHorzSpacing, dpi, custom_dpi ), "wrong iHorzSpacing %u vs %u\n",
3026 im1.iHorzSpacing, im2.iHorzSpacing );
3027 ok( im1.iVertSpacing == MulDiv( im2.iVertSpacing, dpi, custom_dpi ), "wrong iVertSpacing %u vs %u\n",
3028 im1.iVertSpacing, im2.iVertSpacing );
3029 ok( im1.iTitleWrap == im2.iTitleWrap, "wrong iTitleWrap %u vs %u\n",
3030 im1.iTitleWrap, im2.iTitleWrap );
3031 compare_font( &im1.lfFont, &im2.lfFont, dpi, custom_dpi, __LINE__ );
3032
3033 ret = SystemParametersInfoW( SPI_GETICONTITLELOGFONT, sizeof(lf1), &lf1, FALSE );
3034 ok( ret, "SystemParametersInfoW failed err %u\n", GetLastError() );
3035 ret = pSystemParametersInfoForDpi( SPI_GETICONTITLELOGFONT, sizeof(lf2), &lf2, FALSE, custom_dpi );
3036 ok( ret, "SystemParametersInfoForDpi failed err %u\n", GetLastError() );
3037 compare_font( &lf1, &lf2, dpi, custom_dpi, __LINE__ );
3038
3039 /* on high-dpi iPaddedBorderWidth is used in addition to iBorderWidth */
3040 ok( ncm1.iBorderWidth + ncm1.iPaddedBorderWidth == MulDiv( ncm2.iBorderWidth + ncm2.iPaddedBorderWidth, dpi, custom_dpi ),
3041 "wrong iBorderWidth %u+%u vs %u+%u\n",
3042 ncm1.iBorderWidth, ncm1.iPaddedBorderWidth, ncm2.iBorderWidth, ncm2.iPaddedBorderWidth );
3043 ok( ncm1.iScrollWidth == MulDiv( ncm2.iScrollWidth, dpi, custom_dpi ),
3044 "wrong iScrollWidth %u vs %u\n", ncm1.iScrollWidth, ncm2.iScrollWidth );
3045 ok( ncm1.iScrollHeight == MulDiv( ncm2.iScrollHeight, dpi, custom_dpi ),
3046 "wrong iScrollHeight %u vs %u\n", ncm1.iScrollHeight, ncm2.iScrollHeight );
3047 ok( ((ncm1.iCaptionWidth + 1) & ~1) == ((MulDiv( ncm2.iCaptionWidth, dpi, custom_dpi ) + 1) & ~1),
3048 "wrong iCaptionWidth %u vs %u\n", ncm1.iCaptionWidth, ncm2.iCaptionWidth );
3049 ok( ncm1.iCaptionHeight == MulDiv( ncm2.iCaptionHeight, dpi, custom_dpi ),
3050 "wrong iCaptionHeight %u vs %u\n", ncm1.iCaptionHeight, ncm2.iCaptionHeight );
3051 compare_font( &ncm1.lfCaptionFont, &ncm2.lfCaptionFont, dpi, custom_dpi, __LINE__ );
3052 ok( ncm1.iSmCaptionHeight == MulDiv( ncm2.iSmCaptionHeight, dpi, custom_dpi ),
3053 "wrong iSmCaptionHeight %u vs %u\n", ncm1.iSmCaptionHeight, ncm2.iSmCaptionHeight );
3054 compare_font( &ncm1.lfSmCaptionFont, &ncm2.lfSmCaptionFont, dpi, custom_dpi, __LINE__ );
3055 ok( ncm1.iMenuHeight == MulDiv( ncm2.iMenuHeight, dpi, custom_dpi ),
3056 "wrong iMenuHeight %u vs %u\n", ncm1.iMenuHeight, ncm2.iMenuHeight );
3057 /* iSmCaptionWidth and iMenuWidth apparently need to be multiples of 8 */
3058 ok( ncm1.iSmCaptionWidth / 8 == MulDiv( ncm2.iSmCaptionWidth, dpi, custom_dpi ) / 8,
3059 "wrong iSmCaptionWidth %u vs %u\n", ncm1.iSmCaptionWidth, ncm2.iSmCaptionWidth );
3060 ok( ncm1.iMenuWidth / 8 == MulDiv( ncm2.iMenuWidth, dpi, custom_dpi ) / 8,
3061 "wrong iMenuWidth %u vs %u\n", ncm1.iMenuWidth, ncm2.iMenuWidth );
3062 compare_font( &ncm1.lfMenuFont, &ncm2.lfMenuFont, dpi, custom_dpi, __LINE__ );
3063 compare_font( &ncm1.lfStatusFont, &ncm2.lfStatusFont, dpi, custom_dpi, __LINE__ );
3064 compare_font( &ncm1.lfMessageFont, &ncm2.lfMessageFont, dpi, custom_dpi, __LINE__ );
3065
3066 for (i = 1; i < 120; i++)
3067 {
3068 if (i == SPI_GETICONTITLELOGFONT || i == SPI_GETNONCLIENTMETRICS || i == SPI_GETICONMETRICS)
3069 continue;
3070 SetLastError( 0xdeadbeef );
3071 ret = pSystemParametersInfoForDpi( i, 0, &val, 0, custom_dpi );
3072 ok( !ret, "%u: SystemParametersInfoForDpi succeeded\n", i );
3073 ok( GetLastError() == ERROR_INVALID_PARAMETER, "%u: wrong error %u\n", i, GetLastError() );
3074 }
3075}
static int get_tmheightW(LOGFONTW *plf, int flag)
Definition: sysparams.c:1479
static void compare_font(const LOGFONTW *lf1, const LOGFONTW *lf2, int dpi, int custom_dpi, int line)
Definition: sysparams.c:2918
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1383

Referenced by START_TEST(), and test_dpi_aware().

◆ test_setborder()

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

Definition at line 757 of file sysparams.c.

758{
759 BOOL rc;
760 UINT border, regval;
761 INT frame;
762 NONCLIENTMETRICSA ncm;
763
764 ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
765 rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
766 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
767 if( usesetborder) {
769 if (!test_error_msg(rc,"SPI_SETBORDER")) return FALSE;
770 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
772 } else { /* set non client metrics */
773 ncm.iBorderWidth = curr_val;
774 rc=SystemParametersInfoA( SPI_SETNONCLIENTMETRICS, 0, &ncm, SPIF_UPDATEINIFILE|
776 if (!test_error_msg(rc,"SPI_SETNONCLIENTMETRICS")) return FALSE;
777 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
778 test_change_message( SPI_SETNONCLIENTMETRICS, 1 );
779 }
780 if( curr_val) { /* skip if 0, some windows versions return 0 others 1 */
782 if( regval != curr_val)
784 ok( regval==curr_val, "wrong value in registry %d, expected %d\n", regval, curr_val);
785 }
786 /* minimum border width is 1 */
787 if (curr_val == 0) curr_val = 1;
788 /* should be the same as the non client metrics */
789 rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
790 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
791 eq( (UINT)ncm.iBorderWidth, curr_val, "NonClientMetric.iBorderWidth", "%d");
792 /* and from SPI_GETBORDER */
794 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
795 eq( border, curr_val, "SPI_{GET,SET}BORDER", "%d");
796 /* test some SystemMetrics */
797 frame = curr_val + GetSystemMetrics( SM_CXDLGFRAME );
798 eq( frame, GetSystemMetrics( SM_CXFRAME ), "SM_CXFRAME", "%d" );
799 eq( frame, GetSystemMetrics( SM_CYFRAME ), "SM_CYFRAME", "%d" );
800 eq( frame, GetSystemMetrics( SM_CXSIZEFRAME ), "SM_CXSIZEFRAME", "%d" );
801 eq( frame, GetSystemMetrics( SM_CYSIZEFRAME ), "SM_CYSIZEFRAME", "%d" );
802 return TRUE;
803}
GLint GLint GLsizei GLsizei GLsizei GLint border
Definition: gl.h:1546
#define SPI_SETBORDER_REGKEY2
Definition: sysparams.c:72
#define SPI_SETBORDER_REGKEY
Definition: sysparams.c:71
#define SPI_SETBORDER_VALNAME
Definition: sysparams.c:73
#define SPI_SETBORDER
Definition: winuser.h:1361
#define SPI_GETBORDER
Definition: winuser.h:1360
#define SM_CXSIZEFRAME
Definition: winuser.h:996
#define SM_CYSIZEFRAME
Definition: winuser.h:998

Referenced by test_SPI_SETBORDER().

◆ test_SPI_ICONHORIZONTALSPACING()

static void test_SPI_ICONHORIZONTALSPACING ( void  )
static

Definition at line 934 of file sysparams.c.

935{
936 BOOL rc;
937 INT old_spacing;
938
939 trace("testing SPI_ICONHORIZONTALSPACING\n");
940 SetLastError(0xdeadbeef);
941 /* default value: 75 */
942 rc=SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0, &old_spacing, 0 );
943 if (!test_error_msg(rc,"SPI_ICONHORIZONTALSPACING"))
944 return;
945 /* do not increase the value as it would upset the user's icon layout */
946 if (!dotest_spi_iconhorizontalspacing( old_spacing - 1)) return;
947 dotest_spi_iconhorizontalspacing( 10); /* minimum is 32 */
948 /* restore */
950 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
951}
static BOOL dotest_spi_iconhorizontalspacing(INT curr_val)
Definition: sysparams.c:900

Referenced by SysParamsThreadFunc().

◆ test_SPI_ICONVERTICALSPACING()

static void test_SPI_ICONVERTICALSPACING ( void  )
static

Definition at line 1103 of file sysparams.c.

1104{
1105 BOOL rc;
1106 INT old_spacing;
1107
1108 trace("testing SPI_ICONVERTICALSPACING\n");
1109 SetLastError(0xdeadbeef);
1110 /* default value: 75 */
1111 rc=SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0, &old_spacing, 0 );
1112 if (!test_error_msg(rc,"SPI_ICONVERTICALSPACING"))
1113 return;
1114 /* do not increase the value as it would upset the user's icon layout */
1115 if (!dotest_spi_iconverticalspacing( old_spacing - 1)) return;
1116 /* same tests with a value less than the minimum 32 */
1118 /* restore */
1121 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1122}
static BOOL dotest_spi_iconverticalspacing(INT curr_val)
Definition: sysparams.c:1069

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETBEEP()

static void test_SPI_SETBEEP ( void  )
static

Definition at line 566 of file sysparams.c.

567{
568 BOOL rc;
569 BOOL old_b;
570 BOOL b;
571 BOOL curr_val;
572
573 trace("testing SPI_{GET,SET}BEEP\n");
574 SetLastError(0xdeadbeef);
575 rc=SystemParametersInfoA( SPI_GETBEEP, 0, &old_b, 0 );
576 if (!test_error_msg(rc,"SPI_{GET,SET}BEEP"))
577 return;
578
579 curr_val = TRUE;
581 if (!test_error_msg(rc,"SPI_SETBEEP")) return;
582 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
586 curr_val ? "Yes" : "No" );
587 rc=SystemParametersInfoA( SPI_GETBEEP, 0, &b, 0 );
588 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
589 eq( b, curr_val, "SPI_{GET,SET}BEEP", "%d" );
590 rc=SystemParametersInfoW( SPI_GETBEEP, 0, &b, 0 );
592 {
593 ok(rc, "SystemParametersInfoW: rc=%d err=%d\n", rc, GetLastError());
594 eq( b, curr_val, "SystemParametersInfoW", "%d" );
595 }
596
597 /* is a message sent for the second change? */
599 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
601
602 curr_val = FALSE;
606 ok(rc, "SystemParametersInfo: rc=%d err=%d\n", rc, GetLastError());
610 curr_val ? "Yes" : "No" );
611 rc=SystemParametersInfoA( SPI_GETBEEP, 0, &b, 0 );
612 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
613 eq( b, curr_val, "SPI_{GET,SET}BEEP", "%d" );
614 rc=SystemParametersInfoW( SPI_GETBEEP, 0, &b, 0 );
616 {
617 ok(rc, "SystemParametersInfoW: rc=%d err=%d\n", rc, GetLastError());
618 eq( b, curr_val, "SystemParametersInfoW", "%d" );
619 }
620 ok( MessageBeep( MB_OK ), "Return value of MessageBeep when sound is disabled\n" );
621
623 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
624}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
#define SPI_SETBEEP_VALNAME
Definition: sysparams.c:66
#define SPI_SETBEEP_REGKEY
Definition: sysparams.c:65
BOOL WINAPI MessageBeep(_In_ UINT uType)
#define MB_OK
Definition: winuser.h:793
#define SPI_GETBEEP
Definition: winuser.h:1356

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETBORDER()

static void test_SPI_SETBORDER ( void  )
static

Definition at line 805 of file sysparams.c.

806{
807 BOOL rc;
808 UINT old_border;
809 NONCLIENTMETRICSA ncmsave;
810 INT CaptionWidth,
811 PaddedBorderWidth;
812
813 ncmsave.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
814 rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, 0, &ncmsave, 0);
815 if( !rc) {
816 win_skip("SPI_GETNONCLIENTMETRICS is not available\n");
817 return;
818 }
819 /* CaptionWidth from the registry may have different value of iCaptionWidth
820 * from the non client metrics (observed on WinXP).
821 * Fix this so we can safely restore settings with the nonclientmetrics */
822 CaptionWidth = metricfromreg(
823 "Control Panel\\Desktop\\WindowMetrics","CaptionWidth", dpi);
824 ncmsave.iCaptionWidth = CaptionWidth;
825
826 /* These tests hang when XFree86 4.0 for Windows is running (tested on
827 * WinNT, SP2, Cygwin/XFree 4.1.0. Skip the test when XFree86 is
828 * running.
829 */
830 if (FindWindowA( NULL, "Cygwin/XFree86" ))
831 return;
832
833 trace("testing SPI_{GET,SET}BORDER\n");
834
835 SetLastError(0xdeadbeef);
836 rc=SystemParametersInfoA( SPI_GETBORDER, 0, &old_border, 0 );
837 if (!test_error_msg(rc,"SPI_{GET,SET}BORDER"))
838 return;
839 /* FIXME: include new PaddedBorderWidth parameter */
840 PaddedBorderWidth = ncmsave.iBorderWidth - old_border;
841 if( PaddedBorderWidth){
842 win_skip( "Cannot reliably restore border width yet (PaddedBorderWidth = %d)\n",
843 PaddedBorderWidth);
844 return;
845 }
846 /* This will restore sane values if the test hang previous run. */
847 if ( old_border == 7 || old_border == 20 )
848 old_border = 1;
849
850 /* win2k3 fails if you set the same border twice, or if size is 0 */
851 if (!test_setborder(2, 1, dpi)) return;
852 test_setborder(1, 1, dpi);
853 test_setborder(3, 1, dpi);
854 if (!test_setborder(1, 0, dpi)) return;
855 test_setborder(0, 0, dpi);
856 test_setborder(3, 0, dpi);
857
858 rc=SystemParametersInfoA( SPI_SETNONCLIENTMETRICS, 0, &ncmsave,
860 test_change_message( SPI_SETNONCLIENTMETRICS, 1 );
861 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
862}
static BOOL test_setborder(UINT curr_val, int usesetborder, int dpi)
Definition: sysparams.c:757
HWND WINAPI FindWindowA(_In_opt_ LPCSTR, _In_opt_ LPCSTR)

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETDOUBLECLICKTIME()

static void test_SPI_SETDOUBLECLICKTIME ( void  )
static

Definition at line 1283 of file sysparams.c.

1284{
1285 BOOL rc;
1286 UINT curr_val;
1287 UINT saved_val;
1288 UINT old_time;
1289 char buf[10];
1290
1291 trace("testing SPI_{GET,SET}DOUBLECLICKTIME\n");
1292 old_time = GetDoubleClickTime();
1293
1294 curr_val = 0;
1295 SetLastError(0xdeadbeef);
1298 if (!test_error_msg(rc,"SPI_{GET,SET}DOUBLECLICKTIME"))
1299 return;
1300
1302 sprintf( buf, "%d", curr_val );
1305 curr_val = 500; /* used value for 0 */
1306 eq( GetDoubleClickTime(), curr_val, "GetDoubleClickTime", "%d" );
1307
1308 curr_val = 1000;
1311 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1313 sprintf( buf, "%d", curr_val );
1316 eq( GetDoubleClickTime(), curr_val, "GetDoubleClickTime", "%d" );
1317
1318 saved_val = curr_val;
1319
1320 curr_val = 0;
1321 SetDoubleClickTime( curr_val );
1322 sprintf( buf, "%d", saved_val );
1325 curr_val = 500; /* used value for 0 */
1326 eq( GetDoubleClickTime(), curr_val, "GetDoubleClickTime", "%d" );
1327
1328 curr_val = 1000;
1329 SetDoubleClickTime( curr_val );
1330 sprintf( buf, "%d", saved_val );
1333 eq( GetDoubleClickTime(), curr_val, "GetDoubleClickTime", "%d" );
1334
1336 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1337}
#define SPI_SETDOUBLECLICKTIME_REGKEY
Definition: sysparams.c:122
#define SPI_SETDOUBLECLICKTIME_VALNAME
Definition: sysparams.c:123
BOOL WINAPI SetDoubleClickTime(_In_ UINT)
UINT WINAPI GetDoubleClickTime(void)
Definition: ntwrapper.h:314
#define SPI_SETDOUBLECLICKTIME
Definition: winuser.h:1384

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETDOUBLECLKHEIGHT()

static void test_SPI_SETDOUBLECLKHEIGHT ( void  )
static

Definition at line 1249 of file sysparams.c.

1250{
1251 BOOL rc;
1252 INT old_height;
1253 const UINT vals[]={0,10000};
1254 unsigned int i;
1255
1256 trace("testing SPI_{GET,SET}DOUBLECLKHEIGHT\n");
1257 old_height = GetSystemMetrics( SM_CYDOUBLECLK );
1258
1259 for (i=0;i<ARRAY_SIZE(vals);i++)
1260 {
1261 char buf[10];
1262
1263 SetLastError(0xdeadbeef);
1266 if (!test_error_msg(rc,"SPI_{GET,SET}DOUBLECLKHEIGHT"))
1267 return;
1268
1270 sprintf( buf, "%d", vals[i] );
1274 eq( GetSystemMetrics( SM_CYDOUBLECLK ), (int)vals[i],
1275 "SM_CYDOUBLECLK", "%d" );
1276 }
1277
1280 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1281}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define SPI_SETDOUBLECLKHEIGHT_REGKEY1
Definition: sysparams.c:119
#define SPI_SETDOUBLECLKHEIGHT_VALNAME
Definition: sysparams.c:121
#define test_reg_key_ex(subKey1, subKey2, valName, testValue)
Definition: sysparams.c:465
#define SPI_SETDOUBLECLKHEIGHT_REGKEY2
Definition: sysparams.c:120
#define SPI_SETDOUBLECLKHEIGHT
Definition: winuser.h:1382
#define SM_CYDOUBLECLK
Definition: winuser.h:1003

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETDOUBLECLKWIDTH()

static void test_SPI_SETDOUBLECLKWIDTH ( void  )
static

Definition at line 1215 of file sysparams.c.

1216{
1217 BOOL rc;
1218 INT old_width;
1219 const UINT vals[]={0,10000};
1220 unsigned int i;
1221
1222 trace("testing SPI_{GET,SET}DOUBLECLKWIDTH\n");
1223 old_width = GetSystemMetrics( SM_CXDOUBLECLK );
1224
1225 for (i=0;i<ARRAY_SIZE(vals);i++)
1226 {
1227 char buf[10];
1228
1229 SetLastError(0xdeadbeef);
1232 if (!test_error_msg(rc,"SPI_{GET,SET}DOUBLECLKWIDTH"))
1233 return;
1234
1236 sprintf( buf, "%d", vals[i] );
1240 eq( GetSystemMetrics( SM_CXDOUBLECLK ), (int)vals[i],
1241 "SM_CXDOUBLECLK", "%d" );
1242 }
1243
1246 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1247}
#define SPI_SETDOUBLECLKWIDTH_VALNAME
Definition: sysparams.c:118
#define SPI_SETDOUBLECLKWIDTH_REGKEY2
Definition: sysparams.c:117
#define SPI_SETDOUBLECLKWIDTH_REGKEY1
Definition: sysparams.c:116
#define SM_CXDOUBLECLK
Definition: winuser.h:1002
#define SPI_SETDOUBLECLKWIDTH
Definition: winuser.h:1381

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETDRAGFULLWINDOWS()

static void test_SPI_SETDRAGFULLWINDOWS ( void  )
static

Definition at line 1389 of file sysparams.c.

1390{
1391 BOOL rc;
1392 BOOL old_b;
1393 const UINT vals[]={TRUE,FALSE};
1394 unsigned int i;
1395
1396 trace("testing SPI_{GET,SET}DRAGFULLWINDOWS\n");
1397 SetLastError(0xdeadbeef);
1398 rc=SystemParametersInfoA( SPI_GETDRAGFULLWINDOWS, 0, &old_b, 0 );
1399
1400 /* SPI_{GET,SET}DRAGFULLWINDOWS is not implemented on Win95 */
1401 if (!test_error_msg(rc,"SPI_{GET,SET}DRAGFULLWINDOWS"))
1402 return;
1403
1404 for (i=0;i<ARRAY_SIZE(vals);i++)
1405 {
1406 UINT v;
1407
1408 rc=SystemParametersInfoA( SPI_SETDRAGFULLWINDOWS, vals[i], 0,
1410 if (!test_error_msg(rc,"SPI_SETDRAGFULLWINDOWS")) return;
1411 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1412 test_change_message( SPI_SETDRAGFULLWINDOWS, 0 );
1415 vals[i] ? "1" : "0" );
1416
1417 rc=SystemParametersInfoA( SPI_GETDRAGFULLWINDOWS, 0, &v, 0 );
1418 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1419 eq( v, vals[i], "SPI_{GET,SET}DRAGFULLWINDOWS", "%d" );
1420 }
1421
1422 rc=SystemParametersInfoA( SPI_SETDRAGFULLWINDOWS, old_b, 0, SPIF_UPDATEINIFILE );
1423 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1424}
const GLdouble * v
Definition: gl.h:2040
#define SPI_SETDRAGFULLWINDOWS_REGKEY
Definition: sysparams.c:147
#define SPI_SETDRAGFULLWINDOWS_VALNAME
Definition: sysparams.c:148

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETFASTTASKSWITCH()

static void test_SPI_SETFASTTASKSWITCH ( void  )
static

Definition at line 1373 of file sysparams.c.

1374{
1375 BOOL rc;
1376 BOOL v;
1377
1378 trace("testing SPI_GETFASTTASKSWITCH\n");
1379 SetLastError(0xdeadbeef);
1381 if (!test_error_msg(rc,"SPI_{GET,SET}FASTTASKSWITCH"))
1382 return;
1383
1384 /* there is not a single Windows platform on which SPI_GETFASTTASKSWITCH
1385 * works. That sure simplifies testing!
1386 */
1387}
#define SPI_GETFASTTASKSWITCH
Definition: winuser.h:1387

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETFONTSMOOTHING()

static void test_SPI_SETFONTSMOOTHING ( void  )
static

Definition at line 2021 of file sysparams.c.

2022{
2023 BOOL rc;
2024 BOOL old_b;
2025 DWORD old_type, old_contrast, old_orient;
2026 const UINT vals[]={0xffffffff,0,1,2};
2027 unsigned int i;
2028
2029 trace("testing SPI_{GET,SET}FONTSMOOTHING\n");
2030 SetLastError(0xdeadbeef);
2031 rc=SystemParametersInfoA( SPI_GETFONTSMOOTHING, 0, &old_b, 0 );
2032 if (!test_error_msg(rc,"SPI_{GET,SET}FONTSMOOTHING"))
2033 return;
2034 SystemParametersInfoA( SPI_GETFONTSMOOTHINGTYPE, 0, &old_type, 0 );
2035 SystemParametersInfoA( SPI_GETFONTSMOOTHINGCONTRAST, 0, &old_contrast, 0 );
2036 SystemParametersInfoA( SPI_GETFONTSMOOTHINGORIENTATION, 0, &old_orient, 0 );
2037
2038 for (i=0;i<ARRAY_SIZE(vals);i++)
2039 {
2040 UINT v;
2041
2042 rc=SystemParametersInfoA( SPI_SETFONTSMOOTHING, vals[i], 0,
2044 if (!test_error_msg(rc,"SPI_SETFONTSMOOTHING")) return;
2045 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2046 test_change_message( SPI_SETFONTSMOOTHING, 0 );
2049 vals[i] ? "2" : "0" );
2050
2051 rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGTYPE, 0, UlongToPtr(vals[i]),
2053 if (!test_error_msg(rc,"SPI_SETFONTSMOOTHINGTYPE")) return;
2054 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2055 test_change_message( SPI_SETFONTSMOOTHINGTYPE, 0 );
2058
2059 rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGCONTRAST, 0, UlongToPtr(vals[i]),
2061 if (!test_error_msg(rc,"SPI_SETFONTSMOOTHINGCONTRAST")) return;
2062 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2063 test_change_message( SPI_SETFONTSMOOTHINGCONTRAST, 0 );
2066
2067 rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGORIENTATION, 0, UlongToPtr(vals[i]),
2069 if (!test_error_msg(rc,"SPI_SETFONTSMOOTHINGORIENTATION")) return;
2070 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2071 test_change_message( SPI_SETFONTSMOOTHINGORIENTATION, 0 );
2074
2075 rc=SystemParametersInfoA( SPI_GETFONTSMOOTHING, 0, &v, 0 );
2076 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2077 eq( v, vals[i] ? 1 : 0, "SPI_GETFONTSMOOTHING", "%d" );
2078
2079 rc=SystemParametersInfoA( SPI_GETFONTSMOOTHINGTYPE, 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_GETFONTSMOOTHINGCONTRAST, 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 rc=SystemParametersInfoA( SPI_GETFONTSMOOTHINGORIENTATION, 0, &v, 0 );
2088 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2089 ok( v == vals[i], "wrong value %x/%x\n", v, vals[i] );
2090 }
2091
2092 rc=SystemParametersInfoA( SPI_SETFONTSMOOTHING, old_b, 0, SPIF_UPDATEINIFILE );
2093 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2094 rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGTYPE, old_type, 0, SPIF_UPDATEINIFILE );
2095 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2096 rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGCONTRAST, old_contrast, 0, SPIF_UPDATEINIFILE );
2097 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2098 rc=SystemParametersInfoA( SPI_SETFONTSMOOTHINGORIENTATION, old_orient, 0, SPIF_UPDATEINIFILE );
2099 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2100}
#define UlongToPtr(u)
Definition: config.h:106
#define SPI_SETFONTSMOOTHINGCONTRAST_VALNAME
Definition: sysparams.c:141
#define test_reg_key_dword(subKey, valName, testValue)
Definition: sysparams.c:471
#define SPI_SETFONTSMOOTHINGTYPE_VALNAME
Definition: sysparams.c:140
#define SPI_SETFONTSMOOTHING_VALNAME
Definition: sysparams.c:139
#define SPI_SETFONTSMOOTHING_REGKEY
Definition: sysparams.c:138
#define SPI_SETFONTSMOOTHINGORIENTATION_VALNAME
Definition: sysparams.c:142

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETGRIDGRANULARITY()

static void test_SPI_SETGRIDGRANULARITY ( void  )
static

Definition at line 1026 of file sysparams.c.

1027{
1028 /* ??? */;
1029}

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETICONMETRICS()

static void test_SPI_SETICONMETRICS ( void  )
static

Definition at line 1743 of file sysparams.c.

1744{
1745 BOOL rc, wrap;
1746 INT spacing;
1747 ICONMETRICSA im_orig;
1748 ICONMETRICSA im_new;
1749 ICONMETRICSA im_cur;
1750 INT regval;
1751
1752 im_orig.cbSize = sizeof(ICONMETRICSA);
1753 im_new.cbSize = sizeof(ICONMETRICSA);
1754 im_cur.cbSize = sizeof(ICONMETRICSA);
1755
1756 trace("testing SPI_{GET,SET}ICONMETRICS\n");
1757 SetLastError(0xdeadbeef);
1758 rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im_orig, FALSE );
1759 if (!test_error_msg(rc,"SPI_{GET,SET}ICONMETRICS"))
1760 return;
1761 /* check some registry values */
1763 ok( regval==im_orig.iHorzSpacing,
1764 "wrong value in registry %d, expected %d\n", regval, im_orig.iHorzSpacing);
1766 ok( regval==im_orig.iVertSpacing,
1767 "wrong value in registry %d, expected %d\n", regval, im_orig.iVertSpacing);
1769 if( regval != im_orig.iTitleWrap)
1771 ok( regval==im_orig.iTitleWrap, "wrong value in registry %d, expected %d\n", regval, im_orig.iTitleWrap);
1772
1773 /* change everything without creating something invalid ( Win9x would ignore
1774 * an invalid font for instance) */
1775 im_cur = im_orig;
1776 im_cur.iHorzSpacing += 10;
1777 im_cur.iVertSpacing += 6;
1778 im_cur.iTitleWrap = !im_cur.iTitleWrap;
1779 im_cur.lfFont.lfHeight += 1;
1780 im_cur.lfFont.lfWidth += 2;
1781 im_cur.lfFont.lfEscapement = 1;
1782 im_cur.lfFont.lfWeight = im_cur.lfFont.lfWeight > 100 ? 1 : 314;
1783 im_cur.lfFont.lfItalic = !im_cur.lfFont.lfItalic;
1784 im_cur.lfFont.lfStrikeOut = !im_cur.lfFont.lfStrikeOut;
1785 im_cur.lfFont.lfUnderline = !im_cur.lfFont.lfUnderline;
1786 im_cur.lfFont.lfCharSet = im_cur.lfFont.lfCharSet ? 0 : 1;
1787 im_cur.lfFont.lfOutPrecision = im_cur.lfFont.lfOutPrecision == OUT_DEFAULT_PRECIS ?
1789 im_cur.lfFont.lfClipPrecision ^= CLIP_LH_ANGLES;
1790 im_cur.lfFont.lfPitchAndFamily = im_cur.lfFont.lfPitchAndFamily ? 0 : 1;
1791 im_cur.lfFont.lfQuality = im_cur.lfFont.lfQuality == DEFAULT_QUALITY ?
1793 if( strcmp( im_cur.lfFont.lfFaceName, "MS Serif"))
1794 strcpy( im_cur.lfFont.lfFaceName, "MS Serif");
1795 else
1796 strcpy( im_cur.lfFont.lfFaceName, "MS Sans Serif");
1797
1798 rc=SystemParametersInfoA( SPI_SETICONMETRICS, sizeof(ICONMETRICSA), &im_cur, SPIF_UPDATEINIFILE );
1799 if (!test_error_msg(rc,"SPI_SETICONMETRICS")) return;
1800 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1801
1802 rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im_new, FALSE );
1803 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1804 /* test GET <-> SETICONMETRICS */
1805 eq( im_new.iHorzSpacing, im_cur.iHorzSpacing, "iHorzSpacing", "%d" );
1806 eq( im_new.iVertSpacing, im_cur.iVertSpacing, "iVertSpacing", "%d" );
1807 eq( im_new.iTitleWrap, im_cur.iTitleWrap, "iTitleWrap", "%d" );
1808 eq( im_new.lfFont.lfHeight, im_cur.lfFont.lfHeight, "lfHeight", "%d" );
1809 eq( im_new.lfFont.lfWidth, im_cur.lfFont.lfWidth, "lfWidth", "%d" );
1810 eq( im_new.lfFont.lfEscapement, im_cur.lfFont.lfEscapement, "lfEscapement", "%d" );
1811 eq( im_new.lfFont.lfWeight, im_cur.lfFont.lfWeight, "lfWeight", "%d" );
1812 eq( im_new.lfFont.lfItalic, im_cur.lfFont.lfItalic, "lfItalic", "%d" );
1813 eq( im_new.lfFont.lfStrikeOut, im_cur.lfFont.lfStrikeOut, "lfStrikeOut", "%d" );
1814 eq( im_new.lfFont.lfUnderline, im_cur.lfFont.lfUnderline, "lfUnderline", "%d" );
1815 eq( im_new.lfFont.lfCharSet, im_cur.lfFont.lfCharSet, "lfCharSet", "%d" );
1816 eq( im_new.lfFont.lfOutPrecision, im_cur.lfFont.lfOutPrecision, "lfOutPrecision", "%d" );
1817 eq( im_new.lfFont.lfClipPrecision, im_cur.lfFont.lfClipPrecision, "lfClipPrecision", "%d" );
1818 eq( im_new.lfFont.lfPitchAndFamily, im_cur.lfFont.lfPitchAndFamily, "lfPitchAndFamily", "%d" );
1819 eq( im_new.lfFont.lfQuality, im_cur.lfFont.lfQuality, "lfQuality", "%d" );
1820 ok( !strcmp( im_new.lfFont.lfFaceName, im_cur.lfFont.lfFaceName),
1821 "wrong facename \"%s\", should be \"%s\"\n", im_new.lfFont.lfFaceName,
1822 im_cur.lfFont.lfFaceName);
1823 /* test some system metrics */
1825 im_new.iHorzSpacing, "iHorzSpacing", "%d" );
1827 im_new.iVertSpacing, "iVertSpacing", "%d" );
1828 /* check some registry values */
1830 ok( regval==im_cur.iHorzSpacing, "wrong value in registry %d, expected %d\n", regval, im_cur.iHorzSpacing);
1832 ok( regval==im_cur.iVertSpacing, "wrong value in registry %d, expected %d\n", regval, im_cur.iVertSpacing);
1834 if( regval != im_cur.iTitleWrap)
1836 ok( regval==im_cur.iTitleWrap, "wrong value in registry %d, expected %d\n", regval, im_cur.iTitleWrap);
1837 /* test some values from other SPI_GETxxx calls */
1838 rc = SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0, &spacing, 0 );
1839 ok( rc && spacing == im_cur.iHorzSpacing,
1840 "SystemParametersInfoA( SPI_ICONHORIZONTALSPACING...) failed or returns wrong value %d instead of %d\n",
1841 spacing, im_cur.iHorzSpacing);
1842 rc = SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0, &spacing, 0 );
1843 ok( rc && spacing == im_cur.iVertSpacing,
1844 "SystemParametersInfoA( SPI_ICONVERTICALSPACING...) failed or returns wrong value %d instead of %d\n",
1845 spacing, im_cur.iVertSpacing);
1847 ok( rc && wrap == im_cur.iTitleWrap,
1848 "SystemParametersInfoA( SPI_GETICONTITLEWRAP...) failed or returns wrong value %d instead of %d\n",
1849 wrap, im_cur.iTitleWrap);
1850 /* restore old values */
1851 rc=SystemParametersInfoA( SPI_SETICONMETRICS, sizeof(ICONMETRICSA), &im_orig,SPIF_UPDATEINIFILE );
1852 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1853
1854 rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im_new, FALSE );
1855 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1856
1857 eq( im_new.iHorzSpacing, im_orig.iHorzSpacing, "iHorzSpacing", "%d" );
1858 eq( im_new.iVertSpacing, im_orig.iVertSpacing, "iVertSpacing", "%d" );
1859 eq( im_new.iTitleWrap, im_orig.iTitleWrap, "iTitleWrap", "%d" );
1860}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define wrap(journal, var)
Definition: recovery.c:207
#define SPI_SETICONTITLEWRAP_REGKEY1
Definition: sysparams.c:110
#define SPI_SETICONTITLEWRAP_VALNAME
Definition: sysparams.c:112
#define SPI_SETICONTITLEWRAP_REGKEY2
Definition: sysparams.c:111
#define DEFAULT_QUALITY
Definition: wingdi.h:436
#define DRAFT_QUALITY
Definition: wingdi.h:437
#define CLIP_LH_ANGLES
Definition: wingdi.h:430
#define OUT_DEFAULT_PRECIS
Definition: wingdi.h:415
#define OUT_TT_PRECIS
Definition: wingdi.h:419
#define SPI_GETICONTITLEWRAP
Definition: winuser.h:1377

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETICONTITLEWRAP()

static void test_SPI_SETICONTITLEWRAP ( void  )
static

Definition at line 1124 of file sysparams.c.

1125{
1126 BOOL rc;
1127 BOOL old_b;
1128 const UINT vals[]={TRUE,FALSE};
1129 unsigned int i;
1130 ICONMETRICSA im;
1131
1132 /* These tests hang when XFree86 4.0 for Windows is running (tested on
1133 * WinNT, SP2, Cygwin/XFree 4.1.0. Skip the test when XFree86 is
1134 * running.
1135 */
1136 if (FindWindowA( NULL, "Cygwin/XFree86" ))
1137 return;
1138
1139 trace("testing SPI_{GET,SET}ICONTITLEWRAP\n");
1140 SetLastError(0xdeadbeef);
1141 rc=SystemParametersInfoA( SPI_GETICONTITLEWRAP, 0, &old_b, 0 );
1142 if (!test_error_msg(rc,"SPI_{GET,SET}ICONTITLEWRAP"))
1143 return;
1144
1145 for (i=0;i<ARRAY_SIZE(vals);i++)
1146 {
1147 UINT v;
1148 UINT regval;
1149
1152 if (!test_error_msg(rc,"SPI_SETICONTITLEWRAP")) return;
1153 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1157 if( regval != vals[i])
1160 ok( regval == vals[i], "wrong value in registry %d, expected %d\n", regval, vals[i] );
1161
1163 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1164 eq( v, vals[i], "SPI_{GET,SET}ICONTITLEWRAP", "%d" );
1165 /* and test with what SPI_GETICONMETRICS returns */
1166 im.cbSize = sizeof(ICONMETRICSA);
1167 rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im, FALSE );
1168 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1169 eq( im.iTitleWrap, (BOOL)vals[i], "SPI_GETICONMETRICS", "%d" );
1170 }
1171
1173 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1174}
#define SPI_SETICONTITLEWRAP
Definition: winuser.h:1378

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETKEYBOARDDELAY()

static void test_SPI_SETKEYBOARDDELAY ( void  )
static

Definition at line 1031 of file sysparams.c.

1032{
1033 BOOL rc;
1034 UINT old_delay;
1035 const UINT vals[]={0,3};
1036 unsigned int i;
1037
1038 trace("testing SPI_{GET,SET}KEYBOARDDELAY\n");
1039 SetLastError(0xdeadbeef);
1040 rc=SystemParametersInfoA( SPI_GETKEYBOARDDELAY, 0, &old_delay, 0 );
1041 if (!test_error_msg(rc,"SPI_{GET,SET}KEYBOARDDELAY"))
1042 return;
1043
1044 for (i=0;i<ARRAY_SIZE(vals);i++)
1045 {
1046 UINT delay;
1047 char buf[10];
1048
1051 if (!test_error_msg(rc,"SPI_SETKEYBOARDDELAY")) return;
1052 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1054 sprintf( buf, "%d", vals[i] );
1057
1058 rc=SystemParametersInfoA( SPI_GETKEYBOARDDELAY, 0, &delay, 0 );
1059 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1060 eq( delay, vals[i], "SPI_{GET,SET}KEYBOARDDELAY", "%d" );
1061 }
1062
1064 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1065}
#define SPI_SETKEYBOARDDELAY_REGKEY
Definition: sysparams.c:108
#define SPI_SETKEYBOARDDELAY_VALNAME
Definition: sysparams.c:109
#define SPI_GETKEYBOARDDELAY
Definition: winuser.h:1374
#define SPI_SETKEYBOARDDELAY
Definition: winuser.h:1375

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETKEYBOARDPREF()

static void test_SPI_SETKEYBOARDPREF ( void  )
static

Definition at line 1951 of file sysparams.c.

1952{
1953 BOOL rc;
1954 BOOL old_b;
1955 const UINT vals[]={TRUE,FALSE};
1956 unsigned int i;
1957
1958 trace("testing SPI_{GET,SET}KEYBOARDPREF\n");
1959 SetLastError(0xdeadbeef);
1960 rc=SystemParametersInfoA( SPI_GETKEYBOARDPREF, 0, &old_b, 0 );
1961 if (!test_error_msg(rc,"SPI_{GET,SET}KEYBOARDPREF"))
1962 return;
1963
1964 for (i=0;i<ARRAY_SIZE(vals);i++)
1965 {
1966 BOOL v;
1967
1968 rc=SystemParametersInfoA( SPI_SETKEYBOARDPREF, vals[i], 0,
1970 if (!test_error_msg(rc,"SPI_SETKEYBOARDPREF")) return;
1971 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1972 test_change_message( SPI_SETKEYBOARDPREF, 1 );
1975 vals[i] ? "1" : "0" );
1976
1977 rc=SystemParametersInfoA( SPI_GETKEYBOARDPREF, 0, &v, 0 );
1978 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1979 eq( v, (BOOL)vals[i], "SPI_GETKEYBOARDPREF", "%d" );
1980 }
1981
1982 rc=SystemParametersInfoA( SPI_SETKEYBOARDPREF, old_b, 0, SPIF_UPDATEINIFILE );
1983 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1984}
#define test_reg_key_ex2(subKey1, subKey2, valName1, valName2, testValue)
Definition: sysparams.c:467
#define SPI_SETKEYBOARDPREF_REGKEY
Definition: sysparams.c:130
#define SPI_SETKEYBOARDPREF_VALNAME_LEGACY
Definition: sysparams.c:133
#define SPI_SETKEYBOARDPREF_VALNAME
Definition: sysparams.c:131
#define SPI_SETKEYBOARDPREF_REGKEY_LEGACY
Definition: sysparams.c:132

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETKEYBOARDSPEED()

static void test_SPI_SETKEYBOARDSPEED ( void  )
static

Definition at line 864 of file sysparams.c.

865{
866 BOOL rc;
867 UINT old_speed;
868 const UINT vals[]={0,20,31};
869 unsigned int i;
870
871 trace("testing SPI_{GET,SET}KEYBOARDSPEED\n");
872 SetLastError(0xdeadbeef);
873 rc=SystemParametersInfoA( SPI_GETKEYBOARDSPEED, 0, &old_speed, 0 );
874 if (!test_error_msg(rc,"SPI_{GET,SET}KEYBOARDSPEED"))
875 return;
876
877 for (i=0;i<ARRAY_SIZE(vals);i++)
878 {
879 UINT v;
880 char buf[10];
881
884 if (!test_error_msg(rc,"SPI_SETKEYBOARDSPEED")) return;
885 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
887 sprintf( buf, "%d", vals[i] );
889
891 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
892 eq( v, vals[i], "SPI_{GET,SET}KEYBOARDSPEED", "%d" );
893 }
894
896 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
897}
#define SPI_SETKEYBOARDSPEED_REGKEY
Definition: sysparams.c:89
#define SPI_SETKEYBOARDSPEED_VALNAME
Definition: sysparams.c:90
#define SPI_SETKEYBOARDSPEED
Definition: winuser.h:1363
#define SPI_GETKEYBOARDSPEED
Definition: winuser.h:1362

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETLOWPOWERACTIVE()

static void test_SPI_SETLOWPOWERACTIVE ( void  )
static

Definition at line 2102 of file sysparams.c.

2103{
2104 BOOL rc;
2105 BOOL old_b;
2106 const UINT vals[]={TRUE,FALSE};
2107 unsigned int i;
2108
2109 trace("testing SPI_{GET,SET}LOWPOWERACTIVE\n");
2110 SetLastError(0xdeadbeef);
2111 rc=SystemParametersInfoA( SPI_GETLOWPOWERACTIVE, 0, &old_b, 0 );
2112 if (!test_error_msg(rc,"SPI_{GET,SET}LOWPOWERACTIVE"))
2113 return;
2114
2115 for (i=0;i<ARRAY_SIZE(vals);i++)
2116 {
2117 UINT v;
2118
2119 rc=SystemParametersInfoA( SPI_SETLOWPOWERACTIVE, vals[i], 0,
2121 if (!test_error_msg(rc,"SPI_SETLOWPOWERACTIVE")) return;
2122 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2123 test_change_message( SPI_SETLOWPOWERACTIVE, 1 );
2126 vals[i] ? "1" : "0" );
2127
2128 /* SPI_SETLOWPOWERACTIVE is not persistent in win2k3 and above */
2129 v = 0xdeadbeef;
2130 rc=SystemParametersInfoA( SPI_GETLOWPOWERACTIVE, 0, &v, 0 );
2131 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2132 ok(v == vals[i] || v == 0, /* win2k3 */
2133 "SPI_GETLOWPOWERACTIVE: got %d instead of 0 or %d\n", v, vals[i]);
2134 }
2135
2136 rc=SystemParametersInfoA( SPI_SETLOWPOWERACTIVE, old_b, 0, SPIF_UPDATEINIFILE );
2137 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2138}
#define test_reg_key_optional(subKey, valName, testValue)
Definition: sysparams.c:463
#define SPI_SETLOWPOWERACTIVE_VALNAME
Definition: sysparams.c:144
#define SPI_SETLOWPOWERACTIVE_REGKEY
Definition: sysparams.c:143

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETMENUDROPALIGNMENT()

static void test_SPI_SETMENUDROPALIGNMENT ( void  )
static

Definition at line 1176 of file sysparams.c.

1177{
1178 BOOL rc;
1179 BOOL old_b;
1180 const UINT vals[]={TRUE,FALSE};
1181 unsigned int i;
1182
1183 trace("testing SPI_{GET,SET}MENUDROPALIGNMENT\n");
1184 SetLastError(0xdeadbeef);
1186 if (!test_error_msg(rc,"SPI_{GET,SET}MENUDROPALIGNMENT"))
1187 return;
1188
1189 for (i=0;i<ARRAY_SIZE(vals);i++)
1190 {
1191 UINT v;
1192
1195 if (!test_error_msg(rc,"SPI_SETMENUDROPALIGNMENT")) return;
1196 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1201 vals[i] ? "1" : "0" );
1202
1204 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1205 eq( v, vals[i], "SPI_{GET,SET}MENUDROPALIGNMENT", "%d" );
1206 eq( GetSystemMetrics( SM_MENUDROPALIGNMENT ), (int)vals[i],
1207 "SM_MENUDROPALIGNMENT", "%d" );
1208 }
1209
1212 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1213}
#define SPI_SETMENUDROPALIGNMENT_VALNAME
Definition: sysparams.c:115
#define SPI_SETMENUDROPALIGNMENT_REGKEY2
Definition: sysparams.c:114
#define SPI_SETMENUDROPALIGNMENT_REGKEY1
Definition: sysparams.c:113
#define SM_MENUDROPALIGNMENT
Definition: winuser.h:1006
#define SPI_SETMENUDROPALIGNMENT
Definition: winuser.h:1380
#define SPI_GETMENUDROPALIGNMENT
Definition: winuser.h:1379

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETMENUSHOWDELAY()

static void test_SPI_SETMENUSHOWDELAY ( void  )
static

Definition at line 2367 of file sysparams.c.

2368{
2369 BOOL rc;
2370 UINT old_delay;
2371 const UINT vals[]={0,32767};
2372 unsigned int i;
2373
2374 trace("testing SPI_{GET,SET}MENUSHOWDELAY\n");
2375 SetLastError(0xdeadbeef);
2376 rc=SystemParametersInfoA( SPI_GETMENUSHOWDELAY, 0, &old_delay, 0 );
2377
2378 /* SPI_{GET,SET}MENUSHOWDELAY not supported on Windows 95 */
2379 if (!test_error_msg(rc,"SPI_{GET,SET}MENUSHOWDELAY"))
2380 return;
2381
2382 for (i=0;i<ARRAY_SIZE(vals);i++)
2383 {
2384 UINT v;
2385 char buf[10];
2386
2387 rc=SystemParametersInfoA( SPI_SETMENUSHOWDELAY, vals[i], 0,
2389 if (!test_error_msg(rc,"SPI_SETMENUSHOWDELAY")) return;
2390 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2391 test_change_message( SPI_SETMENUSHOWDELAY, 0 );
2392 sprintf( buf, "%d", vals[i] );
2395
2396 SystemParametersInfoA( SPI_GETMENUSHOWDELAY, 0, &v, 0 );
2397 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2398 eq( v, vals[i], "SPI_{GET,SET}MENUSHOWDELAY", "%d" );
2399 }
2400
2401 rc=SystemParametersInfoA( SPI_SETMENUSHOWDELAY, old_delay, 0,
2403 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2404}
#define SPI_SETMENUSHOWDELAY_VALNAME
Definition: sysparams.c:162
#define SPI_SETMENUSHOWDELAY_REGKEY
Definition: sysparams.c:161

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETMINIMIZEDMETRICS()

static void test_SPI_SETMINIMIZEDMETRICS ( void  )
static

Definition at line 1617 of file sysparams.c.

1618{
1619 BOOL rc;
1620 INT regval;
1621 MINIMIZEDMETRICS lpMm_orig;
1622 MINIMIZEDMETRICS lpMm_new;
1623 MINIMIZEDMETRICS lpMm_cur;
1624
1625 lpMm_orig.cbSize = sizeof(MINIMIZEDMETRICS);
1626 lpMm_new.cbSize = sizeof(MINIMIZEDMETRICS);
1627 lpMm_cur.cbSize = sizeof(MINIMIZEDMETRICS);
1628
1629 trace("testing SPI_{GET,SET}MINIMIZEDMETRICS\n");
1630 SetLastError(0xdeadbeef);
1631 rc=SystemParametersInfoA( SPI_GETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS), &lpMm_orig, FALSE );
1632 if (!test_error_msg(rc,"SPI_{GET,SET}MINIMIZEDMETRICS"))
1633 return;
1634 /* Test registry. Note that it is perfectly valid for some fields to
1635 * not be set.
1636 */
1638 ok( regval == -1 || regval == lpMm_orig.iWidth, "wrong value in registry %d, expected %d\n",
1639 regval, lpMm_orig.iWidth);
1641 ok( regval == -1 || regval == lpMm_orig.iHorzGap, "wrong value in registry %d, expected %d\n",
1642 regval, lpMm_orig.iHorzGap);
1644 ok( regval == -1 || regval == lpMm_orig.iVertGap, "wrong value in registry %d, expected %d\n",
1645 regval, lpMm_orig.iVertGap);
1647 ok( regval == -1 || regval == lpMm_orig.iArrange, "wrong value in registry %d, expected %d\n",
1648 regval, lpMm_orig.iArrange);
1649 /* set some new values */
1650 lpMm_cur.iWidth = 180;
1651 lpMm_cur.iHorzGap = 1;
1652 lpMm_cur.iVertGap = 1;
1653 lpMm_cur.iArrange = 5;
1654 rc=SystemParametersInfoA( SPI_SETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS),
1655 &lpMm_cur, SPIF_UPDATEINIFILE );
1656 if (!test_error_msg(rc,"SPI_SETMINIMIZEDMETRICS")) return;
1657 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1658 /* read them back */
1659 rc=SystemParametersInfoA( SPI_GETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS), &lpMm_new, FALSE );
1660 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1661 /* and compare */
1662 eq( lpMm_new.iWidth, lpMm_cur.iWidth, "iWidth", "%d" );
1663 eq( lpMm_new.iHorzGap, lpMm_cur.iHorzGap, "iHorzGap", "%d" );
1664 eq( lpMm_new.iVertGap, lpMm_cur.iVertGap, "iVertGap", "%d" );
1665 eq( lpMm_new.iArrange, lpMm_cur.iArrange, "iArrange", "%d" );
1666 /* test registry */
1668 ok( regval == lpMm_new.iWidth, "wrong value in registry %d, expected %d\n",
1669 regval, lpMm_new.iWidth);
1671 ok( regval == lpMm_new.iHorzGap, "wrong value in registry %d, expected %d\n",
1672 regval, lpMm_new.iHorzGap);
1674 ok( regval == lpMm_new.iVertGap, "wrong value in registry %d, expected %d\n",
1675 regval, lpMm_new.iVertGap);
1677 ok( regval == lpMm_new.iArrange, "wrong value in registry %d, expected %d\n",
1678 regval, lpMm_new.iArrange);
1679 /* test some system metrics */
1681 lpMm_new.iWidth, "iWidth", "%d" );
1683 lpMm_new.iHorzGap, "iHorzGap", "%d" );
1685 lpMm_new.iVertGap, "iVertGap", "%d" );
1687 lpMm_new.iArrange, "iArrange", "%d" );
1688 /* now some really invalid settings */
1689 lpMm_cur.iWidth = -1;
1690 lpMm_cur.iHorzGap = -1;
1691 lpMm_cur.iVertGap = -1;
1692 lpMm_cur.iArrange = - 1;
1693 rc=SystemParametersInfoA( SPI_SETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS),
1694 &lpMm_cur, SPIF_UPDATEINIFILE );
1695 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1696 /* read back */
1697 rc=SystemParametersInfoA( SPI_GETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS), &lpMm_new, FALSE );
1698 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1699 /* the width and H/V gaps have minimum 0, arrange is and'd with 0xf */
1700 eq( lpMm_new.iWidth, 0, "iWidth", "%d" );
1701 eq( lpMm_new.iHorzGap, 0, "iHorzGap", "%d" );
1702 eq( lpMm_new.iVertGap, 0, "iVertGap", "%d" );
1703 eq( lpMm_new.iArrange, 0xf & lpMm_cur.iArrange, "iArrange", "%d" );
1704 /* test registry */
1705 if (0)
1706 {
1707 /* FIXME: cannot understand the results of this (11, 11, 11, 0) */
1709 ok( regval == lpMm_new.iWidth, "wrong value in registry %d, expected %d\n",
1710 regval, lpMm_new.iWidth);
1712 ok( regval == lpMm_new.iHorzGap, "wrong value in registry %d, expected %d\n",
1713 regval, lpMm_new.iHorzGap);
1715 ok( regval == lpMm_new.iVertGap, "wrong value in registry %d, expected %d\n",
1716 regval, lpMm_new.iVertGap);
1718 ok( regval == lpMm_new.iArrange, "wrong value in registry %d, expected %d\n",
1719 regval, lpMm_new.iArrange);
1720 }
1721 /* test some system metrics */
1723 lpMm_new.iWidth, "iWidth", "%d" );
1725 lpMm_new.iHorzGap, "iHorzGap", "%d" );
1727 lpMm_new.iVertGap, "iVertGap", "%d" );
1729 lpMm_new.iArrange, "iArrange", "%d" );
1730 /* restore */
1731 rc=SystemParametersInfoA( SPI_SETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS),
1732 &lpMm_orig, SPIF_UPDATEINIFILE );
1733 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1734 /* check that */
1735 rc=SystemParametersInfoA( SPI_GETMINIMIZEDMETRICS, sizeof(MINIMIZEDMETRICS), &lpMm_new, FALSE );
1736 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1737 eq( lpMm_new.iWidth, lpMm_orig.iWidth, "iWidth", "%d" );
1738 eq( lpMm_new.iHorzGap, lpMm_orig.iHorzGap, "iHorzGap", "%d" );
1739 eq( lpMm_new.iVertGap, lpMm_orig.iVertGap, "iVertGap", "%d" );
1740 eq( lpMm_new.iArrange, lpMm_orig.iArrange, "iArrange", "%d" );
1741}
#define SPI_MINWIDTH_VALNAME
Definition: sysparams.c:98
#define SPI_MINIMIZEDMETRICS_REGKEY
Definition: sysparams.c:97
#define SPI_MINVERTGAP_VALNAME
Definition: sysparams.c:100
#define SPI_MINHORZGAP_VALNAME
Definition: sysparams.c:99
#define SPI_MINARRANGE_VALNAME
Definition: sysparams.c:101
struct tagMINIMIZEDMETRICS MINIMIZEDMETRICS
#define SM_ARRANGE
Definition: winuser.h:1022

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETMOUSE()

static void test_SPI_SETMOUSE ( void  )
static

Definition at line 693 of file sysparams.c.

694{
695 BOOL rc;
696 INT old_mi[3];
697
698 /* win nt default values - 6, 10, 1 */
699 INT curr_val[3] = {6, 10, 1};
700
701 /* requested and projected mouse movements */
702 POINT req_change[] = { {6, 6}, { 7, 6}, { 8, 6}, {10, 10}, {11, 10}, {100, 100} };
703 POINT proj_change1[] = { {6, 6}, {14, 6}, {16, 6}, {20, 20}, {22, 20}, {200, 200} };
704 POINT proj_change2[] = { {6, 6}, {14, 6}, {16, 6}, {20, 20}, {44, 20}, {400, 400} };
705 POINT proj_change3[] = { {6, 6}, {14, 6}, {16, 6}, {20, 20}, {22, 20}, {200, 200} };
706 POINT proj_change4[] = { {6, 6}, { 7, 6}, { 8, 6}, {10, 10}, {11, 10}, {100, 100} };
707 POINT proj_change5[] = { {6, 6}, { 7, 6}, {16, 6}, {20, 20}, {22, 20}, {200, 200} };
708 POINT proj_change6[] = { {6, 6}, {28, 6}, {32, 6}, {40, 40}, {44, 40}, {400, 400} };
709 POINT proj_change7[] = { {6, 6}, {14, 6}, {32, 6}, {40, 40}, {44, 40}, {400, 400} };
710 POINT proj_change8[] = { {6, 6}, {28, 6}, {32, 6}, {40, 40}, {44, 40}, {400, 400} };
711
712 int nchange = ARRAY_SIZE(req_change);
713
714 trace("testing SPI_{GET,SET}MOUSE\n");
715 SetLastError(0xdeadbeef);
716 rc=SystemParametersInfoA( SPI_GETMOUSE, 0, old_mi, 0 );
717 if (!test_error_msg(rc,"SPI_{GET,SET}MOUSE"))
718 return;
719
720 if (!run_spi_setmouse_test( curr_val, req_change, proj_change1, nchange )) return;
721
722 /* acceleration change */
723 curr_val[2] = 2;
724 run_spi_setmouse_test( curr_val, req_change, proj_change2, nchange );
725
726 /* acceleration change */
727 curr_val[2] = 3;
728 run_spi_setmouse_test( curr_val, req_change, proj_change3, nchange );
729
730 /* acceleration change */
731 curr_val[2] = 0;
732 run_spi_setmouse_test( curr_val, req_change, proj_change4, nchange );
733
734 /* threshold change */
735 curr_val[2] = 1;
736 curr_val[0] = 7;
737 run_spi_setmouse_test( curr_val, req_change, proj_change5, nchange );
738
739 /* threshold change */
740 curr_val[2] = 2;
741 curr_val[0] = 6;
742 curr_val[1] = 6;
743 run_spi_setmouse_test( curr_val, req_change, proj_change6, nchange );
744
745 /* threshold change */
746 curr_val[1] = 7;
747 run_spi_setmouse_test( curr_val, req_change, proj_change7, nchange );
748
749 /* threshold change */
750 curr_val[1] = 5;
751 run_spi_setmouse_test( curr_val, req_change, proj_change8, nchange );
752
754 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
755}
static BOOL run_spi_setmouse_test(int curr_val[], POINT *req_change, POINT *proj_change, int nchange)
Definition: sysparams.c:635

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETMOUSEBUTTONSWAP()

static void test_SPI_SETMOUSEBUTTONSWAP ( void  )
static

Definition at line 1339 of file sysparams.c.

1340{
1341 BOOL rc;
1342 BOOL old_b;
1343 const UINT vals[]={TRUE,FALSE};
1344 unsigned int i;
1345
1346 trace("testing SPI_{GET,SET}MOUSEBUTTONSWAP\n");
1348
1349 for (i=0;i<ARRAY_SIZE(vals);i++)
1350 {
1351 SetLastError(0xdeadbeef);
1354 if (!test_error_msg(rc,"SPI_SETMOUSEBUTTONSWAP")) return;
1355
1359 vals[i] ? "1" : "0" );
1360 eq( GetSystemMetrics( SM_SWAPBUTTON ), (int)vals[i],
1361 "SM_SWAPBUTTON", "%d" );
1362 rc=SwapMouseButton((BOOL)vals[i^1]);
1363 eq( GetSystemMetrics( SM_SWAPBUTTON ), (int)vals[i^1],
1364 "SwapMouseButton", "%d" );
1365 ok( rc==(BOOL)vals[i], "SwapMouseButton does not return previous state (really %d)\n", rc );
1366 }
1367
1370 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1371}
#define SPI_SETMOUSEBUTTONSWAP_VALNAME
Definition: sysparams.c:125
#define SPI_SETMOUSEBUTTONSWAP_REGKEY
Definition: sysparams.c:124
BOOL WINAPI SwapMouseButton(_In_ BOOL)
#define SPI_SETMOUSEBUTTONSWAP
Definition: winuser.h:1385
#define SM_SWAPBUTTON
Definition: winuser.h:987

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETMOUSEHOVERHEIGHT()

static void test_SPI_SETMOUSEHOVERHEIGHT ( void  )
static

Definition at line 2250 of file sysparams.c.

2251{
2252 BOOL rc;
2253 UINT old_height;
2254 const UINT vals[]={0,32767};
2255 unsigned int i;
2256
2257 trace("testing SPI_{GET,SET}MOUSEHOVERHEIGHT\n");
2258 SetLastError(0xdeadbeef);
2259 rc=SystemParametersInfoA( SPI_GETMOUSEHOVERHEIGHT, 0, &old_height, 0 );
2260 if (!test_error_msg(rc,"SPI_{GET,SET}MOUSEHOVERHEIGHT"))
2261 return;
2262
2263 for (i=0;i<ARRAY_SIZE(vals);i++)
2264 {
2265 UINT v;
2266 char buf[10];
2267
2268 rc=SystemParametersInfoA( SPI_SETMOUSEHOVERHEIGHT, vals[i], 0,
2270 if (!test_error_msg(rc,"SPI_SETMOUSEHOVERHEIGHT")) return;
2271 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2272 test_change_message( SPI_SETMOUSEHOVERHEIGHT, 0 );
2273 sprintf( buf, "%d", vals[i] );
2276
2277 SystemParametersInfoA( SPI_GETMOUSEHOVERHEIGHT, 0, &v, 0 );
2278 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2279 eq( v, vals[i], "SPI_{GET,SET}MOUSEHOVERHEIGHT", "%d" );
2280 }
2281
2282 rc=SystemParametersInfoA( SPI_SETMOUSEHOVERHEIGHT, old_height, 0,
2284 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2285}
#define SPI_SETMOUSEHOVERHEIGHT_VALNAME
Definition: sysparams.c:154
#define SPI_SETMOUSEHOVERHEIGHT_REGKEY
Definition: sysparams.c:153

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETMOUSEHOVERTIME()

static void test_SPI_SETMOUSEHOVERTIME ( void  )
static

Definition at line 2287 of file sysparams.c.

2288{
2289 BOOL rc;
2290 UINT old_time;
2291
2292 /* Windows XP accepts 10 as the minimum hover time. Any value below will be
2293 * defaulted to a value of 10 automatically.
2294 */
2295 const UINT vals[]={10,32767};
2296 unsigned int i;
2297
2298 trace("testing SPI_{GET,SET}MOUSEHOVERTIME\n");
2299 SetLastError(0xdeadbeef);
2300 rc=SystemParametersInfoA( SPI_GETMOUSEHOVERTIME, 0, &old_time, 0 );
2301 if (!test_error_msg(rc,"SPI_{GET,SET}MOUSEHOVERTIME"))
2302 return;
2303
2304 for (i=0;i<ARRAY_SIZE(vals);i++)
2305 {
2306 UINT v;
2307 char buf[10];
2308
2309 rc=SystemParametersInfoA( SPI_SETMOUSEHOVERTIME, vals[i], 0,
2311 if (!test_error_msg(rc,"SPI_SETMOUSEHOVERTIME")) return;
2312 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2313 test_change_message( SPI_SETMOUSEHOVERTIME, 0 );
2314 sprintf( buf, "%d", vals[i] );
2317
2318 SystemParametersInfoA( SPI_GETMOUSEHOVERTIME, 0, &v, 0 );
2319 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2320 eq( v, vals[i], "SPI_{GET,SET}MOUSEHOVERTIME", "%d" );
2321 }
2322
2323 rc=SystemParametersInfoA( SPI_SETMOUSEHOVERTIME, old_time, 0,
2325 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2326}
#define SPI_SETMOUSEHOVERTIME_REGKEY
Definition: sysparams.c:155
#define SPI_SETMOUSEHOVERTIME_VALNAME
Definition: sysparams.c:156

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETMOUSEHOVERWIDTH()

static void test_SPI_SETMOUSEHOVERWIDTH ( void  )
static

Definition at line 2213 of file sysparams.c.

2214{
2215 BOOL rc;
2216 UINT old_width;
2217 const UINT vals[]={0,32767};
2218 unsigned int i;
2219
2220 trace("testing SPI_{GET,SET}MOUSEHOVERWIDTH\n");
2221 SetLastError(0xdeadbeef);
2222 rc=SystemParametersInfoA( SPI_GETMOUSEHOVERWIDTH, 0, &old_width, 0 );
2223 if (!test_error_msg(rc,"SPI_{GET,SET}MOUSEHOVERWIDTH"))
2224 return;
2225
2226 for (i=0;i<ARRAY_SIZE(vals);i++)
2227 {
2228 UINT v;
2229 char buf[10];
2230
2231 rc=SystemParametersInfoA( SPI_SETMOUSEHOVERWIDTH, vals[i], 0,
2233 if (!test_error_msg(rc,"SPI_SETMOUSEHOVERWIDTH")) return;
2234 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2235 test_change_message( SPI_SETMOUSEHOVERWIDTH, 0 );
2236 sprintf( buf, "%d", vals[i] );
2239
2240 SystemParametersInfoA( SPI_GETMOUSEHOVERWIDTH, 0, &v, 0 );
2241 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2242 eq( v, vals[i], "SPI_{GET,SET}MOUSEHOVERWIDTH", "%d" );
2243 }
2244
2245 rc=SystemParametersInfoA( SPI_SETMOUSEHOVERWIDTH, old_width, 0,
2247 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2248}
#define SPI_SETMOUSEHOVERWIDTH_VALNAME
Definition: sysparams.c:152
#define SPI_SETMOUSEHOVERWIDTH_REGKEY
Definition: sysparams.c:151

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETNONCLIENTMETRICS()

static void test_SPI_SETNONCLIENTMETRICS ( void  )
static

Definition at line 1494 of file sysparams.c.

1495{
1496 BOOL rc;
1497 INT expect;
1498 NONCLIENTMETRICSA Ncmorig;
1499 NONCLIENTMETRICSA Ncmnew;
1500 NONCLIENTMETRICSA Ncmcur;
1501 NONCLIENTMETRICSA Ncmstart;
1502
1503 Ncmorig.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
1504 Ncmnew.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
1505 Ncmcur.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
1506 Ncmstart.cbSize = FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
1507
1508 trace("testing SPI_{GET,SET}NONCLIENTMETRICS\n");
1509 change_counter = 0;
1510 SetLastError(0xdeadbeef);
1511 rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSA), &Ncmorig, FALSE );
1512 if (!test_error_msg(rc,"SPI_{GET,SET}NONCLIENTMETRICS"))
1513 return;
1514 Ncmstart = Ncmorig;
1515 smcxsmsize = Ncmstart.iSmCaptionWidth;
1516 /* SPI_GETNONCLIENTMETRICS returns some "cooked" values. For instance if
1517 the caption font height is higher than the CaptionHeight field,
1518 the latter is adjusted accordingly. To be able to restore these setting
1519 accurately be restore the raw values. */
1521 Ncmorig.iCaptionHeight = metricfromreg( SPI_METRIC_REGKEY, SPI_CAPTIONHEIGHT_VALNAME, dpi);
1522 Ncmorig.iSmCaptionHeight = metricfromreg( SPI_METRIC_REGKEY, SPI_SMCAPTIONHEIGHT_VALNAME, dpi);
1524 /* test registry entries */
1525 TEST_NONCLIENTMETRICS_REG( Ncmorig);
1526
1527 /* make small changes */
1528 Ncmnew = Ncmstart;
1529 Ncmnew.iBorderWidth += 1;
1530 Ncmnew.iScrollWidth += 1;
1531 Ncmnew.iScrollHeight -= 1;
1532 Ncmnew.iCaptionWidth -= 2;
1533 Ncmnew.iCaptionHeight += 2;
1534 Ncmnew.lfCaptionFont.lfHeight +=1;
1535 Ncmnew.lfCaptionFont.lfWidth +=2;
1536 Ncmnew.lfCaptionFont.lfWeight +=1;
1537 Ncmnew.iSmCaptionWidth += 1;
1538 Ncmnew.iSmCaptionHeight += 2;
1539 Ncmnew.lfSmCaptionFont.lfHeight +=3;
1540 Ncmnew.lfSmCaptionFont.lfWidth -=1;
1541 Ncmnew.lfSmCaptionFont.lfWeight +=3;
1542 Ncmnew.iMenuWidth += 1;
1543 Ncmnew.iMenuHeight += 2;
1544 Ncmnew.lfMenuFont.lfHeight +=1;
1545 Ncmnew.lfMenuFont.lfWidth +=1;
1546 Ncmnew.lfMenuFont.lfWeight +=2;
1547 Ncmnew.lfStatusFont.lfHeight -=1;
1548 Ncmnew.lfStatusFont.lfWidth -=1;
1549 Ncmnew.lfStatusFont.lfWeight +=3;
1550 Ncmnew.lfMessageFont.lfHeight -=2;
1551 Ncmnew.lfMessageFont.lfWidth -=1;
1552 Ncmnew.lfMessageFont.lfWeight +=4;
1553
1554 rc=SystemParametersInfoA( SPI_SETNONCLIENTMETRICS, 0, &Ncmnew, SPIF_UPDATEINIFILE|
1556 if (!test_error_msg(rc,"SPI_SETNONCLIENTMETRICS")) return;
1557 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1558 test_change_message( SPI_SETNONCLIENTMETRICS, 1 );
1559 /* get them back */
1560 rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSA), &Ncmcur, FALSE );
1561 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1562 /* test registry entries */
1563 TEST_NONCLIENTMETRICS_REG( Ncmcur );
1564 /* test the system metrics with these settings */
1566 /* now for something invalid: increase the {menu|caption|smcaption} fonts
1567 by a large amount will increase the {menu|caption|smcaption} height*/
1568 Ncmnew = Ncmstart;
1569 Ncmnew.lfMenuFont.lfHeight -= 8;
1570 Ncmnew.lfCaptionFont.lfHeight =-4;
1571 Ncmnew.lfSmCaptionFont.lfHeight -=10;
1572 /* also show that a few values are lo limited */
1573 Ncmnew.iCaptionWidth = 0;
1574 Ncmnew.iCaptionHeight = 0;
1575 Ncmnew.iScrollHeight = 0;
1576 Ncmnew.iScrollWidth = 0;
1577
1578 rc=SystemParametersInfoA( SPI_SETNONCLIENTMETRICS, 0, &Ncmnew, SPIF_UPDATEINIFILE|
1580 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1581 test_change_message( SPI_SETNONCLIENTMETRICS, 1 );
1582 /* raw values are in registry */
1583 TEST_NONCLIENTMETRICS_REG( Ncmnew );
1584 /* get them back */
1585 rc=SystemParametersInfoA( SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSA), &Ncmcur, FALSE );
1586 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1587 /* cooked values are returned */
1588 expect = max( Ncmnew.iMenuHeight, 2 + get_tmheight( &Ncmnew.lfMenuFont, 1));
1589 ok( Ncmcur.iMenuHeight == expect,
1590 "MenuHeight: %d expected %d\n", Ncmcur.iMenuHeight, expect);
1591 expect = max( Ncmnew.iCaptionHeight, 2 + get_tmheight(&Ncmnew.lfCaptionFont, 0));
1592 ok( Ncmcur.iCaptionHeight == expect,
1593 "CaptionHeight: %d expected %d\n", Ncmcur.iCaptionHeight, expect);
1594 expect = max( Ncmnew.iSmCaptionHeight, 2 + get_tmheight( &Ncmnew.lfSmCaptionFont, 0));
1595 ok( Ncmcur.iSmCaptionHeight == expect,
1596 "SmCaptionHeight: %d expected %d\n", Ncmcur.iSmCaptionHeight, expect);
1597
1598 /* iCaptionWidth depends on a version, could be 8, 12 (Vista, Win7), 13 */
1599 ok( (Ncmcur.iCaptionWidth >= 8 && Ncmcur.iCaptionWidth <= 13) ||
1600 Ncmcur.iCaptionWidth == Ncmstart.iCaptionWidth, /* with windows XP theme, the value never changes */
1601 "CaptionWidth: %d expected from [8, 13] or %d\n", Ncmcur.iCaptionWidth, Ncmstart.iCaptionWidth);
1602 ok( Ncmcur.iScrollWidth == 8,
1603 "ScrollWidth: %d expected 8\n", Ncmcur.iScrollWidth);
1604 ok( Ncmcur.iScrollHeight == 8,
1605 "ScrollHeight: %d expected 8\n", Ncmcur.iScrollHeight);
1606 /* test the system metrics with these settings */
1608 /* restore */
1609 rc=SystemParametersInfoA( SPI_SETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSA),
1611 test_change_message( SPI_SETNONCLIENTMETRICS, 0 );
1612 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1613 /* test the system metrics with these settings */
1615}
#define TEST_NONCLIENTMETRICS_REG(ncm)
Definition: sysparams.c:1450
static int get_tmheight(LOGFONTA *plf, int flag)
Definition: sysparams.c:1467
#define SPI_CAPTIONWIDTH_VALNAME
Definition: sysparams.c:77

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETPOWEROFFACTIVE()

static void test_SPI_SETPOWEROFFACTIVE ( void  )
static

Definition at line 2140 of file sysparams.c.

2141{
2142 BOOL rc;
2143 BOOL old_b;
2144 const UINT vals[]={TRUE,FALSE};
2145 unsigned int i;
2146
2147 trace("testing SPI_{GET,SET}POWEROFFACTIVE\n");
2148 SetLastError(0xdeadbeef);
2149 rc=SystemParametersInfoA( SPI_GETPOWEROFFACTIVE, 0, &old_b, 0 );
2150 if (!test_error_msg(rc,"SPI_{GET,SET}POWEROFFACTIVE"))
2151 return;
2152
2153 for (i=0;i<ARRAY_SIZE(vals);i++)
2154 {
2155 UINT v;
2156
2157 rc=SystemParametersInfoA( SPI_SETPOWEROFFACTIVE, vals[i], 0,
2159 if (!test_error_msg(rc,"SPI_SETPOWEROFFACTIVE")) return;
2160 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2161 test_change_message( SPI_SETPOWEROFFACTIVE, 1 );
2164 vals[i] ? "1" : "0" );
2165
2166 /* SPI_SETPOWEROFFACTIVE is not persistent in win2k3 and above */
2167 v = 0xdeadbeef;
2168 rc=SystemParametersInfoA( SPI_GETPOWEROFFACTIVE, 0, &v, 0 );
2169 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2170 ok(v == vals[i] || v == 0, /* win2k3 */
2171 "SPI_GETPOWEROFFACTIVE: got %d instead of 0 or %d\n", v, vals[i]);
2172 }
2173
2174 rc=SystemParametersInfoA( SPI_SETPOWEROFFACTIVE, old_b, 0, SPIF_UPDATEINIFILE );
2175 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2176}
#define SPI_SETPOWEROFFACTIVE_REGKEY
Definition: sysparams.c:145
#define SPI_SETPOWEROFFACTIVE_VALNAME
Definition: sysparams.c:146

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETSCREENREADER()

static void test_SPI_SETSCREENREADER ( void  )
static

Definition at line 1986 of file sysparams.c.

1987{
1988 BOOL rc;
1989 BOOL old_b;
1990 const UINT vals[]={TRUE,FALSE};
1991 unsigned int i;
1992
1993 trace("testing SPI_{GET,SET}SCREENREADER\n");
1994 SetLastError(0xdeadbeef);
1995 rc=SystemParametersInfoA( SPI_GETSCREENREADER, 0, &old_b, 0 );
1996 if (!test_error_msg(rc,"SPI_{GET,SET}SCREENREADER"))
1997 return;
1998
1999 for (i=0;i<ARRAY_SIZE(vals);i++)
2000 {
2001 BOOL v;
2002
2003 rc=SystemParametersInfoA( SPI_SETSCREENREADER, vals[i], 0,
2005 if (!test_error_msg(rc,"SPI_SETSCREENREADER")) return;
2006 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2007 test_change_message( SPI_SETSCREENREADER, 1 );
2010 vals[i] ? "1" : "0" );
2011
2012 rc=SystemParametersInfoA( SPI_GETSCREENREADER, 0, &v, 0 );
2013 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2014 eq( v, (BOOL)vals[i], "SPI_GETSCREENREADER", "%d" );
2015 }
2016
2017 rc=SystemParametersInfoA( SPI_SETSCREENREADER, old_b, 0, SPIF_UPDATEINIFILE );
2018 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2019}
#define SPI_SETSCREENREADER_REGKEY_LEGACY
Definition: sysparams.c:136
#define SPI_SETSCREENREADER_REGKEY
Definition: sysparams.c:134
#define SPI_SETSCREENREADER_VALNAME_LEGACY
Definition: sysparams.c:137
#define SPI_SETSCREENREADER_VALNAME
Definition: sysparams.c:135
#define test_reg_key_ex2_optional(subKey1, subKey2, valName1, valName2, testValue)
Definition: sysparams.c:469

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETSCREENSAVEACTIVE()

static void test_SPI_SETSCREENSAVEACTIVE ( void  )
static

Definition at line 990 of file sysparams.c.

991{
992 BOOL rc;
993 BOOL old_b;
994 const UINT vals[]={TRUE,FALSE};
995 unsigned int i;
996
997 trace("testing SPI_{GET,SET}SCREENSAVEACTIVE\n");
998 SetLastError(0xdeadbeef);
1000 if (!test_error_msg(rc,"SPI_{GET,SET}SCREENSAVEACTIVE"))
1001 return;
1002
1003 for (i=0;i<ARRAY_SIZE(vals);i++)
1004 {
1005 UINT v;
1006
1009 if (!test_error_msg(rc,"SPI_SETSCREENSAVEACTIVE")) return;
1010 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1014 vals[i] ? "1" : "0" );
1015
1017 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1018 ok(v == vals[i] || broken(! v) /* Win 7 */,
1019 "SPI_{GET,SET}SCREENSAVEACTIVE: got %d instead of %d\n", v, vals[i]);
1020 }
1021
1023 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1024}
#define SPI_SETSCREENSAVEACTIVE_VALNAME
Definition: sysparams.c:105
#define SPI_SETSCREENSAVEACTIVE_REGKEY
Definition: sysparams.c:104
#define SPI_SETSCREENSAVEACTIVE
Definition: winuser.h:1369
#define SPI_GETSCREENSAVEACTIVE
Definition: winuser.h:1368

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETSCREENSAVETIMEOUT()

static void test_SPI_SETSCREENSAVETIMEOUT ( void  )
static

Definition at line 953 of file sysparams.c.

954{
955 BOOL rc;
956 UINT old_timeout;
957 const UINT vals[]={0,32767};
958 unsigned int i;
959
960 trace("testing SPI_{GET,SET}SCREENSAVETIMEOUT\n");
961 SetLastError(0xdeadbeef);
962 rc=SystemParametersInfoA( SPI_GETSCREENSAVETIMEOUT, 0, &old_timeout, 0 );
963 if (!test_error_msg(rc,"SPI_{GET,SET}SCREENSAVETIMEOUT"))
964 return;
965
966 for (i=0;i<ARRAY_SIZE(vals);i++)
967 {
968 UINT v;
969 char buf[10];
970
973 if (!test_error_msg(rc,"SPI_SETSCREENSAVETIMEOUT")) return;
974 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
976 sprintf( buf, "%d", vals[i] );
979
981 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
982 eq( v, vals[i], "SPI_{GET,SET}SCREENSAVETIMEOUT", "%d" );
983 }
984
987 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
988}
#define SPI_SETSCREENSAVETIMEOUT_VALNAME
Definition: sysparams.c:103
#define SPI_SETSCREENSAVETIMEOUT_REGKEY
Definition: sysparams.c:102
#define SPI_SETSCREENSAVETIMEOUT
Definition: winuser.h:1367
#define SPI_GETSCREENSAVETIMEOUT
Definition: winuser.h:1366

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETSHOWSOUNDS()

static void test_SPI_SETSHOWSOUNDS ( void  )
static

Definition at line 1914 of file sysparams.c.

1915{
1916 BOOL rc;
1917 BOOL old_b;
1918 const UINT vals[]={TRUE,FALSE};
1919 unsigned int i;
1920
1921 trace("testing SPI_{GET,SET}SHOWSOUNDS\n");
1922 SetLastError(0xdeadbeef);
1923 rc=SystemParametersInfoA( SPI_GETSHOWSOUNDS, 0, &old_b, 0 );
1924 if (!test_error_msg(rc,"SPI_{GET,SET}SHOWSOUNDS"))
1925 return;
1926
1927 for (i=0;i<ARRAY_SIZE(vals);i++)
1928 {
1929 UINT v;
1930
1933 if (!test_error_msg(rc,"SPI_SETSHOWSOUNDS")) return;
1934 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1938 vals[i] ? "1" : "0" );
1939
1941 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
1942 eq( v, vals[i], "SPI_GETSHOWSOUNDS", "%d" );
1943 eq( GetSystemMetrics( SM_SHOWSOUNDS ), (int)vals[i],
1944 "SM_SHOWSOUNDS", "%d" );
1945 }
1946
1948 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1949}
#define SPI_SETSHOWSOUNDS_REGKEY
Definition: sysparams.c:128
#define SPI_SETSHOWSOUNDS_VALNAME
Definition: sysparams.c:129
#define SPI_GETSHOWSOUNDS
Definition: winuser.h:1408
#define SM_SHOWSOUNDS
Definition: winuser.h:1033
#define SPI_SETSHOWSOUNDS
Definition: winuser.h:1409

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETSNAPTODEFBUTTON()

static void test_SPI_SETSNAPTODEFBUTTON ( void  )
static

Definition at line 2178 of file sysparams.c.

2179{
2180 BOOL rc;
2181 BOOL old_b;
2182 const UINT vals[]={TRUE,FALSE};
2183 unsigned int i;
2184
2185 trace("testing SPI_{GET,SET}SNAPTODEFBUTTON\n");
2186 SetLastError(0xdeadbeef);
2187 rc=SystemParametersInfoA( SPI_GETSNAPTODEFBUTTON, 0, &old_b, 0 );
2188 if (!test_error_msg(rc,"SPI_GETSNAPTODEFBUTTON"))
2189 return;
2190
2191 for (i=0;i<ARRAY_SIZE(vals);i++)
2192 {
2193 UINT v;
2194
2195 rc=SystemParametersInfoA( SPI_SETSNAPTODEFBUTTON, vals[i], 0,
2197 if (!test_error_msg(rc,"SPI_SETSNAPTODEFBUTTON")) return;
2198 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2199 test_change_message( SPI_SETSNAPTODEFBUTTON, 0 );
2202 vals[i] ? "1" : "0" );
2203
2204 rc=SystemParametersInfoA( SPI_GETSNAPTODEFBUTTON, 0, &v, 0 );
2205 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2206 eq( v, vals[i], "SPI_GETSNAPTODEFBUTTON", "%d" );
2207 }
2208
2209 rc=SystemParametersInfoA( SPI_SETSNAPTODEFBUTTON, old_b, 0, SPIF_UPDATEINIFILE );
2210 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2211}
#define SPI_SETSNAPTODEFBUTTON_VALNAME
Definition: sysparams.c:150
#define SPI_SETSNAPTODEFBUTTON_REGKEY
Definition: sysparams.c:149

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETWALLPAPER()

static void test_SPI_SETWALLPAPER ( void  )
static

Definition at line 2444 of file sysparams.c.

2445{
2446 BOOL rc;
2447 char oldval[260];
2448 char newval[260];
2449
2450 trace("testing SPI_{GET,SET}DESKWALLPAPER\n");
2451 SetLastError(0xdeadbeef);
2452 rc=SystemParametersInfoA(SPI_GETDESKWALLPAPER, 260, oldval, 0);
2453 if (!test_error_msg(rc,"SPI_{GET,SET}DESKWALLPAPER"))
2454 return;
2455
2456 strcpy(newval, "");
2458 if (!test_error_msg(rc,"SPI_SETDESKWALLPAPER")) return;
2459 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
2461
2463 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2464
2466}
#define SPI_SETDESKWALLPAPER_REGKEY
Definition: sysparams.c:163
#define SPI_GETDESKWALLPAPER
Definition: sysparams.c:34
#define SPI_SETDESKWALLPAPER_VALNAME
Definition: sysparams.c:164
#define SPI_SETDESKWALLPAPER
Definition: winuser.h:1372

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETWHEELSCROLLCHARS()

static void test_SPI_SETWHEELSCROLLCHARS ( void  )
static

Definition at line 2406 of file sysparams.c.

2407{
2408 BOOL rc;
2409 UINT old_chars;
2410 const UINT vals[]={32767,0};
2411 unsigned int i;
2412
2413 trace("testing SPI_{GET,SET}WHEELSCROLLCHARS\n");
2414 SetLastError(0xdeadbeef);
2415 rc=SystemParametersInfoA( SPI_GETWHEELSCROLLCHARS, 0, &old_chars, 0 );
2416
2417 /* SPI_{GET,SET}WHEELSCROLLCHARS not supported on Windows 95 */
2418 if (!test_error_msg(rc,"SPI_{GET,SET}WHEELSCROLLCHARS"))
2419 return;
2420
2421 for (i=0;i<ARRAY_SIZE(vals);i++)
2422 {
2423 UINT v;
2424 char buf[10];
2425
2426 rc=SystemParametersInfoA( SPI_SETWHEELSCROLLCHARS, vals[i], 0,
2428 if (!test_error_msg(rc,"SPI_SETWHEELSCROLLCHARS")) return;
2429 test_change_message( SPI_SETWHEELSCROLLCHARS, 0 );
2430 sprintf( buf, "%d", vals[i] );
2433
2435 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2436 eq( v, vals[i], "SPI_{GET,SET}WHEELSCROLLCHARS", "%d" );
2437 }
2438
2439 rc=SystemParametersInfoA( SPI_SETWHEELSCROLLCHARS, old_chars, 0,
2441 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2442}
#define SPI_GETWHEELSCROLLCHARS
#define SPI_SETMOUSESCROLLCHARS_VALNAME
Definition: sysparams.c:158
#define SPI_SETMOUSESCROLLCHARS_REGKEY
Definition: sysparams.c:157

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETWHEELSCROLLLINES()

static void test_SPI_SETWHEELSCROLLLINES ( void  )
static

Definition at line 2328 of file sysparams.c.

2329{
2330 BOOL rc;
2331 UINT old_lines;
2332 const UINT vals[]={0,32767};
2333 unsigned int i;
2334
2335 trace("testing SPI_{GET,SET}WHEELSCROLLLINES\n");
2336 SetLastError(0xdeadbeef);
2337 rc=SystemParametersInfoA( SPI_GETWHEELSCROLLLINES, 0, &old_lines, 0 );
2338
2339 /* SPI_{GET,SET}WHEELSCROLLLINES not supported on Windows 95 */
2340 if (!test_error_msg(rc,"SPI_{GET,SET}WHEELSCROLLLINES"))
2341 return;
2342
2343 for (i=0;i<ARRAY_SIZE(vals);i++)
2344 {
2345 UINT v;
2346 char buf[10];
2347
2350 if (!test_error_msg(rc,"SPI_SETWHEELSCROLLLINES")) return;
2351 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2353 sprintf( buf, "%d", vals[i] );
2356
2357 SystemParametersInfoA( SPI_GETWHEELSCROLLLINES, 0, &v, 0 );
2358 ok(rc, "%d: rc=%d err=%d\n", i, rc, GetLastError());
2359 eq( v, vals[i], "SPI_{GET,SET}WHEELSCROLLLINES", "%d" );
2360 }
2361
2364 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
2365}
#define SPI_SETMOUSESCROLLLINES_REGKEY
Definition: sysparams.c:159
#define SPI_SETMOUSESCROLLLINES_VALNAME
Definition: sysparams.c:160
#define SPI_SETWHEELSCROLLLINES
Definition: zmouse.h:30

Referenced by SysParamsThreadFunc().

◆ test_SPI_SETWORKAREA()

static void test_SPI_SETWORKAREA ( void  )
static

Definition at line 1862 of file sysparams.c.

1863{
1864 BOOL rc;
1865 RECT old_area;
1866 RECT area;
1867 RECT curr_val;
1868
1869 trace("testing SPI_{GET,SET}WORKAREA\n");
1870 SetLastError(0xdeadbeef);
1871 rc=SystemParametersInfoA(SPI_GETWORKAREA, 0, &old_area, 0);
1872 if (!test_error_msg(rc,"SPI_{GET,SET}WORKAREA"))
1873 return;
1874
1875 /* Modify the work area only minimally as this causes the icons that
1876 * fall outside it to be moved around thus requiring the user to
1877 * reposition them manually one by one.
1878 * Changing the work area by just one pixel should make this occurrence
1879 * reasonably unlikely.
1880 */
1881 SetRect(&curr_val, old_area.left, old_area.top, old_area.right - 1, old_area.bottom - 1);
1882 rc=SystemParametersInfoA( SPI_SETWORKAREA, 0, &curr_val,
1884 if (!test_error_msg(rc,"SPI_SETWORKAREA")) return;
1885 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1886 rc=SystemParametersInfoA( SPI_GETWORKAREA, 0, &area, 0 );
1887 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1888 if( !EqualRect( &area, &curr_val)) /* no message if rect has not changed */
1889 test_change_message( SPI_SETWORKAREA, 0);
1890 eq( area.left, curr_val.left, "left", "%d" );
1891 eq( area.top, curr_val.top, "top", "%d" );
1892 /* size may be rounded */
1893 ok( area.right >= curr_val.right - 16 && area.right < curr_val.right + 16,
1894 "right: got %d instead of %d\n", area.right, curr_val.right );
1895 ok( area.bottom >= curr_val.bottom - 16 && area.bottom < curr_val.bottom + 16,
1896 "bottom: got %d instead of %d\n", area.bottom, curr_val.bottom );
1897 curr_val = area;
1898 rc=SystemParametersInfoA( SPI_SETWORKAREA, 0, &old_area,
1900 ok(rc, "***warning*** failed to restore the original value: rc=%d err=%d\n", rc, GetLastError());
1901 rc=SystemParametersInfoA( SPI_GETWORKAREA, 0, &area, 0 );
1902 ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
1903 if( !EqualRect( &area, &curr_val)) /* no message if rect has not changed */
1904 test_change_message( SPI_SETWORKAREA, 0 );
1905 eq( area.left, old_area.left, "left", "%d" );
1906 eq( area.top, old_area.top, "top", "%d" );
1907 /* size may be rounded */
1908 ok( area.right >= old_area.right - 16 && area.right < old_area.right + 16,
1909 "right: got %d instead of %d\n", area.right, old_area.right );
1910 ok( area.bottom >= old_area.bottom - 16 && area.bottom < old_area.bottom + 16,
1911 "bottom: got %d instead of %d\n", area.bottom, old_area.bottom );
1912}
static Real area(Real A[2], Real B[2], Real C[2])
Definition: polyDBG.cc:50

Referenced by SysParamsThreadFunc().

◆ test_WM_DISPLAYCHANGE()

static void test_WM_DISPLAYCHANGE ( void  )
static

Definition at line 2468 of file sysparams.c.

2469{
2470 DEVMODEA mode, startmode;
2471 int start_bpp, last_set_bpp = 0;
2472 int test_bpps[] = {8, 16, 24, 32}, i;
2473 LONG change_ret;
2474 DWORD wait_ret;
2475
2476 if (!pChangeDisplaySettingsExA)
2477 {
2478 win_skip("ChangeDisplaySettingsExA is not available\n");
2479 return;
2480 }
2481
2483
2484 memset(&startmode, 0, sizeof(startmode));
2485 startmode.dmSize = sizeof(startmode);
2487 start_bpp = startmode.dmBitsPerPel;
2488
2490
2491 for(i = 0; i < ARRAY_SIZE(test_bpps); i++) {
2492 last_bpp = -1;
2493
2494 memset(&mode, 0, sizeof(mode));
2495 mode.dmSize = sizeof(mode);
2497 mode.dmBitsPerPel = test_bpps[i];
2498 mode.dmPelsWidth = GetSystemMetrics(SM_CXSCREEN);
2499 mode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
2500
2501 change_counter = 0; /* This sends a SETTINGSCHANGE message as well in which we aren't interested */
2503 change_ret = pChangeDisplaySettingsExA(NULL, &mode, NULL, 0, NULL);
2504 /* Wait quite long for the message, screen setting changes can take some time */
2505 if(change_ret == DISP_CHANGE_SUCCESSFUL) {
2506 wait_ret = WaitForSingleObject(displaychange_sem, 10000);
2507 /* we may not get a notification if nothing changed */
2508 if (wait_ret == WAIT_TIMEOUT && !last_set_bpp && start_bpp == test_bpps[i])
2509 continue;
2510 ok(wait_ret == WAIT_OBJECT_0, "Waiting for the WM_DISPLAYCHANGE message timed out\n");
2511 }
2513
2514 if(change_ret != DISP_CHANGE_SUCCESSFUL) {
2515 skip("Setting depth %d failed(ret = %d)\n", test_bpps[i], change_ret);
2516 ok(last_bpp == -1, "WM_DISPLAYCHANGE was sent with wParam %d despite mode change failure\n", last_bpp);
2517 continue;
2518 }
2519
2520 todo_wine_if(start_bpp != test_bpps[i]) {
2521 ok(last_bpp == test_bpps[i], "Set bpp %d, but WM_DISPLAYCHANGE reported bpp %d\n", test_bpps[i], last_bpp);
2522 }
2523 last_set_bpp = test_bpps[i];
2524 }
2525
2526 if(start_bpp != last_set_bpp && last_set_bpp != 0) {
2527 memset(&mode, 0, sizeof(mode));
2528 mode.dmSize = sizeof(mode);
2530 mode.dmBitsPerPel = start_bpp;
2531 mode.dmPelsWidth = GetSystemMetrics(SM_CXSCREEN);
2532 mode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
2533
2535 change_ret = pChangeDisplaySettingsExA(NULL, &mode, NULL, 0, NULL);
2540 }
2541
2543}
#define WAIT_TIMEOUT
Definition: dderror.h:14
GLenum mode
Definition: glext.h:6217
DWORD dmBitsPerPel
Definition: wingdi.h:1595
WORD dmSize
Definition: wingdi.h:1568
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:444
#define WAIT_OBJECT_0
Definition: winbase.h:431
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190

Referenced by SysParamsThreadFunc().

◆ UINT()

static UINT ( WINAPI pGetDpiForSystem)
static

Variable Documentation

◆ BOOL

Definition at line 53 of file sysparams.c.

◆ change_counter

◆ change_iconverticalspacing_param

int change_iconverticalspacing_param
static

Definition at line 175 of file sysparams.c.

Referenced by SysParamsTestWndProc(), and test_change_message().

◆ change_last_param

int change_last_param
static

Definition at line 176 of file sysparams.c.

Referenced by START_TEST(), SysParamsTestWndProc(), and test_change_message().

◆ change_setworkarea_param

int change_setworkarea_param
static

Definition at line 175 of file sysparams.c.

Referenced by SysParamsTestWndProc(), and test_change_message().

◆ displaychange_ok

BOOL displaychange_ok = FALSE
static

Definition at line 178 of file sysparams.c.

Referenced by SysParamsTestWndProc(), and test_WM_DISPLAYCHANGE().

◆ displaychange_sem

HANDLE displaychange_sem = 0
static

Definition at line 179 of file sysparams.c.

Referenced by SysParamsTestWndProc(), and test_WM_DISPLAYCHANGE().

◆ displaychange_test_active

BOOL displaychange_test_active = FALSE
static

Definition at line 178 of file sysparams.c.

Referenced by SysParamsTestWndProc(), and test_WM_DISPLAYCHANGE().

◆ dpi

◆ DWORD

Definition at line 37 of file sysparams.c.

◆ ghTestWnd

HWND ghTestWnd
static

Definition at line 169 of file sysparams.c.

Referenced by START_TEST(), and SysParamsThreadFunc().

◆ gsm_error_ctr

int gsm_error_ctr
static

Definition at line 2646 of file sysparams.c.

Referenced by test_GetSystemMetrics().

◆ HWND

Definition at line 37 of file sysparams.c.

◆ last_bpp

int last_bpp
static

Definition at line 177 of file sysparams.c.

Referenced by SysParamsTestWndProc(), and test_WM_DISPLAYCHANGE().

◆ LPDEVMODEA

Definition at line 37 of file sysparams.c.

◆ LPVOID

Definition at line 37 of file sysparams.c.

◆ real_dpi

◆ setmouse_valuenames

const char* setmouse_valuenames[3]
static
Initial value:
= {
}
#define SPI_SETMOUSE_VALNAME3
Definition: sysparams.c:70
#define SPI_SETMOUSE_VALNAME1
Definition: sysparams.c:68
#define SPI_SETMOUSE_VALNAME2
Definition: sysparams.c:69

Definition at line 626 of file sysparams.c.

Referenced by run_spi_setmouse_test().

◆ smcxsmsize

UINT smcxsmsize = 999999999
static

Definition at line 1492 of file sysparams.c.

Referenced by test_GetSystemMetrics(), and test_SPI_SETNONCLIENTMETRICS().

◆ strict

BOOL strict
static

Definition at line 58 of file sysparams.c.

Referenced by _test_reg_key(), and START_TEST().

◆ UINT

Definition at line 45 of file sysparams.c.