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

Go to the source code of this file.

Classes

struct  LOGFONT16
 

Macros

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

Typedefs

typedef struct LOGFONT16LPLOGFONT16
 

Functions

static LONG (WINAPI *pChangeDisplaySettingsExA)(LPCSTR
 
static BOOL (WINAPI *pIsProcessDPIAware)(void)
 
static 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

◆ _WIN32_IE

#define _WIN32_IE   0x0700

Definition at line 22 of file sysparams.c.

◆ _WIN32_WINNT

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

Definition at line 21 of file sysparams.c.

◆ eq

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

Definition at line 67 of file sysparams.c.

◆ ok_gsm

#define ok_gsm (   i,
  e 
)
Value:
{\
int exp = (e);\
int act = GetSystemMetrics( (i));\
if( exp != act) gsm_error_ctr++;\
ok( !( exp != act),"GetSystemMetrics(%s): expected %d actual %d\n", #i, exp,act);\
}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define e
Definition: ke_i.h:82
static int gsm_error_ctr
Definition: sysparams.c:2652
int WINAPI GetSystemMetrics(_In_ int)
DWORD exp
Definition: msg.c:16038

Definition at line 2654 of file sysparams.c.

◆ ok_gsm_2

#define ok_gsm_2 (   i,
  e1,
  e2 
)
Value:
{\
int exp1 = (e1);\
int exp2 = (e2);\
int act = GetSystemMetrics( (i));\
if( exp1 != act && exp2 != act) gsm_error_ctr++;\
ok( !( exp1 != act && exp2 != act), "GetSystemMetrics(%s): expected %d or %d actual %d\n", #i, exp1, exp2, act);\
}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int gsm_error_ctr
Definition: sysparams.c:2652
int WINAPI GetSystemMetrics(_In_ int)
double __cdecl exp2(double)

Definition at line 2661 of file sysparams.c.

◆ ok_gsm_3

#define ok_gsm_3 (   i,
  e1,
  e2,
  e3 
)
Value:
{\
int exp1 = (e1);\
int exp2 = (e2);\
int exp3 = (e3);\
int act = GetSystemMetrics( (i));\
if( exp1 != act && exp2 != act && exp3 != act) gsm_error_ctr++;\
ok( !( exp1 != act && exp2 != act && exp3 != act),"GetSystemMetrics(%s): expected %d or %d or %d actual %d\n", #i, exp1, exp2, exp3, act);\
}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int gsm_error_ctr
Definition: sysparams.c:2652
int WINAPI GetSystemMetrics(_In_ int)
double __cdecl exp2(double)

Definition at line 2669 of file sysparams.c.

◆ SPI_CAPTIONFONT_VALNAME

#define SPI_CAPTIONFONT_VALNAME   "CaptionFont"

Definition at line 85 of file sysparams.c.

◆ SPI_CAPTIONHEIGHT_VALNAME

#define SPI_CAPTIONHEIGHT_VALNAME   "CaptionHeight"

Definition at line 84 of file sysparams.c.

◆ SPI_CAPTIONWIDTH_VALNAME

#define SPI_CAPTIONWIDTH_VALNAME   "CaptionWidth"

Definition at line 83 of file sysparams.c.

◆ SPI_GETDESKWALLPAPER

#define SPI_GETDESKWALLPAPER   0x0073

Definition at line 40 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_REGKEY

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

Definition at line 97 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_REGKEY2

#define SPI_ICONHORIZONTALSPACING_REGKEY2   "Control Panel\\Desktop"

Definition at line 98 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_VALNAME

#define SPI_ICONHORIZONTALSPACING_VALNAME   "IconSpacing"

Definition at line 99 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_REGKEY

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

Definition at line 100 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_REGKEY2

#define SPI_ICONVERTICALSPACING_REGKEY2   "Control Panel\\Desktop"

Definition at line 101 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_VALNAME

#define SPI_ICONVERTICALSPACING_VALNAME   "IconVerticalSpacing"

Definition at line 102 of file sysparams.c.

◆ SPI_MENUFONT_VALNAME

#define SPI_MENUFONT_VALNAME   "MenuFont"

Definition at line 91 of file sysparams.c.

◆ SPI_MENUHEIGHT_VALNAME

#define SPI_MENUHEIGHT_VALNAME   "MenuHeight"

Definition at line 90 of file sysparams.c.

◆ SPI_MENUWIDTH_VALNAME

#define SPI_MENUWIDTH_VALNAME   "MenuWidth"

Definition at line 89 of file sysparams.c.

◆ SPI_MESSAGEFONT_VALNAME

#define SPI_MESSAGEFONT_VALNAME   "MessageFont"

Definition at line 93 of file sysparams.c.

◆ SPI_METRIC_REGKEY

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

Definition at line 80 of file sysparams.c.

◆ SPI_MINARRANGE_VALNAME

#define SPI_MINARRANGE_VALNAME   "MinArrange"

Definition at line 107 of file sysparams.c.

◆ SPI_MINHORZGAP_VALNAME

#define SPI_MINHORZGAP_VALNAME   "MinHorzGap"

Definition at line 105 of file sysparams.c.

◆ SPI_MINIMIZEDMETRICS_REGKEY

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

Definition at line 103 of file sysparams.c.

◆ SPI_MINVERTGAP_VALNAME

#define SPI_MINVERTGAP_VALNAME   "MinVertGap"

Definition at line 106 of file sysparams.c.

◆ SPI_MINWIDTH_VALNAME

#define SPI_MINWIDTH_VALNAME   "MinWidth"

Definition at line 104 of file sysparams.c.

◆ SPI_SCROLLHEIGHT_VALNAME

#define SPI_SCROLLHEIGHT_VALNAME   "ScrollHeight"

Definition at line 82 of file sysparams.c.

◆ SPI_SCROLLWIDTH_VALNAME

#define SPI_SCROLLWIDTH_VALNAME   "ScrollWidth"

Definition at line 81 of file sysparams.c.

◆ SPI_SETBEEP_REGKEY

#define SPI_SETBEEP_REGKEY   "Control Panel\\Sound"

Definition at line 71 of file sysparams.c.

◆ SPI_SETBEEP_VALNAME

#define SPI_SETBEEP_VALNAME   "Beep"

Definition at line 72 of file sysparams.c.

◆ SPI_SETBORDER_REGKEY

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

Definition at line 77 of file sysparams.c.

◆ SPI_SETBORDER_REGKEY2

#define SPI_SETBORDER_REGKEY2   "Control Panel\\Desktop"

Definition at line 78 of file sysparams.c.

◆ SPI_SETBORDER_VALNAME

#define SPI_SETBORDER_VALNAME   "BorderWidth"

Definition at line 79 of file sysparams.c.

◆ SPI_SETDESKWALLPAPER_REGKEY

#define SPI_SETDESKWALLPAPER_REGKEY   "Control Panel\\Desktop"

Definition at line 169 of file sysparams.c.

◆ SPI_SETDESKWALLPAPER_VALNAME

#define SPI_SETDESKWALLPAPER_VALNAME   "Wallpaper"

Definition at line 170 of file sysparams.c.

◆ SPI_SETDOUBLECLICKTIME_REGKEY

#define SPI_SETDOUBLECLICKTIME_REGKEY   "Control Panel\\Mouse"

Definition at line 128 of file sysparams.c.

◆ SPI_SETDOUBLECLICKTIME_VALNAME

#define SPI_SETDOUBLECLICKTIME_VALNAME   "DoubleClickSpeed"

Definition at line 129 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_REGKEY1

#define SPI_SETDOUBLECLKHEIGHT_REGKEY1   "Control Panel\\Mouse"

Definition at line 125 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_REGKEY2

#define SPI_SETDOUBLECLKHEIGHT_REGKEY2   "Control Panel\\Desktop"

Definition at line 126 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_VALNAME

#define SPI_SETDOUBLECLKHEIGHT_VALNAME   "DoubleClickHeight"

Definition at line 127 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_REGKEY1

#define SPI_SETDOUBLECLKWIDTH_REGKEY1   "Control Panel\\Mouse"

Definition at line 122 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_REGKEY2

#define SPI_SETDOUBLECLKWIDTH_REGKEY2   "Control Panel\\Desktop"

Definition at line 123 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_VALNAME

#define SPI_SETDOUBLECLKWIDTH_VALNAME   "DoubleClickWidth"

Definition at line 124 of file sysparams.c.

◆ SPI_SETDRAGFULLWINDOWS_REGKEY

#define SPI_SETDRAGFULLWINDOWS_REGKEY   "Control Panel\\Desktop"

Definition at line 153 of file sysparams.c.

◆ SPI_SETDRAGFULLWINDOWS_VALNAME

#define SPI_SETDRAGFULLWINDOWS_VALNAME   "DragFullWindows"

Definition at line 154 of file sysparams.c.

◆ SPI_SETFONTSMOOTHING_REGKEY

#define SPI_SETFONTSMOOTHING_REGKEY   "Control Panel\\Desktop"

Definition at line 144 of file sysparams.c.

◆ SPI_SETFONTSMOOTHING_VALNAME

#define SPI_SETFONTSMOOTHING_VALNAME   "FontSmoothing"

Definition at line 145 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGCONTRAST_VALNAME

#define SPI_SETFONTSMOOTHINGCONTRAST_VALNAME   "FontSmoothingGamma"

Definition at line 147 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGORIENTATION_VALNAME

#define SPI_SETFONTSMOOTHINGORIENTATION_VALNAME   "FontSmoothingOrientation"

Definition at line 148 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGTYPE_VALNAME

#define SPI_SETFONTSMOOTHINGTYPE_VALNAME   "FontSmoothingType"

Definition at line 146 of file sysparams.c.

◆ SPI_SETGRIDGRANULARITY_REGKEY

#define SPI_SETGRIDGRANULARITY_REGKEY   "Control Panel\\Desktop"

Definition at line 112 of file sysparams.c.

◆ SPI_SETGRIDGRANULARITY_VALNAME

#define SPI_SETGRIDGRANULARITY_VALNAME   "GridGranularity"

Definition at line 113 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_REGKEY1

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

Definition at line 116 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_REGKEY2

#define SPI_SETICONTITLEWRAP_REGKEY2   "Control Panel\\Desktop"

Definition at line 117 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_VALNAME

#define SPI_SETICONTITLEWRAP_VALNAME   "IconTitleWrap"

Definition at line 118 of file sysparams.c.

◆ SPI_SETKEYBOARDDELAY_REGKEY

#define SPI_SETKEYBOARDDELAY_REGKEY   "Control Panel\\Keyboard"

Definition at line 114 of file sysparams.c.

◆ SPI_SETKEYBOARDDELAY_VALNAME

#define SPI_SETKEYBOARDDELAY_VALNAME   "KeyboardDelay"

Definition at line 115 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_REGKEY

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

Definition at line 136 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_REGKEY_LEGACY

#define SPI_SETKEYBOARDPREF_REGKEY_LEGACY   "Control Panel\\Accessibility"

Definition at line 138 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_VALNAME

#define SPI_SETKEYBOARDPREF_VALNAME   "On"

Definition at line 137 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_VALNAME_LEGACY

#define SPI_SETKEYBOARDPREF_VALNAME_LEGACY   "Keyboard Preference"

Definition at line 139 of file sysparams.c.

◆ SPI_SETKEYBOARDSPEED_REGKEY

#define SPI_SETKEYBOARDSPEED_REGKEY   "Control Panel\\Keyboard"

Definition at line 95 of file sysparams.c.

◆ SPI_SETKEYBOARDSPEED_VALNAME

#define SPI_SETKEYBOARDSPEED_VALNAME   "KeyboardSpeed"

Definition at line 96 of file sysparams.c.

◆ SPI_SETLOWPOWERACTIVE_REGKEY

#define SPI_SETLOWPOWERACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 149 of file sysparams.c.

◆ SPI_SETLOWPOWERACTIVE_VALNAME

#define SPI_SETLOWPOWERACTIVE_VALNAME   "LowPowerActive"

Definition at line 150 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_REGKEY1

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

Definition at line 119 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_REGKEY2

#define SPI_SETMENUDROPALIGNMENT_REGKEY2   "Control Panel\\Desktop"

Definition at line 120 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_VALNAME

#define SPI_SETMENUDROPALIGNMENT_VALNAME   "MenuDropAlignment"

Definition at line 121 of file sysparams.c.

◆ SPI_SETMENUSHOWDELAY_REGKEY

#define SPI_SETMENUSHOWDELAY_REGKEY   "Control Panel\\Desktop"

Definition at line 167 of file sysparams.c.

◆ SPI_SETMENUSHOWDELAY_VALNAME

#define SPI_SETMENUSHOWDELAY_VALNAME   "MenuShowDelay"

Definition at line 168 of file sysparams.c.

◆ SPI_SETMOUSE_REGKEY

#define SPI_SETMOUSE_REGKEY   "Control Panel\\Mouse"

Definition at line 73 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME1

#define SPI_SETMOUSE_VALNAME1   "MouseThreshold1"

Definition at line 74 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME2

#define SPI_SETMOUSE_VALNAME2   "MouseThreshold2"

Definition at line 75 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME3

#define SPI_SETMOUSE_VALNAME3   "MouseSpeed"

Definition at line 76 of file sysparams.c.

◆ SPI_SETMOUSEBUTTONSWAP_REGKEY

#define SPI_SETMOUSEBUTTONSWAP_REGKEY   "Control Panel\\Mouse"

Definition at line 130 of file sysparams.c.

◆ SPI_SETMOUSEBUTTONSWAP_VALNAME

#define SPI_SETMOUSEBUTTONSWAP_VALNAME   "SwapMouseButtons"

Definition at line 131 of file sysparams.c.

◆ SPI_SETMOUSEHOVERHEIGHT_REGKEY

#define SPI_SETMOUSEHOVERHEIGHT_REGKEY   "Control Panel\\Mouse"

Definition at line 159 of file sysparams.c.

◆ SPI_SETMOUSEHOVERHEIGHT_VALNAME

#define SPI_SETMOUSEHOVERHEIGHT_VALNAME   "MouseHoverHeight"

Definition at line 160 of file sysparams.c.

◆ SPI_SETMOUSEHOVERTIME_REGKEY

#define SPI_SETMOUSEHOVERTIME_REGKEY   "Control Panel\\Mouse"

Definition at line 161 of file sysparams.c.

◆ SPI_SETMOUSEHOVERTIME_VALNAME

#define SPI_SETMOUSEHOVERTIME_VALNAME   "MouseHoverTime"

Definition at line 162 of file sysparams.c.

◆ SPI_SETMOUSEHOVERWIDTH_REGKEY

#define SPI_SETMOUSEHOVERWIDTH_REGKEY   "Control Panel\\Mouse"

Definition at line 157 of file sysparams.c.

◆ SPI_SETMOUSEHOVERWIDTH_VALNAME

#define SPI_SETMOUSEHOVERWIDTH_VALNAME   "MouseHoverWidth"

Definition at line 158 of file sysparams.c.

◆ SPI_SETMOUSESCROLLCHARS_REGKEY

#define SPI_SETMOUSESCROLLCHARS_REGKEY   "Control Panel\\Desktop"

Definition at line 163 of file sysparams.c.

◆ SPI_SETMOUSESCROLLCHARS_VALNAME

#define SPI_SETMOUSESCROLLCHARS_VALNAME   "WheelScrollChars"

Definition at line 164 of file sysparams.c.

◆ SPI_SETMOUSESCROLLLINES_REGKEY

#define SPI_SETMOUSESCROLLLINES_REGKEY   "Control Panel\\Desktop"

Definition at line 165 of file sysparams.c.

◆ SPI_SETMOUSESCROLLLINES_VALNAME

#define SPI_SETMOUSESCROLLLINES_VALNAME   "WheelScrollLines"

Definition at line 166 of file sysparams.c.

◆ SPI_SETPOWEROFFACTIVE_REGKEY

#define SPI_SETPOWEROFFACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 151 of file sysparams.c.

◆ SPI_SETPOWEROFFACTIVE_VALNAME

#define SPI_SETPOWEROFFACTIVE_VALNAME   "PowerOffActive"

Definition at line 152 of file sysparams.c.

◆ SPI_SETSCREENREADER_REGKEY

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

Definition at line 140 of file sysparams.c.

◆ SPI_SETSCREENREADER_REGKEY_LEGACY

#define SPI_SETSCREENREADER_REGKEY_LEGACY   "Control Panel\\Accessibility"

Definition at line 142 of file sysparams.c.

◆ SPI_SETSCREENREADER_VALNAME

#define SPI_SETSCREENREADER_VALNAME   "On"

Definition at line 141 of file sysparams.c.

◆ SPI_SETSCREENREADER_VALNAME_LEGACY

#define SPI_SETSCREENREADER_VALNAME_LEGACY   "Blind Access"

Definition at line 143 of file sysparams.c.

◆ SPI_SETSCREENSAVEACTIVE_REGKEY

#define SPI_SETSCREENSAVEACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 110 of file sysparams.c.

◆ SPI_SETSCREENSAVEACTIVE_VALNAME

#define SPI_SETSCREENSAVEACTIVE_VALNAME   "ScreenSaveActive"

Definition at line 111 of file sysparams.c.

◆ SPI_SETSCREENSAVETIMEOUT_REGKEY

#define SPI_SETSCREENSAVETIMEOUT_REGKEY   "Control Panel\\Desktop"

Definition at line 108 of file sysparams.c.

◆ SPI_SETSCREENSAVETIMEOUT_VALNAME

#define SPI_SETSCREENSAVETIMEOUT_VALNAME   "ScreenSaveTimeOut"

Definition at line 109 of file sysparams.c.

◆ SPI_SETSHOWSOUNDS_REGKEY

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

Definition at line 134 of file sysparams.c.

◆ SPI_SETSHOWSOUNDS_VALNAME

#define SPI_SETSHOWSOUNDS_VALNAME   "On"

Definition at line 135 of file sysparams.c.

◆ SPI_SETSNAPTODEFBUTTON_REGKEY

#define SPI_SETSNAPTODEFBUTTON_REGKEY   "Control Panel\\Mouse"

Definition at line 155 of file sysparams.c.

◆ SPI_SETSNAPTODEFBUTTON_VALNAME

#define SPI_SETSNAPTODEFBUTTON_VALNAME   "SnapToDefaultButton"

Definition at line 156 of file sysparams.c.

◆ SPI_SETWORKAREA_REGKEY

#define SPI_SETWORKAREA_REGKEY   "Control Panel\\Desktop"

Definition at line 132 of file sysparams.c.

◆ SPI_SETWORKAREA_VALNAME

#define SPI_SETWORKAREA_VALNAME   "WINE_WorkArea"

Definition at line 133 of file sysparams.c.

◆ SPI_SMCAPTIONFONT_VALNAME

#define SPI_SMCAPTIONFONT_VALNAME   "SmCaptionFont"

Definition at line 88 of file sysparams.c.

◆ SPI_SMCAPTIONHEIGHT_VALNAME

#define SPI_SMCAPTIONHEIGHT_VALNAME   "SmCaptionHeight"

Definition at line 87 of file sysparams.c.

◆ SPI_SMCAPTIONWIDTH_VALNAME

#define SPI_SMCAPTIONWIDTH_VALNAME   "SmCaptionWidth"

Definition at line 86 of file sysparams.c.

◆ SPI_STATUSFONT_VALNAME

#define SPI_STATUSFONT_VALNAME   "StatusFont"

Definition at line 92 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_CAPTIONHEIGHT_VALNAME
Definition: sysparams.c:84
#define SPI_MESSAGEFONT_VALNAME
Definition: sysparams.c:93
#define SPI_MENUHEIGHT_VALNAME
Definition: sysparams.c:90
#define SPI_SCROLLWIDTH_VALNAME
Definition: sysparams.c:81
#define SPI_STATUSFONT_VALNAME
Definition: sysparams.c:92
#define SPI_METRIC_REGKEY
Definition: sysparams.c:80
#define SPI_SCROLLHEIGHT_VALNAME
Definition: sysparams.c:82
#define SPI_MENUFONT_VALNAME
Definition: sysparams.c:91
#define SPI_SMCAPTIONWIDTH_VALNAME
Definition: sysparams.c:86
#define SPI_SMCAPTIONFONT_VALNAME
Definition: sysparams.c:88
#define SPI_MENUWIDTH_VALNAME
Definition: sysparams.c:89
#define SPI_CAPTIONFONT_VALNAME
Definition: sysparams.c:85
#define SPI_SMCAPTIONHEIGHT_VALNAME
Definition: sysparams.c:87

Definition at line 1456 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)
#define VAL(data, px, pl, pos)
Definition: driver.h:91
#define LF
Definition: telnetd.h:24
Definition: btrfs.h:127
static int real_dpi
Definition: sysparams.c:65
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static int dpi
Definition: sysparams.c:65
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Definition at line 1445 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 467 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 477 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 471 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 473 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 475 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 469 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)
#define VAL(data, px, pl, pos)
Definition: driver.h:91
GLuint GLfloat * val
Definition: glext.h:7180
Definition: btrfs.h:127
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:482
static int dpi
Definition: sysparams.c:65

Definition at line 1432 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)
#define VAL(data, px, pl, pos)
Definition: driver.h:91
GLuint GLfloat * val
Definition: glext.h:7180
static UINT metricfromreg(const char *keyname, const char *valname, int dpi)
Definition: sysparams.c:482
static int dpi
Definition: sysparams.c:65

Definition at line 1438 of file sysparams.c.

◆ WINE_CURRENT_USER_REGKEY

#define WINE_CURRENT_USER_REGKEY   "Wine"

Definition at line 173 of file sysparams.c.

◆ WINVER

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

Definition at line 23 of file sysparams.c.

Typedef Documentation

◆ LPLOGFONT16

Function Documentation

◆ _GdiGetCharDimensions()

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

Definition at line 2614 of file sysparams.c.

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

Referenced by get_text_metr_size().

◆ _test_reg_key()

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

Definition at line 331 of file sysparams.c.

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

◆ BOOL()

static BOOL ( WINAPI pIsProcessDPIAware)
static

◆ compare_font()

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

Definition at line 2924 of file sysparams.c.

2925 {
2926  ok_(__FILE__,line)( lf1->lfHeight == MulDiv( lf2->lfHeight, dpi, custom_dpi ),
2927  "wrong lfHeight %d vs %d\n", lf1->lfHeight, lf2->lfHeight );
2928  ok_(__FILE__,line)( abs( lf1->lfWidth - MulDiv( lf2->lfWidth, dpi, custom_dpi )) <= 1,
2929  "wrong lfWidth %d vs %d\n", lf1->lfWidth, lf2->lfWidth );
2930  ok_(__FILE__,line)( !memcmp( &lf1->lfEscapement, &lf2->lfEscapement,
2931  offsetof( LOGFONTW, lfFaceName ) - offsetof( LOGFONTW, lfEscapement )),
2932  "font differs\n" );
2933  ok_(__FILE__,line)( !lstrcmpW( lf1->lfFaceName, lf2->lfFaceName ), "wrong face name %s vs %s\n",
2935 }
#define abs(i)
Definition: fconv.c:206
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
LONG lfHeight
Definition: dimm.idl:59
LONG lfEscapement
Definition: dimm.idl:61
LONG lfWidth
Definition: dimm.idl:60
#define offsetof(TYPE, MEMBER)
Definition: parser.c:48
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
static int dpi
Definition: sysparams.c:65
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define ok_(x1, x2)
Definition: atltest.h:61

Referenced by test_metrics_for_dpi().

◆ dotest_spi_iconhorizontalspacing()

static BOOL dotest_spi_iconhorizontalspacing ( INT  curr_val)
static

Definition at line 906 of file sysparams.c.

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

Referenced by test_SPI_ICONHORIZONTALSPACING().

◆ dotest_spi_iconverticalspacing()

static BOOL dotest_spi_iconverticalspacing ( INT  curr_val)
static

Definition at line 1075 of file sysparams.c.

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

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

3740 {
3741  DPI_AWARENESS_CONTEXT ctx = pGetWindowDpiAwarenessContext( hwnd );
3742  DPI_AWARENESS_CONTEXT ctx2 = pGetThreadDpiAwarenessContext();
3743  DWORD pos, pos2;
3744 
3745  ok( pGetAwarenessFromDpiAwarenessContext( ctx ) == pGetAwarenessFromDpiAwarenessContext( ctx2 ),
3746  "msg %04x wrong awareness %p / %p\n", msg, ctx, ctx2 );
3747  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3748  pos = GetMessagePos();
3749  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3750  pos2 = GetMessagePos();
3751  ok( pos == pos2, "wrong pos %08x / %08x\n", pos, pos2 );
3752  pSetThreadDpiAwarenessContext( ctx2 );
3753  return DefWindowProcA( hwnd, msg, wp, lp );
3754 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
DWORD WINAPI GetMessagePos(void)
Definition: message.c:1350
unsigned long DWORD
Definition: ntddk_ex.h:95
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
Definition: windef.h:294
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
#define DPI_AWARENESS_CONTEXT_UNAWARE
Definition: windef.h:292
static UINT UINT *static DPI_AWARENESS_CONTEXT(WINAPI *pGetThreadDpiAwarenessContext)(void)

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

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

Referenced by is_font_enumerated().

◆ get_cursor_size()

static int get_cursor_size ( int  size)
static

Definition at line 2696 of file sysparams.c.

2697 {
2698  /* only certain sizes are allowed for cursors */
2699  if (size >= 64) return 64;
2700  if (size >= 48) return 48;
2701  return 32;
2702 }
GLsizeiptr size
Definition: glext.h:5919

Referenced by test_GetSystemMetrics().

◆ get_real_dpi()

static DWORD get_real_dpi ( void  )
static

Definition at line 206 of file sysparams.c.

207 {
208  DWORD dpi;
209 
210  if (pSetThreadDpiAwarenessContext)
211  {
212  DPI_AWARENESS_CONTEXT context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
213  dpi = pGetDpiForSystem();
214  pSetThreadDpiAwarenessContext( context );
215  return dpi;
216  }
217  if (get_reg_dword(HKEY_CURRENT_USER, "Control Panel\\Desktop", "LogPixels", &dpi))
218  return dpi;
219  if (get_reg_dword(HKEY_CURRENT_CONFIG, "Software\\Fonts", "LogPixels", &dpi))
220  return dpi;
222 }
Definition: http.c:7098
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
static BOOL get_reg_dword(HKEY base, const char *key_name, const char *value_name, DWORD *value)
Definition: sysparams.c:187
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
Definition: windef.h:293
unsigned long DWORD
Definition: ntddk_ex.h:95
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2868
static int dpi
Definition: sysparams.c:65
static UINT UINT *static DPI_AWARENESS_CONTEXT(WINAPI *pGetThreadDpiAwarenessContext)(void)

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

188 {
189  HKEY key;
190  DWORD type, data, size = sizeof(data);
191  BOOL ret = FALSE;
192 
194  {
195  if (RegQueryValueExA(key, value_name, NULL, &type, (void *)&data, &size) == ERROR_SUCCESS &&
196  type == REG_DWORD)
197  {
198  *value = data;
199  ret = TRUE;
200  }
201  RegCloseKey(key);
202  }
203  return ret;
204 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
HKEY key
Definition: reg.c:42
#define REG_DWORD
Definition: sdbapi.c:596
Definition: path.c:41

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

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

Referenced by test_GetSystemMetrics().

◆ get_tmheight()

static int get_tmheight ( LOGFONTA plf,
int  flag 
)
static

Definition at line 1473 of file sysparams.c.

1474 {
1475  TEXTMETRICA tm;
1476  HDC hdc = GetDC(0);
1478  hfont = SelectObject( hdc, hfont);
1479  GetTextMetricsA( hdc, &tm);
1480  hfont = SelectObject( hdc, hfont);
1481  ReleaseDC( 0, hdc );
1482  return tm.tmHeight + (flag ? tm.tmExternalLeading : 0);
1483 }
HDC WINAPI GetDC(_In_opt_ HWND)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
static HFONT hfont
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
HDC hdc
Definition: main.c:9
Definition: time.h:76
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)

Referenced by test_SPI_SETNONCLIENTMETRICS().

◆ get_tmheightW()

static int get_tmheightW ( LOGFONTW plf,
int  flag 
)
static

Definition at line 1485 of file sysparams.c.

1486 {
1487  TEXTMETRICW tm;
1488  HDC hdc = GetDC(0);
1490  hfont = SelectObject( hdc, hfont);
1491  GetTextMetricsW( hdc, &tm);
1492  hfont = SelectObject( hdc, hfont);
1493  ReleaseDC( 0, hdc );
1494  return tm.tmHeight + (flag ? tm.tmExternalLeading : 0);
1495 }
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
static HFONT hfont
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
HDC hdc
Definition: main.c:9
Definition: time.h:76
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)

Referenced by test_metrics_for_dpi().

◆ INT()

static INT ( WINAPI pGetSystemMetricsForDpi)
static

Referenced by SpiGetSetProbeBuffer().

◆ is_font_enumerated()

static BOOL is_font_enumerated ( const char name)
static

Definition at line 2684 of file sysparams.c.

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

Referenced by test_GetSystemMetrics().

◆ lffromreg()

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

Definition at line 520 of file sysparams.c.

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

◆ LONG()

static LONG ( WINAPI pChangeDisplaySettingsExA)
static

◆ metricfromreg()

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

Definition at line 482 of file sysparams.c.

483 {
484  HKEY hkey;
485  char buf[64];
486  DWORD ret;
487  DWORD size, type;
488  int value;
489 
490  RegOpenKeyA( HKEY_CURRENT_USER, keyname, &hkey );
491  size = sizeof(buf);
492  ret=RegQueryValueExA( hkey, valname, NULL, &type, (LPBYTE)buf, &size );
493  RegCloseKey( hkey );
494  if( ret != ERROR_SUCCESS) return -1;
495  value = atoi( buf);
496  if( value < 0)
497  value = ( -value * dpi + 720) / 1440;
498  return value;
499 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4023
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define HKEY_CURRENT_USER
Definition: winreg.h:11
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLsizei const GLfloat * value
Definition: glext.h:6069
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
static int dpi
Definition: sysparams.c:65

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

642 {
643  BOOL rc;
644  INT mi[3];
645  static int aw_turn = 0;
646 
647  char buf[20];
648  int i;
649 
650  aw_turn++;
651  rc = FALSE;
652  SetLastError(0xdeadbeef);
653  if (aw_turn % 2) /* call unicode on odd (non even) calls */
655  else
657  if (!test_error_msg(rc,"SPI_SETMOUSE")) return FALSE;
658 
659  ok(rc, "SystemParametersInfo: rc=%d err=%d\n", rc, GetLastError());
661  for (i = 0; i < 3; i++)
662  {
663  sprintf( buf, "%d", curr_val[i] );
665  }
666 
668  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
669  for (i = 0; i < 3; i++)
670  {
671  ok(mi[i] == curr_val[i],
672  "incorrect value for %d: %d != %d\n", i, mi[i], curr_val[i]);
673  }
674 
676  ok(rc, "SystemParametersInfoW: rc=%d err=%d\n", rc, GetLastError());
677  for (i = 0; i < 3; i++)
678  {
679  ok(mi[i] == curr_val[i],
680  "incorrect value for %d: %d != %d\n", i, mi[i], curr_val[i]);
681  }
682 
683  if (0)
684  {
685  /* FIXME: this always fails for me - AJ */
686  for (i = 0; i < nchange; i++)
687  {
688  POINT mv;
690  mouse_event( MOUSEEVENTF_MOVE, req_change[i].x, req_change[i].y, 0, 0 );
691  GetCursorPos( &mv );
692  ok( proj_change[i].x == mv.x, "Projected dx and real dx comparison. May fail under high load.\n" );
693  ok( proj_change[i].y == mv.y, "Projected dy equals real dy. May fail under high load.\n" );
694  }
695  }
696  return TRUE;
697 }
#define TRUE
Definition: types.h:120
#define MOUSEEVENTF_ABSOLUTE
Definition: winuser.h:1180
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SPI_SETMOUSE_REGKEY
Definition: sysparams.c:73
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SPI_SETMOUSE
Definition: winuser.h:1338
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static MONITORINFO mi
Definition: win.c:7339
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
static void test_change_message(int action, int optional)
Definition: sysparams.c:285
int32_t INT
Definition: typedefs.h:56
#define sprintf(buf, format,...)
Definition: sprintf.c:55
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define test_reg_key(subKey, valName, testValue)
Definition: sysparams.c:467
unsigned int BOOL
Definition: ntddk_ex.h:94
void WINAPI mouse_event(_In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ ULONG_PTR)
#define SPI_GETMOUSE
Definition: winuser.h:1337
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define SetLastError(x)
Definition: compat.h:417
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:299
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
#define MOUSEEVENTF_MOVE
Definition: winuser.h:1169
#define ok(value,...)
Definition: atltest.h:57
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static const char * setmouse_valuenames[3]
Definition: sysparams.c:632

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

3189 {
3190  pt->x = MulDiv( pt->x, target_dpi, src_dpi );
3191  pt->y = MulDiv( pt->y, target_dpi, src_dpi );
3192 }
#define pt(x, y)
Definition: drawing.c:79
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

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

3203 {
3206  else if (from != DPI_AWARENESS_UNAWARE && to == DPI_AWARENESS_UNAWARE)
3208 }
#define pt(x, y)
Definition: drawing.c:79
static void scale_point_dpi(POINT *pt, UINT src_dpi, UINT target_dpi)
Definition: sysparams.c:3188
static int real_dpi
Definition: sysparams.c:65
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2868
CardRegion * from
Definition: spigame.cpp:19

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

3195 {
3196  rect->left = MulDiv( rect->left, target_dpi, src_dpi );
3197  rect->top = MulDiv( rect->top, target_dpi, src_dpi );
3198  rect->right = MulDiv( rect->right, target_dpi, src_dpi );
3199  rect->bottom = MulDiv( rect->bottom, target_dpi, src_dpi );
3200 }
& rect
Definition: startmenu.cpp:1413
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

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

3211 {
3214  else if (from != DPI_AWARENESS_UNAWARE && to == DPI_AWARENESS_UNAWARE)
3216 }
& rect
Definition: startmenu.cpp:1413
static int real_dpi
Definition: sysparams.c:65
static void scale_rect_dpi(RECT *rect, UINT src_dpi, UINT target_dpi)
Definition: sysparams.c:3194
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2868
CardRegion * from
Definition: spigame.cpp:19

Referenced by test_dpi_mapping().

◆ START_TEST()

START_TEST ( sysparams  )

Definition at line 3898 of file sysparams.c.

3899 {
3900  int argc;
3901  char** argv;
3902  WNDCLASSA wc;
3903  MSG msg;
3904  HDC hdc;
3905  HANDLE hThread;
3906  DWORD dwThreadId;
3908 
3909  hdll = GetModuleHandleA("user32.dll");
3910  pChangeDisplaySettingsExA = (void*)GetProcAddress(hdll, "ChangeDisplaySettingsExA");
3911  pIsProcessDPIAware = (void*)GetProcAddress(hdll, "IsProcessDPIAware");
3912  pSetProcessDPIAware = (void*)GetProcAddress(hdll, "SetProcessDPIAware");
3913  pGetDpiForSystem = (void*)GetProcAddress(hdll, "GetDpiForSystem");
3914  pGetDpiForWindow = (void*)GetProcAddress(hdll, "GetDpiForWindow");
3915  pGetDpiForMonitorInternal = (void*)GetProcAddress(hdll, "GetDpiForMonitorInternal");
3916  pSetProcessDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetProcessDpiAwarenessContext");
3917  pGetProcessDpiAwarenessInternal = (void*)GetProcAddress(hdll, "GetProcessDpiAwarenessInternal");
3918  pSetProcessDpiAwarenessInternal = (void*)GetProcAddress(hdll, "SetProcessDpiAwarenessInternal");
3919  pGetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetThreadDpiAwarenessContext");
3920  pSetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetThreadDpiAwarenessContext");
3921  pGetWindowDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetWindowDpiAwarenessContext");
3922  pGetAwarenessFromDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetAwarenessFromDpiAwarenessContext");
3923  pIsValidDpiAwarenessContext = (void*)GetProcAddress(hdll, "IsValidDpiAwarenessContext");
3924  pGetSystemMetricsForDpi = (void*)GetProcAddress(hdll, "GetSystemMetricsForDpi");
3925  pSystemParametersInfoForDpi = (void*)GetProcAddress(hdll, "SystemParametersInfoForDpi");
3926  pAdjustWindowRectExForDpi = (void*)GetProcAddress(hdll, "AdjustWindowRectExForDpi");
3927  pLogicalToPhysicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "LogicalToPhysicalPointForPerMonitorDPI");
3928  pPhysicalToLogicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "PhysicalToLogicalPointForPerMonitorDPI");
3929  pGetAutoRotationState = (void*)GetProcAddress(hdll, "GetAutoRotationState");
3930 
3932  hdc = GetDC(0);
3934  real_dpi = get_real_dpi();
3935  trace("dpi %d real_dpi %d\n", dpi, real_dpi);
3936  ReleaseDC( 0, hdc);
3937 
3938  /* This test requires interactivity, if we don't have it, give up */
3941 
3943  strict=(argc >= 3 && strcmp(argv[2],"strict")==0);
3944  trace("strict=%d\n",strict);
3945 
3946  trace("testing GetSystemMetrics with your current desktop settings\n");
3948  test_metrics_for_dpi( 192 );
3952 
3953  change_counter = 0;
3954  change_last_param = 0;
3955 
3956  wc.lpszClassName = "SysParamsTestClass";
3959  wc.hInstance = hInstance;
3960  wc.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION );
3961  wc.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW );
3962  wc.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
3963  wc.lpszMenuName = 0;
3964  wc.cbClsExtra = 0;
3965  wc.cbWndExtra = 0;
3966  RegisterClassA( &wc );
3967  wc.lpszClassName = "DpiTestClass";
3968  wc.lpfnWndProc = dpi_winproc;
3969  RegisterClassA( &wc );
3970 
3971  ghTestWnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application",
3972  WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, hInstance, NULL );
3973 
3975  assert( hThread );
3976  CloseHandle( hThread );
3977 
3978  while( GetMessageA( &msg, 0, 0, 0 )) {
3979  TranslateMessage( &msg );
3980  DispatchMessageA( &msg );
3981  }
3982 
3983  if (pSetThreadDpiAwarenessContext)
3984  {
3985  test_dpi_context();
3986  test_dpi_mapping();
3987  test_dpi_window();
3988  }
3989  else win_skip( "SetThreadDpiAwarenessContext not supported\n" );
3990 
3991  test_dpi_aware();
3992 }
static int argc
Definition: ServiceArgs.c:12
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
static DWORD get_real_dpi(void)
Definition: sysparams.c:206
static void test_EnumDisplaySettings(void)
Definition: sysparams.c:3083
HDC WINAPI GetDC(_In_opt_ HWND)
static void test_GetAutoRotationState(void)
Definition: sysparams.c:3877
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static void test_dpi_context(void)
Definition: sysparams.c:3538
static HDC
Definition: imagelist.c:92
static int change_last_param
Definition: sysparams.c:182
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
int cbClsExtra
Definition: winuser.h:3140
#define assert(x)
Definition: debug.h:53
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3146
static void test_dpi_window(void)
Definition: sysparams.c:3756
#define IDI_APPLICATION
Definition: winuser.h:699
static void test_GetSysColorBrush(void)
Definition: sysparams.c:3123
HBRUSH hbrBackground
Definition: winuser.h:3145
#define CS_OWNDC
Definition: winuser.h:650
#define SPI_SETBEEP
Definition: winuser.h:1336
#define argv
Definition: mplay32.c:18
#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION
Definition: winerror.h:940
static HWND ghTestWnd
Definition: sysparams.c:175
#define COLOR_WINDOW
Definition: winuser.h:908
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2029
int cbWndExtra
Definition: winuser.h:3141
HINSTANCE hInstance
Definition: charmap.c:20
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
HCURSOR hCursor
Definition: winuser.h:3144
static void test_GetSystemMetrics(void)
Definition: sysparams.c:2704
BOOL WINAPI SystemParametersInfoA(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static LRESULT CALLBACK SysParamsTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: sysparams.c:224
const char * LPCSTR
Definition: xmlstorage.h:183
#define CS_VREDRAW
Definition: winuser.h:653
#define trace
Definition: atltest.h:70
unsigned long DWORD
Definition: ntddk_ex.h:95
static void test_dpi_mapping(void)
Definition: sysparams.c:3218
static DWORD WINAPI SysParamsThreadFunc(LPVOID lpParam)
Definition: sysparams.c:2556
int winetest_get_mainargs(char ***pargv)
static BOOL strict
Definition: sysparams.c:64
DWORD dwThreadId
Definition: fdebug.c:31
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
LPCSTR lpszClassName
Definition: winuser.h:3147
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3138
static int change_counter
Definition: sysparams.c:180
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static int real_dpi
Definition: sysparams.c:65
HINSTANCE hInstance
Definition: winuser.h:3142
static LRESULT CALLBACK dpi_winproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: sysparams.c:3739
#define SPIF_SENDCHANGE
Definition: winuser.h:1554
static PVOID hdll
Definition: shimdbg.c:126
HANDLE hThread
Definition: wizard.c:27
WNDPROC lpfnWndProc
Definition: winuser.h:3139
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static void test_metrics_for_dpi(int custom_dpi)
Definition: sysparams.c:2937
#define GetProcAddress(x, y)
Definition: compat.h:418
#define LOGPIXELSY
Definition: wingdi.h:718
static int dpi
Definition: sysparams.c:65
#define win_skip
Definition: test.h:150
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
static void test_dpi_aware(void)
Definition: sysparams.c:3516
HICON hIcon
Definition: winuser.h:3143

◆ SysParamsTestWndProc()

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

Definition at line 224 of file sysparams.c.

226 {
227  switch (msg) {
228 
229  case WM_DISPLAYCHANGE:
230  ok(displaychange_ok, "Unexpected WM_DISPLAYCHANGE message\n");
231  last_bpp = wParam;
234  break;
235 
236  case WM_SETTINGCHANGE:
237  if (change_counter>0) {
238  /* ignore these messages caused by resizing of toolbars */
239  if( wParam == SPI_SETWORKAREA){
241  break;
242  } else if( wParam == SPI_ICONVERTICALSPACING) {
244  break;
245  } else if( displaychange_test_active)
246  break;
247  if( !change_last_param){
249  break;
250  }
251  ok(0,"too many changes counter=%d last change=%d\n",
253  change_counter++;
255  break;
256  }
257  change_counter++;
259  if( wParam == SPI_SETWORKAREA)
261  else if( wParam == SPI_ICONVERTICALSPACING)
263  else
265  break;
266 
267  case WM_DESTROY:
268  PostQuitMessage( 0 );
269  break;
270 
271  /* drop through */
272  default:
273  return( DefWindowProcA( hWnd, msg, wParam, lParam ) );
274  }
275 
276  return 0;
277 }
static int change_setworkarea_param
Definition: sysparams.c:181
static int last_bpp
Definition: sysparams.c:183
static int change_last_param
Definition: sysparams.c:182
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
#define WM_SETTINGCHANGE
Definition: winuser.h:1611
static BOOL displaychange_ok
Definition: sysparams.c:184
#define WM_DESTROY
Definition: winuser.h:1591
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
static HANDLE displaychange_sem
Definition: sysparams.c:185
static int change_iconverticalspacing_param
Definition: sysparams.c:181
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static int change_counter
Definition: sysparams.c:180
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseSemaphore(IN HANDLE hSemaphore, IN LONG lReleaseCount, IN LPLONG lpPreviousCount)
Definition: synch.c:542
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
static BOOL displaychange_test_active
Definition: sysparams.c:184

Referenced by START_TEST().

◆ SysParamsThreadFunc()

static DWORD WINAPI SysParamsThreadFunc ( LPVOID  lpParam)
static

Definition at line 2556 of file sysparams.c.

2557 {
2558  test_SPI_SETBEEP(); /* 1 */
2559  test_SPI_SETMOUSE(); /* 4 */
2560  test_SPI_SETBORDER(); /* 6 */
2561  test_SPI_SETKEYBOARDSPEED(); /* 10 */
2562  test_SPI_ICONHORIZONTALSPACING(); /* 13 */
2563  test_SPI_SETSCREENSAVETIMEOUT(); /* 14 */
2564  test_SPI_SETSCREENSAVEACTIVE(); /* 17 */
2565  test_SPI_SETGRIDGRANULARITY(); /* 19 */
2566  test_SPI_SETKEYBOARDDELAY(); /* 23 */
2567  test_SPI_ICONVERTICALSPACING(); /* 24 */
2568  test_SPI_SETICONTITLEWRAP(); /* 26 */
2569  test_SPI_SETMENUDROPALIGNMENT(); /* 28 */
2570  test_SPI_SETDOUBLECLKWIDTH(); /* 29 */
2571  test_SPI_SETDOUBLECLKHEIGHT(); /* 30 */
2572  test_SPI_SETDOUBLECLICKTIME(); /* 32 */
2573  test_SPI_SETMOUSEBUTTONSWAP(); /* 33 */
2574  test_SPI_SETFASTTASKSWITCH(); /* 36 */
2575  test_SPI_SETDRAGFULLWINDOWS(); /* 37 */
2576  /* test_WM_DISPLAYCHANGE seems to be somewhat buggy on
2577  * some versions of Windows (Vista, Win2k8, Win7B) in that
2578  * not all metrics are properly restored. Problems are
2579  * SM_CXMAXTRACK, SM_CYMAXTRACK
2580  * Fortunately setting the Non-Client metrics like in
2581  * test_SPI_SETNONCLIENTMETRICS will correct this. That is why
2582  * we do the DISPLAY change now... */
2584  test_SPI_SETNONCLIENTMETRICS(); /* 42 */
2585  test_SPI_SETMINIMIZEDMETRICS(); /* 44 */
2586  test_SPI_SETICONMETRICS(); /* 46 */
2587  test_SPI_SETWORKAREA(); /* 47 */
2588  test_SPI_SETSHOWSOUNDS(); /* 57 */
2589  test_SPI_SETKEYBOARDPREF(); /* 69 */
2590  test_SPI_SETSCREENREADER(); /* 71 */
2591  test_SPI_SETFONTSMOOTHING(); /* 75 */
2592  test_SPI_SETLOWPOWERACTIVE(); /* 85 */
2593  test_SPI_SETPOWEROFFACTIVE(); /* 86 */
2594  test_SPI_SETSNAPTODEFBUTTON(); /* 95 */
2595  test_SPI_SETMOUSEHOVERWIDTH(); /* 99 */
2596  test_SPI_SETMOUSEHOVERHEIGHT(); /* 101 */
2597  test_SPI_SETMOUSEHOVERTIME(); /* 103 */
2598  test_SPI_SETWHEELSCROLLLINES(); /* 105 */
2599  test_SPI_SETMENUSHOWDELAY(); /* 107 */
2600  test_SPI_SETWHEELSCROLLCHARS(); /* 108 */
2601  test_SPI_SETWALLPAPER(); /* 115 */
2602 
2603 
2604  SendMessageA( ghTestWnd, WM_DESTROY, 0, 0 );
2605  return 0;
2606 }
static void test_SPI_SETSCREENSAVEACTIVE(void)
Definition: sysparams.c:996
static void test_SPI_SETMINIMIZEDMETRICS(void)
Definition: sysparams.c:1623
static void test_SPI_SETBORDER(void)
Definition: sysparams.c:811
static void test_SPI_SETDRAGFULLWINDOWS(void)
Definition: sysparams.c:1395
static void test_SPI_SETNONCLIENTMETRICS(void)
Definition: sysparams.c:1500
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void test_SPI_SETDOUBLECLICKTIME(void)
Definition: sysparams.c:1289
static void test_SPI_ICONHORIZONTALSPACING(void)
Definition: sysparams.c:940
static void test_SPI_SETWORKAREA(void)
Definition: sysparams.c:1868
static void test_SPI_SETPOWEROFFACTIVE(void)
Definition: sysparams.c:2146
static void test_SPI_SETDOUBLECLKWIDTH(void)
Definition: sysparams.c:1221
static void test_SPI_SETMENUSHOWDELAY(void)
Definition: sysparams.c:2373
static HWND ghTestWnd
Definition: sysparams.c:175
static void test_SPI_SETICONTITLEWRAP(void)
Definition: sysparams.c:1130
static void test_SPI_SETFONTSMOOTHING(void)
Definition: sysparams.c:2027
static void test_SPI_SETLOWPOWERACTIVE(void)
Definition: sysparams.c:2108
static void test_SPI_ICONVERTICALSPACING(void)
Definition: sysparams.c:1109
static void test_SPI_SETGRIDGRANULARITY(void)
Definition: sysparams.c:1032
static void test_WM_DISPLAYCHANGE(void)
Definition: sysparams.c:2474
static void test_SPI_SETDOUBLECLKHEIGHT(void)
Definition: sysparams.c:1255
static void test_SPI_SETWALLPAPER(void)
Definition: sysparams.c:2450
static void test_SPI_SETMOUSEBUTTONSWAP(void)
Definition: sysparams.c:1345
#define WM_DESTROY
Definition: winuser.h:1591
static void test_SPI_SETKEYBOARDDELAY(void)
Definition: sysparams.c:1037
static void test_SPI_SETSCREENSAVETIMEOUT(void)
Definition: sysparams.c:959
static void test_SPI_SETSHOWSOUNDS(void)
Definition: sysparams.c:1920
static void test_SPI_SETKEYBOARDPREF(void)
Definition: sysparams.c:1957
static void test_SPI_SETSCREENREADER(void)
Definition: sysparams.c:1992
static void test_SPI_SETWHEELSCROLLLINES(void)
Definition: sysparams.c:2334
static void test_SPI_SETKEYBOARDSPEED(void)
Definition: sysparams.c:870
static void test_SPI_SETSNAPTODEFBUTTON(void)
Definition: sysparams.c:2184
static void test_SPI_SETMOUSE(void)
Definition: sysparams.c:699
static void test_SPI_SETMENUDROPALIGNMENT(void)
Definition: sysparams.c:1182
static void test_SPI_SETMOUSEHOVERHEIGHT(void)
Definition: sysparams.c:2256
static void test_SPI_SETFASTTASKSWITCH(void)
Definition: sysparams.c:1379
static void test_SPI_SETMOUSEHOVERTIME(void)
Definition: sysparams.c:2293
static void test_SPI_SETMOUSEHOVERWIDTH(void)
Definition: sysparams.c:2219
static void test_SPI_SETWHEELSCROLLCHARS(void)
Definition: sysparams.c:2412
static void test_SPI_SETICONMETRICS(void)
Definition: sysparams.c:1749
static void test_SPI_SETBEEP(void)
Definition: sysparams.c:572

Referenced by START_TEST().

◆ test_change_message()

static void test_change_message ( int  action,
int  optional 
)
static

Definition at line 285 of file sysparams.c.

286 {
287  if (change_counter==0 && optional==1)
288  return;
289  ok( 1 == change_counter,
290  "Missed a message: change_counter=%d\n", change_counter );
291  change_counter = 0;
293  ( change_setworkarea_param && action == SPI_SETWORKAREA) ||
295  "Wrong action got %d expected %d\n", change_last_param, action );
296  change_last_param = 0;
297 }
static int change_setworkarea_param
Definition: sysparams.c:181
static int change_last_param
Definition: sysparams.c:182
Definition: msg.h:41
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
static int change_iconverticalspacing_param
Definition: sysparams.c:181
static int change_counter
Definition: sysparams.c:180
const WCHAR * action
Definition: action.c:7783
#define ok(value,...)
Definition: atltest.h:57

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

3517 {
3518  BOOL ret;
3519 
3520  if (!pIsProcessDPIAware)
3521  {
3522  win_skip("IsProcessDPIAware not available\n");
3523  return;
3524  }
3525 
3526  ret = pSetProcessDPIAware();
3527  ok(ret, "got %d\n", ret);
3528 
3529  ret = pIsProcessDPIAware();
3530  ok(ret, "got %d\n", ret);
3531 
3532  dpi = real_dpi;
3534  test_metrics_for_dpi( 96 );
3535  test_metrics_for_dpi( 192 );
3536 }
unsigned int BOOL
Definition: ntddk_ex.h:94
static void test_GetSystemMetrics(void)
Definition: sysparams.c:2704
int ret
static int real_dpi
Definition: sysparams.c:65
#define ok(value,...)
Definition: atltest.h:57
static void test_metrics_for_dpi(int custom_dpi)
Definition: sysparams.c:2937
static int dpi
Definition: sysparams.c:65
#define win_skip
Definition: test.h:150

Referenced by START_TEST().

◆ test_dpi_context()

static void test_dpi_context ( void  )
static

Definition at line 3538 of file sysparams.c.

3539 {
3540  DPI_AWARENESS awareness;
3542  ULONG_PTR i, flags;
3543  BOOL ret;
3544  UINT dpi;
3545  HDC hdc = GetDC( 0 );
3546 
3547  context = pGetThreadDpiAwarenessContext();
3548  /* Windows 10 >= 1709 adds extra 0x6000 flags */
3549  flags = (ULONG_PTR)context & 0x6000;
3550  todo_wine
3551  ok( context == (DPI_AWARENESS_CONTEXT)(0x10 | flags), "wrong context %p\n", context );
3552  awareness = pGetAwarenessFromDpiAwarenessContext( context );
3553  todo_wine
3554  ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness );
3555  todo_wine
3556  ok( !pIsProcessDPIAware(), "already aware\n" );
3557  dpi = pGetDpiForSystem();
3559  ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3562  ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3563  SetLastError( 0xdeadbeef );
3564  ret = pSetProcessDpiAwarenessContext( NULL );
3565  ok( !ret, "got %d\n", ret );
3566  ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3567  SetLastError( 0xdeadbeef );
3568  ret = pSetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)-6 );
3569  ok( !ret, "got %d\n", ret );
3570  ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3571  ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
3572  todo_wine
3573  ok( ret, "got %d\n", ret );
3574  ok( pIsProcessDPIAware(), "not aware\n" );
3575  real_dpi = pGetDpiForSystem();
3576  SetLastError( 0xdeadbeef );
3577  ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
3578  ok( !ret, "got %d\n", ret );
3579  ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
3580  SetLastError( 0xdeadbeef );
3581  ret = pSetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3582  ok( !ret, "got %d\n", ret );
3583  ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
3584 
3585  ret = pSetProcessDpiAwarenessInternal( DPI_AWARENESS_INVALID );
3586  ok( !ret, "got %d\n", ret );
3587  ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3588  ret = pSetProcessDpiAwarenessInternal( DPI_AWARENESS_UNAWARE );
3589  ok( !ret, "got %d\n", ret );
3590  ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
3591  ret = pGetProcessDpiAwarenessInternal( 0, &awareness );
3592  ok( ret, "got %d\n", ret );
3593  todo_wine
3594  ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness );
3595  ret = pGetProcessDpiAwarenessInternal( GetCurrentProcess(), &awareness );
3596  ok( ret, "got %d\n", ret );
3597  todo_wine
3598  ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness );
3599  ret = pGetProcessDpiAwarenessInternal( (HANDLE)0xdeadbeef, &awareness );
3600  ok( ret, "got %d\n", ret );
3601  ok( awareness == DPI_AWARENESS_UNAWARE, "wrong value %d\n", awareness );
3602 
3603  ret = pIsProcessDPIAware();
3604  ok(ret, "got %d\n", ret);
3605  context = pGetThreadDpiAwarenessContext();
3606  todo_wine
3607  ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3608  awareness = pGetAwarenessFromDpiAwarenessContext( context );
3609  todo_wine
3610  ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness );
3611  SetLastError( 0xdeadbeef );
3612  context = pSetThreadDpiAwarenessContext( 0 );
3613  ok( !context, "got %p\n", context );
3614  ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3615  SetLastError( 0xdeadbeef );
3616  context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)-6 );
3617  ok( !context, "got %p\n", context );
3618  ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
3619  context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3620  todo_wine
3621  ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
3622  awareness = pGetAwarenessFromDpiAwarenessContext( context );
3623  todo_wine
3624  ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness );
3625  dpi = pGetDpiForSystem();
3626  ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3628  ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3629  ok( !pIsProcessDPIAware(), "still aware\n" );
3630  context = pGetThreadDpiAwarenessContext();
3631  ok( context == (DPI_AWARENESS_CONTEXT)(0x10 | flags), "wrong context %p\n", context );
3632  awareness = pGetAwarenessFromDpiAwarenessContext( context );
3633  ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness );
3634  context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3635  ok( context == (DPI_AWARENESS_CONTEXT)(0x10 | flags), "wrong context %p\n", context );
3636  awareness = pGetAwarenessFromDpiAwarenessContext( context );
3637  ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness );
3638  dpi = pGetDpiForSystem();
3639  ok( dpi == real_dpi, "wrong dpi %u/%u\n", dpi, real_dpi );
3641  ok( dpi == real_dpi, "wrong dpi %u\n", dpi );
3642  context = pGetThreadDpiAwarenessContext();
3643  ok( context == (DPI_AWARENESS_CONTEXT)0x12, "wrong context %p\n", context );
3644  awareness = pGetAwarenessFromDpiAwarenessContext( context );
3645  ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness );
3646  context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
3647  ok( context == (DPI_AWARENESS_CONTEXT)0x12, "wrong context %p\n", context );
3648  awareness = pGetAwarenessFromDpiAwarenessContext( context );
3649  ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness );
3650  dpi = pGetDpiForSystem();
3651  ok( dpi == real_dpi, "wrong dpi %u/%u\n", dpi, real_dpi );
3653  ok( dpi == real_dpi, "wrong dpi %u\n", dpi );
3654  ok( pIsProcessDPIAware(), "not aware\n" );
3655  context = pGetThreadDpiAwarenessContext();
3656  ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3657  context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(0x80000010 | flags) );
3658  ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | 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)(0x80000011 | flags) );
3663  todo_wine
3664  ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
3665  context = pGetThreadDpiAwarenessContext();
3666  todo_wine
3667  ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3668  context = pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)0x12 );
3669  todo_wine
3670  ok( context == (DPI_AWARENESS_CONTEXT)(0x80000011 | flags), "wrong context %p\n", context );
3671  context = pSetThreadDpiAwarenessContext( context );
3672  ok( context == (DPI_AWARENESS_CONTEXT)(0x12), "wrong context %p\n", context );
3673  context = pGetThreadDpiAwarenessContext();
3674  todo_wine
3675  ok( context == (DPI_AWARENESS_CONTEXT)(0x11 | flags), "wrong context %p\n", context );
3676  for (i = 0; i < 0x100; i++)
3677  {
3678  awareness = pGetAwarenessFromDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)i );
3679  switch (i)
3680  {
3681  case 0x10:
3682  case 0x11:
3683  case 0x12:
3684  ok( awareness == (i & ~0x10), "%lx: wrong value %u\n", i, awareness );
3685  ok( pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)i ), "%lx: not valid\n", i );
3686  break;
3687  default:
3688  ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", i, awareness );
3689  ok( !pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)i ), "%lx: valid\n", i );
3690  break;
3691  }
3692  awareness = pGetAwarenessFromDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(i | 0x80000000) );
3693  switch (i)
3694  {
3695  case 0x10:
3696  case 0x11:
3697  case 0x12:
3698  ok( awareness == (i & ~0x10), "%lx: wrong value %u\n", i | 0x80000000, awareness );
3699  ok( pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(i | 0x80000000) ),
3700  "%lx: not valid\n", i | 0x80000000 );
3701  break;
3702  default:
3703  ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", i | 0x80000000, awareness );
3704  ok( !pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)(i | 0x80000000) ),
3705  "%lx: valid\n", i | 0x80000000 );
3706  break;
3707  }
3708  awareness = pGetAwarenessFromDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3709  switch (~i)
3710  {
3714  ok( awareness == i, "%lx: wrong value %u\n", ~i, awareness );
3715  ok( pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i ), "%lx: not valid\n", ~i );
3716  break;
3718  if (pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i ))
3719  ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "%lx: wrong value %u\n", ~i, awareness );
3720  else
3721  ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", ~i, awareness );
3722  break;
3724  if (pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i ))
3725  ok( awareness == DPI_AWARENESS_UNAWARE, "%lx: wrong value %u\n", ~i, awareness );
3726  else
3727  ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", ~i, awareness );
3728  break;
3729  default:
3730  ok( awareness == DPI_AWARENESS_INVALID, "%lx: wrong value %u\n", ~i, awareness );
3731  ok( !pIsValidDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i ), "%lx: valid\n", ~i );
3732  break;
3733  }
3734  }
3736  ReleaseDC( 0, hdc );
3737 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define LOGPIXELSX
Definition: wingdi.h:717
Definition: http.c:7098
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
static void test_dpi_stock_objects(HDC hdc)
Definition: sysparams.c:3144
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
Definition: windef.h:295
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 ERROR_ACCESS_DENIED
Definition: compat.h:87
unsigned int BOOL
Definition: ntddk_ex.h:94
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
DPI_AWARENESS
Definition: windef.h:285
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
Definition: windef.h:293
#define todo_wine_if(is_todo)
Definition: test.h:164
#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED
Definition: windef.h:296
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
#define SetLastError(x)
Definition: compat.h:417
GLbitfield flags
Definition: glext.h:7161
int ret
#define todo_wine
Definition: test.h:163
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
static int real_dpi
Definition: sysparams.c:65
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
Definition: windef.h:294
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
#define ULONG_PTR
Definition: config.h:101
#define DPI_AWARENESS_CONTEXT_UNAWARE
Definition: windef.h:292
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2868
static int dpi
Definition: sysparams.c:65
static UINT UINT *static DPI_AWARENESS_CONTEXT(WINAPI *pGetThreadDpiAwarenessContext)(void)

Referenced by START_TEST().

◆ test_dpi_mapping()

static void test_dpi_mapping ( void  )
static

Definition at line 3218 of file sysparams.c.

3219 {
3220  HWND hwnd, child;
3221  HDC hdc;
3222  UINT win_dpi, units;
3223  POINT point;
3224  BOOL ret;
3225  HRGN rgn, update;
3226  RECT rect, orig, client, desktop, expect;
3227  ULONG_PTR i, j, k;
3228  WINDOWPLACEMENT wpl_orig, wpl;
3229  HMONITOR monitor;
3230  MONITORINFO mon_info;
3232 
3233  if (!pLogicalToPhysicalPointForPerMonitorDPI)
3234  {
3235  win_skip( "LogicalToPhysicalPointForPerMonitorDPI not supported\n" );
3236  return;
3237  }
3238  context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3239  GetWindowRect( GetDesktopWindow(), &desktop );
3241  {
3242  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3243  /* test desktop rect */
3245  expect = desktop;
3247  ok( EqualRect( &expect, &rect ), "%lu: wrong desktop rect %s expected %s\n",
3250  ok( EqualRect( &expect, &rect ), "%lu: wrong desktop rect %s expected %s\n",
3253  ok( EqualRect( &expect, &rect ), "%lu: wrong virt desktop rect %s expected %s\n",
3255  SetRect( &rect, 0, 0, 1, 1 );
3256  monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
3257  ok( monitor != 0, "failed to get monitor\n" );
3258  mon_info.cbSize = sizeof(mon_info);
3259  ok( GetMonitorInfoW( monitor, &mon_info ), "GetMonitorInfoExW failed\n" );
3260  ok( EqualRect( &expect, &mon_info.rcMonitor ), "%lu: wrong monitor rect %s expected %s\n",
3262  hdc = CreateDCA( "display", NULL, NULL, NULL );
3264  ok( EqualRect( &expect, &rect ), "%lu: wrong caps desktop rect %s expected %s\n",
3267  ok( EqualRect( &desktop, &rect ), "%lu: wrong caps virt desktop rect %s expected %s\n",
3268  i, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&desktop) );
3269  DeleteDC( hdc );
3270  /* test message window rect */
3271  hwnd = CreateWindowA( "SysParamsTestClass", "test", WS_CHILD,
3272  10, 10, 20, 20, HWND_MESSAGE, 0, GetModuleHandleA(0), NULL );
3274  SetRect( &expect, 0, 0, 100, 100 );
3276  ok( EqualRect( &expect, &rect ), "%lu: wrong message rect %s expected %s\n",
3278  DestroyWindow( hwnd );
3279  }
3281  {
3282  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3283  hwnd = CreateWindowA( "SysParamsTestClass", "test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
3284  193, 177, 295, 303, 0, 0, GetModuleHandleA(0), NULL );
3285  ok( hwnd != 0, "creating window failed err %u\n", GetLastError());
3286  child = CreateWindowA( "SysParamsTestClass", "child", WS_CHILD | WS_VISIBLE,
3287  50, 60, 70, 80, hwnd, 0, GetModuleHandleA(0), NULL );
3288  ok( child != 0, "creating child failed err %u\n", GetLastError());
3289  GetWindowRect( hwnd, &orig );
3290  SetRect( &rect, 0, 0, 0, 0 );
3291  pAdjustWindowRectExForDpi( &rect, WS_OVERLAPPEDWINDOW, FALSE, 0, pGetDpiForWindow( hwnd ));
3292  SetRect( &client, orig.left - rect.left, orig.top - rect.top,
3293  orig.right - rect.right, orig.bottom - rect.bottom );
3296  GetWindowPlacement( hwnd, &wpl_orig );
3298 
3300  {
3301  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3302  /* test window rect */
3303  GetWindowRect( hwnd, &rect );
3304  expect = orig;
3306  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong window rect %s expected %s\n",
3308  /* test client rect */
3309  GetClientRect( hwnd, &rect );
3310  expect = client;
3311  OffsetRect( &expect, -expect.left, -expect.top );
3313  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong client rect %s expected %s\n",
3315  /* test window placement */
3316  GetWindowPlacement( hwnd, &wpl );
3317  point = wpl_orig.ptMinPosition;
3318  if (point.x != -1 || point.y != -1) scale_point_dpi_aware( &point, i, j );
3319  ok( wpl.ptMinPosition.x == point.x && wpl.ptMinPosition.y == point.y,
3320  "%lu/%lu: wrong placement min pos %d,%d expected %d,%d\n", i, j,
3321  wpl.ptMinPosition.x, wpl.ptMinPosition.y, point.x, point.y );
3322  point = wpl_orig.ptMaxPosition;
3323  if (point.x != -1 || point.y != -1) scale_point_dpi_aware( &point, i, j );
3324  ok( wpl.ptMaxPosition.x == point.x && wpl.ptMaxPosition.y == point.y,
3325  "%lu/%lu: wrong placement max pos %d,%d expected %d,%d\n", i, j,
3326  wpl.ptMaxPosition.x, wpl.ptMaxPosition.y, point.x, point.y );
3327  expect = wpl_orig.rcNormalPosition;
3329  ok( EqualRect( &wpl.rcNormalPosition, &expect ),
3330  "%lu/%lu: wrong placement rect %s expect %s\n", i, j,
3332  /* test DC rect */
3333  hdc = GetDC( hwnd );
3334  GetClipBox( hdc, &rect );
3335  SetRect( &expect, 0, 0, client.right - client.left, client.bottom - client.top );
3336  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong clip box %s expected %s\n",
3338  /* test DC resolution */
3340  expect = desktop;
3342  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong DC resolution %s expected %s\n",
3345  ok( EqualRect( &desktop, &rect ), "%lu/%lu: wrong desktop resolution %s expected %s\n",
3346  i, j, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&desktop) );
3347  ReleaseDC( hwnd, hdc );
3348  /* test DC win rect */
3349  hdc = GetWindowDC( hwnd );
3350  GetClipBox( hdc, &rect );
3351  SetRect( &expect, 0, 0, 295, 303 );
3352  todo_wine
3353  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong clip box win DC %s expected %s\n",
3355  ReleaseDC( hwnd, hdc );
3356  /* test window invalidation */
3357  UpdateWindow( hwnd );
3358  update = CreateRectRgn( 0, 0, 0, 0 );
3359  ret = GetUpdateRgn( hwnd, update, FALSE );
3360  ok( ret == NULLREGION, "update region not empty\n" );
3361  rgn = CreateRectRgn( 20, 20, 25, 25 );
3363  {
3364  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~k );
3365  RedrawWindow( hwnd, 0, rgn, RDW_INVALIDATE );
3366  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3367  GetUpdateRgn( hwnd, update, FALSE );
3368  GetRgnBox( update, &rect );
3369  SetRect( &expect, 20, 20, 25, 25 );
3370  ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update region %s expected %s\n",
3372  GetUpdateRect( hwnd, &rect, FALSE );
3374  ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update rect %s expected %s\n",
3376  UpdateWindow( hwnd );
3377  }
3379  {
3380  RedrawWindow( hwnd, 0, rgn, RDW_INVALIDATE );
3381  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~k );
3382  GetUpdateRgn( hwnd, update, FALSE );
3383  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3384  GetRgnBox( update, &rect );
3385  SetRect( &expect, 20, 20, 25, 25 );
3386  ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update region %s expected %s\n",
3388  GetUpdateRect( hwnd, &rect, FALSE );
3390  ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update rect %s expected %s\n",
3392  UpdateWindow( hwnd );
3393  }
3394  /* test desktop window invalidation */
3395  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3396  GetClientRect( hwnd, &rect );
3397  InflateRect( &rect, -50, -50 );
3398  expect = rect;
3399  MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
3400  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3402  GetUpdateRgn( hwnd, update, TRUE );
3403  GetRgnBox( update, &rect );
3405  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong update region %s expected %s\n",
3407  GetUpdateRect( hwnd, &rect, FALSE );
3409  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong update rect %s expected %s\n",
3411  UpdateWindow( hwnd );
3412  DeleteObject( update );
3413  /* test dialog units */
3414  ret = GetDialogBaseUnits();
3415  point.x = LOWORD( units );
3416  point.y = HIWORD( units );
3418  ok( LOWORD(ret) == point.x && HIWORD(ret) == point.y, "%lu/%lu: wrong units %d,%d / %d,%d\n",
3419  i, j, LOWORD(ret), HIWORD(ret), point.x, point.y );
3420  /* test window points mapping */
3421  SetRect( &rect, 0, 0, 100, 100 );
3422  rect.right = rect.left + 100;
3423  rect.bottom = rect.top + 100;
3424  MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
3425  expect = client;
3427  expect.right = expect.left + 100;
3428  expect.bottom = expect.top + 100;
3429  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong MapWindowPoints rect %s expected %s\n",
3431  SetRect( &rect, 50, 60, 70, 80 );
3432  scale_rect_dpi_aware( &rect, i, j );
3433  SetRect( &expect, 40, 30, 60, 80 );
3434  OffsetRect( &expect, -rect.left, -rect.top );
3435  SetRect( &rect, 40, 30, 60, 80 );
3436  MapWindowPoints( hwnd, child, (POINT *)&rect, 2 );
3437  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong MapWindowPoints child rect %s expected %s\n",
3439  /* test logical<->physical coords mapping */
3440  win_dpi = pGetDpiForWindow( hwnd );
3441  if (i == DPI_AWARENESS_UNAWARE)
3442  ok( win_dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", win_dpi );
3443  else if (i == DPI_AWARENESS_SYSTEM_AWARE)
3444  ok( win_dpi == real_dpi, "wrong dpi %u / %u\n", win_dpi, real_dpi );
3445  point.x = 373;
3446  point.y = 377;
3447  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3448  ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3449  ok( point.x == MulDiv( 373, real_dpi, win_dpi ) &&
3450  point.y == MulDiv( 377, real_dpi, win_dpi ),
3451  "%lu/%lu: wrong pos %d,%d dpi %u\n", i, j, point.x, point.y, win_dpi );
3452  point.x = 405;
3453  point.y = 423;
3454  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3455  ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3456  ok( point.x == MulDiv( 405, win_dpi, real_dpi ) &&
3457  point.y == MulDiv( 423, win_dpi, real_dpi ),
3458  "%lu/%lu: wrong pos %d,%d dpi %u\n", i, j, point.x, point.y, win_dpi );
3459  /* point outside the window fails, but note that Windows (wrongly) checks against the
3460  * window rect transformed relative to the thread's awareness */
3461  GetWindowRect( hwnd, &rect );
3462  point.x = rect.left - 1;
3463  point.y = rect.top;
3464  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3465  ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3466  point.x++;
3467  point.y--;
3468  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3469  ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3470  point.y++;
3471  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3472  ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3473  point.x = rect.right;
3474  point.y = rect.bottom + 1;
3475  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3476  ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3477  point.x++;
3478  point.y--;
3479  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3480  ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3481  point.x--;
3482  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3483  ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3484  /* get physical window rect */
3485  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3486  GetWindowRect( hwnd, &rect );
3487  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3488  point.x = rect.left - 1;
3489  point.y = rect.top;
3490  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3491  ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3492  point.x++;
3493  point.y--;
3494  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3495  ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3496  point.y++;
3497  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3498  ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3499  point.x = rect.right;
3500  point.y = rect.bottom + 1;
3501  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3502  ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3503  point.x++;
3504  point.y--;
3505  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3506  ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3507  point.x--;
3508  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3509  ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3510  }
3511  DestroyWindow( hwnd );
3512  }
3513  pSetThreadDpiAwarenessContext( context );
3514 }
#define DESKTOPHORZRES
Definition: wingdi.h:741
#define DESKTOPVERTRES
Definition: wingdi.h:742
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
#define HORZRES
Definition: wingdi.h:715
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define TRUE
Definition: types.h:120
long y
Definition: polytest.cpp:48
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
long x
Definition: polytest.cpp:48
#define SM_CXVIRTUALSCREEN
Definition: winuser.h:1028
Definition: http.c:7098
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
BOOL WINAPI UpdateWindow(_In_ HWND)
#define NULLREGION
Definition: wingdi.h:360
LONG top
Definition: windef.h:307
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define WS_CHILD
Definition: pedump.c:617
#define HWND_MESSAGE
Definition: winuser.h:1196
#define RDW_FRAME
Definition: winuser.h:1198
LONG left
Definition: windef.h:306
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_RESTORE
Definition: winuser.h:773
LONG right
Definition: windef.h:308
RECT rcMonitor
Definition: winuser.h:3760
BOOL WINAPI DestroyWindow(_In_ HWND)
static HWND child
Definition: cursoricon.c:298
POINTL point
Definition: edittest.c:50
& rect
Definition: startmenu.cpp:1413
LONG y
Definition: windef.h:330
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define SM_CXSCREEN
Definition: winuser.h:949
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GA_PARENT
Definition: winuser.h:2763
int WINAPI GetUpdateRgn(_In_ HWND, _In_ HRGN, _In_ BOOL)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
#define SM_CYVIRTUALSCREEN
Definition: winuser.h:1029
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
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define SM_CYSCREEN
Definition: winuser.h:950
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
const char * wine_dbgstr_rect(const RECT *rect)
static FILE * client
Definition: client.c:41
int WINAPI GetSystemMetrics(_In_ int)
LONG x
Definition: windef.h:329
int WINAPI GetClipBox(_In_ HDC, _Out_ LPRECT)
#define SW_MINIMIZE
Definition: winuser.h:770
int ret
#define todo_wine
Definition: test.h:163
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)
static void scale_point_dpi_aware(POINT *pt, DPI_AWARENESS from, DPI_AWARENESS to)
Definition: sysparams.c:3202
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
int WINAPI GetRgnBox(_In_ HRGN, _Out_ LPRECT)
POINT ptMinPosition
Definition: winuser.h:3268
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
static int real_dpi
Definition: sysparams.c:65
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
Definition: windef.h:294
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI DeleteDC(_In_ HDC)
POINT ptMaxPosition
Definition: winuser.h:3269
#define RDW_ALLCHILDREN
Definition: winuser.h:1207
DWORD cbSize
Definition: winuser.h:3759
#define ok(value,...)
Definition: atltest.h:57
#define expect(expected, got)
Definition: combo.c:36
HDC WINAPI GetWindowDC(_In_opt_ HWND)
unsigned int UINT
Definition: ndis.h:50
#define VERTRES
Definition: wingdi.h:716
static void scale_rect_dpi_aware(RECT *rect, DPI_AWARENESS from, DPI_AWARENESS to)
Definition: sysparams.c:3210
RECT rcNormalPosition
Definition: winuser.h:3270
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define HIWORD(l)
Definition: typedefs.h:246
static void scale_rect_dpi(RECT *rect, UINT src_dpi, UINT target_dpi)
Definition: sysparams.c:3194
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2868
GLfloat units
Definition: glext.h:11727
#define WS_VISIBLE
Definition: pedump.c:620
HDC WINAPI CreateDCA(_In_opt_ LPCSTR pszDriver, _In_opt_ LPCSTR pszDevice, _In_opt_ LPCSTR pszOutput, _In_opt_ const DEVMODEA *pdmInit)
static UINT UINT *static DPI_AWARENESS_CONTEXT(WINAPI *pGetThreadDpiAwarenessContext)(void)
#define win_skip
Definition: test.h:150
int k
Definition: mpi.c:3369
#define LOWORD(l)
Definition: pedump.c:82
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define RDW_INVALIDATE
Definition: winuser.h:1200
LONG WINAPI GetDialogBaseUnits(void)
Definition: dialog.c:2146

Referenced by START_TEST().

◆ test_dpi_stock_objects()

static void test_dpi_stock_objects ( HDC  hdc)
static

Definition at line 3144 of file sysparams.c.

3145 {
3147  HGDIOBJ obj[STOCK_LAST + 1], obj2[STOCK_LAST + 1];
3148  LOGFONTW lf, lf2;
3149  UINT i, dpi;
3150 
3151  context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3153  ok( dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", dpi );
3154  ok( !pIsProcessDPIAware(), "not aware\n" );
3155  for (i = 0; i <= STOCK_LAST; i++) obj[i] = GetStockObject( i );
3156 
3157  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
3159  ok( dpi == real_dpi, "wrong dpi %u\n", dpi );
3160  ok( pIsProcessDPIAware(), "not aware\n" );
3161  for (i = 0; i <= STOCK_LAST; i++) obj2[i] = GetStockObject( i );
3162 
3163  for (i = 0; i <= STOCK_LAST; i++)
3164  {
3165  switch (i)
3166  {
3167  case OEM_FIXED_FONT:
3168  case SYSTEM_FIXED_FONT:
3169  ok( obj[i] != obj2[i], "%u: same object\n", i );
3170  break;
3171  case SYSTEM_FONT:
3172  case DEFAULT_GUI_FONT:
3173  ok( obj[i] != obj2[i], "%u: same object\n", i );
3174  GetObjectW( obj[i], sizeof(lf), &lf );
3175  GetObjectW( obj2[i], sizeof(lf2), &lf2 );
3177  "%u: wrong height %d / %d\n", i, lf.lfHeight, lf2.lfHeight );
3178  break;
3179  default:
3180  ok( obj[i] == obj2[i], "%u: different object\n", i );
3181  break;
3182  }
3183  }
3184 
3185  pSetThreadDpiAwarenessContext( context );
3186 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define LOGPIXELSX
Definition: wingdi.h:717
Definition: http.c:7098
LONG lfHeight
Definition: dimm.idl:59
#define OEM_FIXED_FONT
Definition: wingdi.h:909
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 DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
Definition: windef.h:293
#define SYSTEM_FONT
Definition: wingdi.h:910
#define DEFAULT_GUI_FONT
Definition: wingdi.h:908
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
static int real_dpi
Definition: sysparams.c:65
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
#define STOCK_LAST
Definition: wingdi.h:922
#define DPI_AWARENESS_CONTEXT_UNAWARE
Definition: windef.h:292
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2868
static int dpi
Definition: sysparams.c:65
static UINT UINT *static DPI_AWARENESS_CONTEXT(WINAPI *pGetThreadDpiAwarenessContext)(void)
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define SYSTEM_FIXED_FONT
Definition: wingdi.h:911

Referenced by test_dpi_context().

◆ test_dpi_window()

static void test_dpi_window ( void  )
static

Definition at line 3756 of file sysparams.c.

3757 {
3759  DPI_AWARENESS awareness;
3760  ULONG_PTR i, j;
3761  UINT dpi;
3762  HWND hwnd, child, ret;
3763  MSG msg = { 0, WM_USER + 1, 0, 0 };
3764 
3765  if (!pGetWindowDpiAwarenessContext)
3766  {
3767  win_skip( "GetWindowDpiAwarenessContext not supported\n" );
3768  return;
3769  }
3770  orig = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3772  {
3773  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3774  hwnd = CreateWindowA( "DpiTestClass", "Test",
3775  WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL );
3776  ok( hwnd != 0, "failed to create window\n" );
3777  context = pGetWindowDpiAwarenessContext( hwnd );
3778  awareness = pGetAwarenessFromDpiAwarenessContext( context );
3779  ok( awareness == i, "%lu: wrong awareness %u\n", i, awareness );
3780  dpi = pGetDpiForWindow( hwnd );
3782  "%lu: got %u / %u\n", i, dpi, real_dpi );
3783  if (pGetDpiForMonitorInternal)
3784  {
3785  BOOL res;
3786  SetLastError( 0xdeadbeef );
3787  res = pGetDpiForMonitorInternal( MonitorFromWindow( hwnd, 0 ), 0, &dpi, NULL );
3788  ok( !res, "succeeded\n" );
3789  ok( GetLastError() == ERROR_INVALID_ADDRESS, "wrong error %u\n", GetLastError() );
3790  SetLastError( 0xdeadbeef );
3791  res = pGetDpiForMonitorInternal( MonitorFromWindow( hwnd, 0 ), 3, &