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

Go to the source code of this file.

Classes

struct  LOGFONT16
 

Macros

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

Typedefs

typedef struct LOGFONT16LPLOGFONT16
 

Functions

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

Variables

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

Macro Definition Documentation

◆ eq

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

Definition at line 61 of file sysparams.c.

◆ ok_gsm

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

Definition at line 2648 of file sysparams.c.

◆ ok_gsm_2

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

Definition at line 2655 of file sysparams.c.

◆ ok_gsm_3

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

Definition at line 2663 of file sysparams.c.

◆ SPI_CAPTIONFONT_VALNAME

#define SPI_CAPTIONFONT_VALNAME   "CaptionFont"

Definition at line 79 of file sysparams.c.

◆ SPI_CAPTIONHEIGHT_VALNAME

#define SPI_CAPTIONHEIGHT_VALNAME   "CaptionHeight"

Definition at line 78 of file sysparams.c.

◆ SPI_CAPTIONWIDTH_VALNAME

#define SPI_CAPTIONWIDTH_VALNAME   "CaptionWidth"

Definition at line 77 of file sysparams.c.

◆ SPI_GETDESKWALLPAPER

#define SPI_GETDESKWALLPAPER   0x0073

Definition at line 34 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_REGKEY

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

Definition at line 91 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_REGKEY2

#define SPI_ICONHORIZONTALSPACING_REGKEY2   "Control Panel\\Desktop"

Definition at line 92 of file sysparams.c.

◆ SPI_ICONHORIZONTALSPACING_VALNAME

#define SPI_ICONHORIZONTALSPACING_VALNAME   "IconSpacing"

Definition at line 93 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_REGKEY

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

Definition at line 94 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_REGKEY2

#define SPI_ICONVERTICALSPACING_REGKEY2   "Control Panel\\Desktop"

Definition at line 95 of file sysparams.c.

◆ SPI_ICONVERTICALSPACING_VALNAME

#define SPI_ICONVERTICALSPACING_VALNAME   "IconVerticalSpacing"

Definition at line 96 of file sysparams.c.

◆ SPI_MENUFONT_VALNAME

#define SPI_MENUFONT_VALNAME   "MenuFont"

Definition at line 85 of file sysparams.c.

◆ SPI_MENUHEIGHT_VALNAME

#define SPI_MENUHEIGHT_VALNAME   "MenuHeight"

Definition at line 84 of file sysparams.c.

◆ SPI_MENUWIDTH_VALNAME

#define SPI_MENUWIDTH_VALNAME   "MenuWidth"

Definition at line 83 of file sysparams.c.

◆ SPI_MESSAGEFONT_VALNAME

#define SPI_MESSAGEFONT_VALNAME   "MessageFont"

Definition at line 87 of file sysparams.c.

◆ SPI_METRIC_REGKEY

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

Definition at line 74 of file sysparams.c.

◆ SPI_MINARRANGE_VALNAME

#define SPI_MINARRANGE_VALNAME   "MinArrange"

Definition at line 101 of file sysparams.c.

◆ SPI_MINHORZGAP_VALNAME

#define SPI_MINHORZGAP_VALNAME   "MinHorzGap"

Definition at line 99 of file sysparams.c.

◆ SPI_MINIMIZEDMETRICS_REGKEY

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

Definition at line 97 of file sysparams.c.

◆ SPI_MINVERTGAP_VALNAME

#define SPI_MINVERTGAP_VALNAME   "MinVertGap"

Definition at line 100 of file sysparams.c.

◆ SPI_MINWIDTH_VALNAME

#define SPI_MINWIDTH_VALNAME   "MinWidth"

Definition at line 98 of file sysparams.c.

◆ SPI_SCROLLHEIGHT_VALNAME

#define SPI_SCROLLHEIGHT_VALNAME   "ScrollHeight"

Definition at line 76 of file sysparams.c.

◆ SPI_SCROLLWIDTH_VALNAME

#define SPI_SCROLLWIDTH_VALNAME   "ScrollWidth"

Definition at line 75 of file sysparams.c.

◆ SPI_SETBEEP_REGKEY

#define SPI_SETBEEP_REGKEY   "Control Panel\\Sound"

Definition at line 65 of file sysparams.c.

◆ SPI_SETBEEP_VALNAME

#define SPI_SETBEEP_VALNAME   "Beep"

Definition at line 66 of file sysparams.c.

◆ SPI_SETBORDER_REGKEY

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

Definition at line 71 of file sysparams.c.

◆ SPI_SETBORDER_REGKEY2

#define SPI_SETBORDER_REGKEY2   "Control Panel\\Desktop"

Definition at line 72 of file sysparams.c.

◆ SPI_SETBORDER_VALNAME

#define SPI_SETBORDER_VALNAME   "BorderWidth"

Definition at line 73 of file sysparams.c.

◆ SPI_SETDESKWALLPAPER_REGKEY

#define SPI_SETDESKWALLPAPER_REGKEY   "Control Panel\\Desktop"

Definition at line 163 of file sysparams.c.

◆ SPI_SETDESKWALLPAPER_VALNAME

#define SPI_SETDESKWALLPAPER_VALNAME   "Wallpaper"

Definition at line 164 of file sysparams.c.

◆ SPI_SETDOUBLECLICKTIME_REGKEY

#define SPI_SETDOUBLECLICKTIME_REGKEY   "Control Panel\\Mouse"

Definition at line 122 of file sysparams.c.

◆ SPI_SETDOUBLECLICKTIME_VALNAME

#define SPI_SETDOUBLECLICKTIME_VALNAME   "DoubleClickSpeed"

Definition at line 123 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_REGKEY1

#define SPI_SETDOUBLECLKHEIGHT_REGKEY1   "Control Panel\\Mouse"

Definition at line 119 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_REGKEY2

#define SPI_SETDOUBLECLKHEIGHT_REGKEY2   "Control Panel\\Desktop"

Definition at line 120 of file sysparams.c.

◆ SPI_SETDOUBLECLKHEIGHT_VALNAME

#define SPI_SETDOUBLECLKHEIGHT_VALNAME   "DoubleClickHeight"

Definition at line 121 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_REGKEY1

#define SPI_SETDOUBLECLKWIDTH_REGKEY1   "Control Panel\\Mouse"

Definition at line 116 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_REGKEY2

#define SPI_SETDOUBLECLKWIDTH_REGKEY2   "Control Panel\\Desktop"

Definition at line 117 of file sysparams.c.

◆ SPI_SETDOUBLECLKWIDTH_VALNAME

#define SPI_SETDOUBLECLKWIDTH_VALNAME   "DoubleClickWidth"

Definition at line 118 of file sysparams.c.

◆ SPI_SETDRAGFULLWINDOWS_REGKEY

#define SPI_SETDRAGFULLWINDOWS_REGKEY   "Control Panel\\Desktop"

Definition at line 147 of file sysparams.c.

◆ SPI_SETDRAGFULLWINDOWS_VALNAME

#define SPI_SETDRAGFULLWINDOWS_VALNAME   "DragFullWindows"

Definition at line 148 of file sysparams.c.

◆ SPI_SETFONTSMOOTHING_REGKEY

#define SPI_SETFONTSMOOTHING_REGKEY   "Control Panel\\Desktop"

Definition at line 138 of file sysparams.c.

◆ SPI_SETFONTSMOOTHING_VALNAME

#define SPI_SETFONTSMOOTHING_VALNAME   "FontSmoothing"

Definition at line 139 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGCONTRAST_VALNAME

#define SPI_SETFONTSMOOTHINGCONTRAST_VALNAME   "FontSmoothingGamma"

Definition at line 141 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGORIENTATION_VALNAME

#define SPI_SETFONTSMOOTHINGORIENTATION_VALNAME   "FontSmoothingOrientation"

Definition at line 142 of file sysparams.c.

◆ SPI_SETFONTSMOOTHINGTYPE_VALNAME

#define SPI_SETFONTSMOOTHINGTYPE_VALNAME   "FontSmoothingType"

Definition at line 140 of file sysparams.c.

◆ SPI_SETGRIDGRANULARITY_REGKEY

#define SPI_SETGRIDGRANULARITY_REGKEY   "Control Panel\\Desktop"

Definition at line 106 of file sysparams.c.

◆ SPI_SETGRIDGRANULARITY_VALNAME

#define SPI_SETGRIDGRANULARITY_VALNAME   "GridGranularity"

Definition at line 107 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_REGKEY1

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

Definition at line 110 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_REGKEY2

#define SPI_SETICONTITLEWRAP_REGKEY2   "Control Panel\\Desktop"

Definition at line 111 of file sysparams.c.

◆ SPI_SETICONTITLEWRAP_VALNAME

#define SPI_SETICONTITLEWRAP_VALNAME   "IconTitleWrap"

Definition at line 112 of file sysparams.c.

◆ SPI_SETKEYBOARDDELAY_REGKEY

#define SPI_SETKEYBOARDDELAY_REGKEY   "Control Panel\\Keyboard"

Definition at line 108 of file sysparams.c.

◆ SPI_SETKEYBOARDDELAY_VALNAME

#define SPI_SETKEYBOARDDELAY_VALNAME   "KeyboardDelay"

Definition at line 109 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_REGKEY

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

Definition at line 130 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_REGKEY_LEGACY

#define SPI_SETKEYBOARDPREF_REGKEY_LEGACY   "Control Panel\\Accessibility"

Definition at line 132 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_VALNAME

#define SPI_SETKEYBOARDPREF_VALNAME   "On"

Definition at line 131 of file sysparams.c.

◆ SPI_SETKEYBOARDPREF_VALNAME_LEGACY

#define SPI_SETKEYBOARDPREF_VALNAME_LEGACY   "Keyboard Preference"

Definition at line 133 of file sysparams.c.

◆ SPI_SETKEYBOARDSPEED_REGKEY

#define SPI_SETKEYBOARDSPEED_REGKEY   "Control Panel\\Keyboard"

Definition at line 89 of file sysparams.c.

◆ SPI_SETKEYBOARDSPEED_VALNAME

#define SPI_SETKEYBOARDSPEED_VALNAME   "KeyboardSpeed"

Definition at line 90 of file sysparams.c.

◆ SPI_SETLOWPOWERACTIVE_REGKEY

#define SPI_SETLOWPOWERACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 143 of file sysparams.c.

◆ SPI_SETLOWPOWERACTIVE_VALNAME

#define SPI_SETLOWPOWERACTIVE_VALNAME   "LowPowerActive"

Definition at line 144 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_REGKEY1

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

Definition at line 113 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_REGKEY2

#define SPI_SETMENUDROPALIGNMENT_REGKEY2   "Control Panel\\Desktop"

Definition at line 114 of file sysparams.c.

◆ SPI_SETMENUDROPALIGNMENT_VALNAME

#define SPI_SETMENUDROPALIGNMENT_VALNAME   "MenuDropAlignment"

Definition at line 115 of file sysparams.c.

◆ SPI_SETMENUSHOWDELAY_REGKEY

#define SPI_SETMENUSHOWDELAY_REGKEY   "Control Panel\\Desktop"

Definition at line 161 of file sysparams.c.

◆ SPI_SETMENUSHOWDELAY_VALNAME

#define SPI_SETMENUSHOWDELAY_VALNAME   "MenuShowDelay"

Definition at line 162 of file sysparams.c.

◆ SPI_SETMOUSE_REGKEY

#define SPI_SETMOUSE_REGKEY   "Control Panel\\Mouse"

Definition at line 67 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME1

#define SPI_SETMOUSE_VALNAME1   "MouseThreshold1"

Definition at line 68 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME2

#define SPI_SETMOUSE_VALNAME2   "MouseThreshold2"

Definition at line 69 of file sysparams.c.

◆ SPI_SETMOUSE_VALNAME3

#define SPI_SETMOUSE_VALNAME3   "MouseSpeed"

Definition at line 70 of file sysparams.c.

◆ SPI_SETMOUSEBUTTONSWAP_REGKEY

#define SPI_SETMOUSEBUTTONSWAP_REGKEY   "Control Panel\\Mouse"

Definition at line 124 of file sysparams.c.

◆ SPI_SETMOUSEBUTTONSWAP_VALNAME

#define SPI_SETMOUSEBUTTONSWAP_VALNAME   "SwapMouseButtons"

Definition at line 125 of file sysparams.c.

◆ SPI_SETMOUSEHOVERHEIGHT_REGKEY

#define SPI_SETMOUSEHOVERHEIGHT_REGKEY   "Control Panel\\Mouse"

Definition at line 153 of file sysparams.c.

◆ SPI_SETMOUSEHOVERHEIGHT_VALNAME

#define SPI_SETMOUSEHOVERHEIGHT_VALNAME   "MouseHoverHeight"

Definition at line 154 of file sysparams.c.

◆ SPI_SETMOUSEHOVERTIME_REGKEY

#define SPI_SETMOUSEHOVERTIME_REGKEY   "Control Panel\\Mouse"

Definition at line 155 of file sysparams.c.

◆ SPI_SETMOUSEHOVERTIME_VALNAME

#define SPI_SETMOUSEHOVERTIME_VALNAME   "MouseHoverTime"

Definition at line 156 of file sysparams.c.

◆ SPI_SETMOUSEHOVERWIDTH_REGKEY

#define SPI_SETMOUSEHOVERWIDTH_REGKEY   "Control Panel\\Mouse"

Definition at line 151 of file sysparams.c.

◆ SPI_SETMOUSEHOVERWIDTH_VALNAME

#define SPI_SETMOUSEHOVERWIDTH_VALNAME   "MouseHoverWidth"

Definition at line 152 of file sysparams.c.

◆ SPI_SETMOUSESCROLLCHARS_REGKEY

#define SPI_SETMOUSESCROLLCHARS_REGKEY   "Control Panel\\Desktop"

Definition at line 157 of file sysparams.c.

◆ SPI_SETMOUSESCROLLCHARS_VALNAME

#define SPI_SETMOUSESCROLLCHARS_VALNAME   "WheelScrollChars"

Definition at line 158 of file sysparams.c.

◆ SPI_SETMOUSESCROLLLINES_REGKEY

#define SPI_SETMOUSESCROLLLINES_REGKEY   "Control Panel\\Desktop"

Definition at line 159 of file sysparams.c.

◆ SPI_SETMOUSESCROLLLINES_VALNAME

#define SPI_SETMOUSESCROLLLINES_VALNAME   "WheelScrollLines"

Definition at line 160 of file sysparams.c.

◆ SPI_SETPOWEROFFACTIVE_REGKEY

#define SPI_SETPOWEROFFACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 145 of file sysparams.c.

◆ SPI_SETPOWEROFFACTIVE_VALNAME

#define SPI_SETPOWEROFFACTIVE_VALNAME   "PowerOffActive"

Definition at line 146 of file sysparams.c.

◆ SPI_SETSCREENREADER_REGKEY

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

Definition at line 134 of file sysparams.c.

◆ SPI_SETSCREENREADER_REGKEY_LEGACY

#define SPI_SETSCREENREADER_REGKEY_LEGACY   "Control Panel\\Accessibility"

Definition at line 136 of file sysparams.c.

◆ SPI_SETSCREENREADER_VALNAME

#define SPI_SETSCREENREADER_VALNAME   "On"

Definition at line 135 of file sysparams.c.

◆ SPI_SETSCREENREADER_VALNAME_LEGACY

#define SPI_SETSCREENREADER_VALNAME_LEGACY   "Blind Access"

Definition at line 137 of file sysparams.c.

◆ SPI_SETSCREENSAVEACTIVE_REGKEY

#define SPI_SETSCREENSAVEACTIVE_REGKEY   "Control Panel\\Desktop"

Definition at line 104 of file sysparams.c.

◆ SPI_SETSCREENSAVEACTIVE_VALNAME

#define SPI_SETSCREENSAVEACTIVE_VALNAME   "ScreenSaveActive"

Definition at line 105 of file sysparams.c.

◆ SPI_SETSCREENSAVETIMEOUT_REGKEY

#define SPI_SETSCREENSAVETIMEOUT_REGKEY   "Control Panel\\Desktop"

Definition at line 102 of file sysparams.c.

◆ SPI_SETSCREENSAVETIMEOUT_VALNAME

#define SPI_SETSCREENSAVETIMEOUT_VALNAME   "ScreenSaveTimeOut"

Definition at line 103 of file sysparams.c.

◆ SPI_SETSHOWSOUNDS_REGKEY

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

Definition at line 128 of file sysparams.c.

◆ SPI_SETSHOWSOUNDS_VALNAME

#define SPI_SETSHOWSOUNDS_VALNAME   "On"

Definition at line 129 of file sysparams.c.

◆ SPI_SETSNAPTODEFBUTTON_REGKEY

#define SPI_SETSNAPTODEFBUTTON_REGKEY   "Control Panel\\Mouse"

Definition at line 149 of file sysparams.c.

◆ SPI_SETSNAPTODEFBUTTON_VALNAME

#define SPI_SETSNAPTODEFBUTTON_VALNAME   "SnapToDefaultButton"

Definition at line 150 of file sysparams.c.

◆ SPI_SETWORKAREA_REGKEY

#define SPI_SETWORKAREA_REGKEY   "Control Panel\\Desktop"

Definition at line 126 of file sysparams.c.

◆ SPI_SETWORKAREA_VALNAME

#define SPI_SETWORKAREA_VALNAME   "WINE_WorkArea"

Definition at line 127 of file sysparams.c.

◆ SPI_SMCAPTIONFONT_VALNAME

#define SPI_SMCAPTIONFONT_VALNAME   "SmCaptionFont"

Definition at line 82 of file sysparams.c.

◆ SPI_SMCAPTIONHEIGHT_VALNAME

#define SPI_SMCAPTIONHEIGHT_VALNAME   "SmCaptionHeight"

Definition at line 81 of file sysparams.c.

◆ SPI_SMCAPTIONWIDTH_VALNAME

#define SPI_SMCAPTIONWIDTH_VALNAME   "SmCaptionWidth"

Definition at line 80 of file sysparams.c.

◆ SPI_STATUSFONT_VALNAME

#define SPI_STATUSFONT_VALNAME   "StatusFont"

Definition at line 86 of file sysparams.c.

◆ TEST_NONCLIENTMETRICS_REG

#define TEST_NONCLIENTMETRICS_REG (   ncm)
Value:
do { \
/*FIXME: test_reg_metric2( SPI_SETBORDER_REGKEY2, SPI_SETBORDER_REGKEY, SPI_SETBORDER_VALNAME, (ncm).iBorderWidth);*/\
test_reg_metric( SPI_METRIC_REGKEY, SPI_SCROLLWIDTH_VALNAME, (ncm).iScrollWidth);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_SCROLLHEIGHT_VALNAME, (ncm).iScrollHeight);\
/*FIXME: test_reg_metric( SPI_METRIC_REGKEY, SPI_CAPTIONWIDTH_VALNAME, (ncm).iCaptionWidth);*/\
test_reg_metric( SPI_METRIC_REGKEY, SPI_CAPTIONHEIGHT_VALNAME, (ncm).iCaptionHeight);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_SMCAPTIONWIDTH_VALNAME, (ncm).iSmCaptionWidth);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_SMCAPTIONHEIGHT_VALNAME, (ncm).iSmCaptionHeight);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_MENUWIDTH_VALNAME, (ncm).iMenuWidth);\
test_reg_metric( SPI_METRIC_REGKEY, SPI_MENUHEIGHT_VALNAME, (ncm).iMenuHeight);\
test_reg_font( SPI_METRIC_REGKEY, SPI_MENUFONT_VALNAME, (ncm).lfMenuFont);\
test_reg_font( SPI_METRIC_REGKEY, SPI_CAPTIONFONT_VALNAME, (ncm).lfCaptionFont);\
test_reg_font( SPI_METRIC_REGKEY, SPI_SMCAPTIONFONT_VALNAME, (ncm).lfSmCaptionFont);\
test_reg_font( SPI_METRIC_REGKEY, SPI_STATUSFONT_VALNAME, (ncm).lfStatusFont);\
test_reg_font( SPI_METRIC_REGKEY, SPI_MESSAGEFONT_VALNAME, (ncm).lfMessageFont); } while(0)
#define SPI_CAPTIONHEIGHT_VALNAME
Definition: sysparams.c:78
#define SPI_MESSAGEFONT_VALNAME
Definition: sysparams.c:87
#define SPI_MENUHEIGHT_VALNAME
Definition: sysparams.c:84
#define SPI_SCROLLWIDTH_VALNAME
Definition: sysparams.c:75
#define SPI_STATUSFONT_VALNAME
Definition: sysparams.c:86
#define SPI_METRIC_REGKEY
Definition: sysparams.c:74
#define SPI_SCROLLHEIGHT_VALNAME
Definition: sysparams.c:76
#define SPI_MENUFONT_VALNAME
Definition: sysparams.c:85
#define SPI_SMCAPTIONWIDTH_VALNAME
Definition: sysparams.c:80
#define SPI_SMCAPTIONFONT_VALNAME
Definition: sysparams.c:82
#define SPI_MENUWIDTH_VALNAME
Definition: sysparams.c:83
#define SPI_CAPTIONFONT_VALNAME
Definition: sysparams.c:79
#define SPI_SMCAPTIONHEIGHT_VALNAME
Definition: sysparams.c:81

Definition at line 1450 of file sysparams.c.

◆ test_reg_font

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

Definition at line 1439 of file sysparams.c.

◆ test_reg_key

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

Definition at line 461 of file sysparams.c.

◆ test_reg_key_dword

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

Definition at line 471 of file sysparams.c.

◆ test_reg_key_ex

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

Definition at line 465 of file sysparams.c.

◆ test_reg_key_ex2

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

Definition at line 467 of file sysparams.c.

◆ test_reg_key_ex2_optional

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

Definition at line 469 of file sysparams.c.

◆ test_reg_key_optional

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

Definition at line 463 of file sysparams.c.

◆ test_reg_metric

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

Definition at line 1426 of file sysparams.c.

◆ test_reg_metric2

#define test_reg_metric2 (   KEY1,
  KEY2,
  VAL,
  val 
)
Value:
do { \
INT regval;\
regval = metricfromreg( KEY1, VAL, dpi);\
if( regval != val) regval = metricfromreg( KEY2, VAL, dpi);\
ok( regval==val, "wrong value \"%s\" in registry %d, expected %d\n", VAL, regval, val);\
} while(0)
#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:476
static int dpi
Definition: sysparams.c:59

Definition at line 1432 of file sysparams.c.

◆ WINE_CURRENT_USER_REGKEY

#define WINE_CURRENT_USER_REGKEY   "Wine"

Definition at line 167 of file sysparams.c.

Typedef Documentation

◆ LPLOGFONT16

Function Documentation

◆ _GdiGetCharDimensions()

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

Definition at line 2608 of file sysparams.c.

2609 {
2610  SIZE sz;
2611  static const CHAR alphabet[] = {
2612  'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
2613  'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
2614  'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
2615 
2616  if(lptm && !GetTextMetricsA(hdc, lptm)) return 0;
2617 
2618  if(!GetTextExtentPointA(hdc, alphabet, 52, &sz)) return 0;
2619 
2620  if (height) *height = sz.cy;
2621  return (sz.cx / 26 + 1) / 2;
2622 }
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 325 of file sysparams.c.

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

2919 {
2920  ok_(__FILE__,line)( lf1->lfHeight == MulDiv( lf2->lfHeight, dpi, custom_dpi ),
2921  "wrong lfHeight %d vs %d\n", lf1->lfHeight, lf2->lfHeight );
2922  ok_(__FILE__,line)( abs( lf1->lfWidth - MulDiv( lf2->lfWidth, dpi, custom_dpi )) <= 1,
2923  "wrong lfWidth %d vs %d\n", lf1->lfWidth, lf2->lfWidth );
2924  ok_(__FILE__,line)( !memcmp( &lf1->lfEscapement, &lf2->lfEscapement,
2925  offsetof( LOGFONTW, lfFaceName ) - offsetof( LOGFONTW, lfEscapement )),
2926  "font differs\n" );
2927  ok_(__FILE__,line)( !lstrcmpW( lf1->lfFaceName, lf2->lfFaceName ), "wrong face name %s vs %s\n",
2929 }
#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:59
#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 900 of file sysparams.c.

901 {
902  BOOL rc;
903  INT spacing, regval, min_val = MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI );
904  ICONMETRICSA im;
905 
908  if (!test_error_msg(rc,"SPI_ICONHORIZONTALSPACING")) return FALSE;
909  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
911  curr_val = max( curr_val, min_val );
912  /* The registry keys depend on the Windows version and the values too
913  * let's test (works on win95,ME,NT4,2k,XP)
914  */
916  if( regval != curr_val)
918  ok( curr_val == regval,
919  "wrong value in registry %d, expected %d\n", regval, curr_val);
920  /* compare with what SPI_ICONHORIZONTALSPACING returns */
921  rc=SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0, &spacing, 0 );
922  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
923  eq( spacing, curr_val, "ICONHORIZONTALSPACING", "%d");
924  /* and with a system metrics */
925  eq( GetSystemMetrics( SM_CXICONSPACING ), curr_val, "SM_CXICONSPACING", "%d" );
926  /* and with what SPI_GETICONMETRICS returns */
927  im.cbSize = sizeof(ICONMETRICSA);
928  rc=SystemParametersInfoA( SPI_GETICONMETRICS, sizeof(ICONMETRICSA), &im, FALSE );
929  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
930  eq( im.iHorzSpacing, curr_val, "SPI_GETICONMETRICS", "%d" );
931  return TRUE;
932 }
#define 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:92
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void test_change_message(int action, int optional)
Definition: sysparams.c:279
int32_t INT
Definition: typedefs.h:57
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:91
int WINAPI GetSystemMetrics(_In_ int)
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:293
#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:476
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2868
static int dpi
Definition: sysparams.c:59
#define eq(received, expected, label, type)
Definition: sysparams.c:61
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
#define SPI_ICONHORIZONTALSPACING_VALNAME
Definition: sysparams.c:93

Referenced by test_SPI_ICONHORIZONTALSPACING().

◆ dotest_spi_iconverticalspacing()

static BOOL dotest_spi_iconverticalspacing ( INT  curr_val)
static

Definition at line 1069 of file sysparams.c.

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

Referenced by test_SPI_ICONVERTICALSPACING().

◆ DPI_AWARENESS()

static DPI_AWARENESS ( WINAPI pGetAwarenessFromDpiAwarenessContext)
static

◆ DPI_AWARENESS_CONTEXT()

static DPI_AWARENESS_CONTEXT ( WINAPI pGetThreadDpiAwarenessContext)
static

◆ dpi_winproc()

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

Definition at line 3733 of file sysparams.c.

3734 {
3735  DPI_AWARENESS_CONTEXT ctx = pGetWindowDpiAwarenessContext( hwnd );
3736  DPI_AWARENESS_CONTEXT ctx2 = pGetThreadDpiAwarenessContext();
3737  DWORD pos, pos2;
3738 
3739  ok( pGetAwarenessFromDpiAwarenessContext( ctx ) == pGetAwarenessFromDpiAwarenessContext( ctx2 ),
3740  "msg %04x wrong awareness %p / %p\n", msg, ctx, ctx2 );
3741  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE );
3742  pos = GetMessagePos();
3743  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3744  pos2 = GetMessagePos();
3745  ok( pos == pos2, "wrong pos %08x / %08x\n", pos, pos2 );
3746  pSetThreadDpiAwarenessContext( ctx2 );
3747  return DefWindowProcA( hwnd, msg, wp, lp );
3748 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
DWORD WINAPI GetMessagePos(void)
Definition: message.c:1351
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 2673 of file sysparams.c.

2674 {
2675  return lstrcmpiA(elf->lfFaceName, (const char *)lparam);
2676 }
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 2690 of file sysparams.c.

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

Referenced by test_GetSystemMetrics().

◆ get_real_dpi()

static DWORD get_real_dpi ( void  )
static

Definition at line 200 of file sysparams.c.

201 {
202  DWORD dpi;
203 
204  if (pSetThreadDpiAwarenessContext)
205  {
206  DPI_AWARENESS_CONTEXT context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_SYSTEM_AWARE );
207  dpi = pGetDpiForSystem();
208  pSetThreadDpiAwarenessContext( context );
209  return dpi;
210  }
211  if (get_reg_dword(HKEY_CURRENT_USER, "Control Panel\\Desktop", "LogPixels", &dpi))
212  return dpi;
213  if (get_reg_dword(HKEY_CURRENT_CONFIG, "Software\\Fonts", "LogPixels", &dpi))
214  return dpi;
216 }
Definition: http.c:7094
#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:181
#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:59
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 181 of file sysparams.c.

182 {
183  HKEY key;
184  DWORD type, data, size = sizeof(data);
185  BOOL ret = FALSE;
186 
188  {
189  if (RegQueryValueExA(key, value_name, NULL, &type, (void *)&data, &size) == ERROR_SUCCESS &&
190  type == REG_DWORD)
191  {
192  *value = data;
193  ret = TRUE;
194  }
195  RegCloseKey(key);
196  }
197  return ret;
198 }
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 2626 of file sysparams.c.

2627 {
2628  HFONT hfont, hfontsav;
2629  TEXTMETRICA tm;
2630  if( !ptm) ptm = &tm;
2631  hfont = CreateFontIndirectA( plf);
2632  if( !hfont || ( hfontsav = SelectObject( hdc, hfont)) == NULL ) {
2633  ptm->tmHeight = -1;
2634  if( psz) *psz = 10;
2635  if( hfont) DeleteObject( hfont);
2636  return;
2637  }
2638  GetTextMetricsA( hdc, ptm);
2639  if( psz)
2640  if( !(*psz = _GdiGetCharDimensions( hdc, ptm, NULL)))
2641  *psz = 10;
2642  SelectObject( hdc, hfontsav);
2643  DeleteObject( hfont);
2644 }
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:2608
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 1467 of file sysparams.c.

1468 {
1469  TEXTMETRICA tm;
1470  HDC hdc = GetDC(0);
1472  hfont = SelectObject( hdc, hfont);
1473  GetTextMetricsA( hdc, &tm);
1474  hfont = SelectObject( hdc, hfont);
1475  ReleaseDC( 0, hdc );
1476  return tm.tmHeight + (flag ? tm.tmExternalLeading : 0);
1477 }
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 1479 of file sysparams.c.

1480 {
1481  TEXTMETRICW tm;
1482  HDC hdc = GetDC(0);
1484  hfont = SelectObject( hdc, hfont);
1485  GetTextMetricsW( hdc, &tm);
1486  hfont = SelectObject( hdc, hfont);
1487  ReleaseDC( 0, hdc );
1488  return tm.tmHeight + (flag ? tm.tmExternalLeading : 0);
1489 }
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 2678 of file sysparams.c.

2679 {
2680  HDC hdc = CreateCompatibleDC(0);
2681  BOOL ret = FALSE;
2682 
2684  ret = TRUE;
2685 
2686  DeleteDC(hdc);
2687  return ret;
2688 }
#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:2673
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 514 of file sysparams.c.

515 {
516  HKEY hkey;
517  LOGFONTW lfw;
518  DWORD ret, size, type;
519 
520  RegOpenKeyA( HKEY_CURRENT_USER, keyname, &hkey );
521  size = sizeof( lfw);
522  ret=RegQueryValueExA( hkey, valname, NULL, &type, (LPBYTE)&lfw, &size );
523  RegCloseKey( hkey );
524  ok( ret == ERROR_SUCCESS, "Key \"%s\" value \"%s\" not found\n", keyname, valname);
525  if( ret != ERROR_SUCCESS)
526  return FALSE;
527  if( size <= sizeof( LOGFONT16)) {
528  LOGFONT16 *plf16 = (LOGFONT16*) &lfw;
529  plf->lfHeight = plf16->lfHeight;
530  plf->lfWidth = plf16->lfWidth;
531  plf->lfEscapement = plf16->lfEscapement;
532  plf->lfOrientation = plf16->lfOrientation;
533  plf->lfWeight = plf16->lfWeight;
534  plf->lfItalic = plf16->lfItalic;
535  plf->lfUnderline = plf16->lfUnderline;
536  plf->lfStrikeOut = plf16->lfStrikeOut;
537  plf->lfCharSet = plf16->lfCharSet;
538  plf->lfOutPrecision = plf16->lfOutPrecision;
539  plf->lfClipPrecision = plf16->lfClipPrecision;
540  plf->lfQuality = plf16->lfQuality;
541  plf->lfPitchAndFamily = plf16->lfPitchAndFamily;
542  memcpy( plf->lfFaceName, plf16->lfFaceName, LF_FACESIZE );
543  } else if( size <= sizeof( LOGFONTA)) {
544  plf = (LOGFONTA*) &lfw;
545  } else {
546  plf->lfHeight = lfw.lfHeight;
547  plf->lfWidth = lfw.lfWidth;
548  plf->lfEscapement = lfw.lfEscapement;
549  plf->lfOrientation = lfw.lfOrientation;
550  plf->lfWeight = lfw.lfWeight;
551  plf->lfItalic = lfw.lfItalic;
552  plf->lfUnderline = lfw.lfUnderline;
553  plf->lfStrikeOut = lfw.lfStrikeOut;
554  plf->lfCharSet = lfw.lfCharSet;
555  plf->lfOutPrecision = lfw.lfOutPrecision;
556  plf->lfClipPrecision = lfw.lfClipPrecision;
557  plf->lfQuality = lfw.lfQuality;
559  WideCharToMultiByte( CP_ACP, 0, lfw.lfFaceName, -1, plf->lfFaceName,
560  LF_FACESIZE, NULL, NULL);
561 
562  }
563  return TRUE;
564 }
BYTE lfItalic
Definition: dimm.idl:47
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
INT16 lfEscapement
Definition: sysparams.c:499
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:503
#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:506
CHAR lfFaceName[LF_FACESIZE]
Definition: sysparams.c:510
INT16 lfWidth
Definition: sysparams.c:498
BYTE lfOutPrecision
Definition: dimm.idl:51
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
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:504
BYTE lfOutPrecision
Definition: dimm.idl:68
BYTE lfClipPrecision
Definition: sysparams.c:507
GLsizeiptr size
Definition: glext.h:5919
INT16 lfWeight
Definition: sysparams.c:501
unsigned long DWORD
Definition: ntddk_ex.h:95
BYTE lfQuality
Definition: sysparams.c:508
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:500
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfClipPrecision
Definition: dimm.idl:52
#define ok(value,...)
Definition: atltest.h:57
BYTE lfPitchAndFamily
Definition: sysparams.c:509
BYTE lfItalic
Definition: dimm.idl:64
BYTE lfItalic
Definition: sysparams.c:502
INT16 lfHeight
Definition: sysparams.c:497
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:505
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 476 of file sysparams.c.

477 {
478  HKEY hkey;
479  char buf[64];
480  DWORD ret;
481  DWORD size, type;
482  int value;
483 
484  RegOpenKeyA( HKEY_CURRENT_USER, keyname, &hkey );
485  size = sizeof(buf);
486  ret=RegQueryValueExA( hkey, valname, NULL, &type, (LPBYTE)buf, &size );
487  RegCloseKey( hkey );
488  if( ret != ERROR_SUCCESS) return -1;
489  value = atoi( buf);
490  if( value < 0)
491  value = ( -value * dpi + 720) / 1440;
492  return value;
493 }
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:53
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:59

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

◆ run_spi_setmouse_test()

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

Definition at line 635 of file sysparams.c.

636 {
637  BOOL rc;
638  INT mi[3];
639  static int aw_turn = 0;
640 
641  char buf[20];
642  int i;
643 
644  aw_turn++;
645  rc = FALSE;
646  SetLastError(0xdeadbeef);
647  if (aw_turn % 2) /* call unicode on odd (non even) calls */
649  else
651  if (!test_error_msg(rc,"SPI_SETMOUSE")) return FALSE;
652 
653  ok(rc, "SystemParametersInfo: rc=%d err=%d\n", rc, GetLastError());
655  for (i = 0; i < 3; i++)
656  {
657  sprintf( buf, "%d", curr_val[i] );
659  }
660 
662  ok(rc, "SystemParametersInfoA: rc=%d err=%d\n", rc, GetLastError());
663  for (i = 0; i < 3; i++)
664  {
665  ok(mi[i] == curr_val[i],
666  "incorrect value for %d: %d != %d\n", i, mi[i], curr_val[i]);
667  }
668 
670  ok(rc, "SystemParametersInfoW: rc=%d err=%d\n", rc, GetLastError());
671  for (i = 0; i < 3; i++)
672  {
673  ok(mi[i] == curr_val[i],
674  "incorrect value for %d: %d != %d\n", i, mi[i], curr_val[i]);
675  }
676 
677  if (0)
678  {
679  /* FIXME: this always fails for me - AJ */
680  for (i = 0; i < nchange; i++)
681  {
682  POINT mv;
684  mouse_event( MOUSEEVENTF_MOVE, req_change[i].x, req_change[i].y, 0, 0 );
685  GetCursorPos( &mv );
686  ok( proj_change[i].x == mv.x, "Projected dx and real dx comparison. May fail under high load.\n" );
687  ok( proj_change[i].y == mv.y, "Projected dy equals real dy. May fail under high load.\n" );
688  }
689  }
690  return TRUE;
691 }
#define 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:67
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:279
int32_t INT
Definition: typedefs.h:57
#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:461
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:418
static BOOL test_error_msg(int rc, const char *name)
Definition: sysparams.c:293
#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:626

Referenced by test_SPI_SETMOUSE().

◆ scale_point_dpi()

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

Definition at line 3182 of file sysparams.c.

3183 {
3184  pt->x = MulDiv( pt->x, target_dpi, src_dpi );
3185  pt->y = MulDiv( pt->y, target_dpi, src_dpi );
3186 }
#define pt(x, y)
Definition: drawing.c:79
#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 3196 of file sysparams.c.

3197 {
3200  else if (from != DPI_AWARENESS_UNAWARE && to == DPI_AWARENESS_UNAWARE)
3202 }
#define pt(x, y)
Definition: drawing.c:79
static void scale_point_dpi(POINT *pt, UINT src_dpi, UINT target_dpi)
Definition: sysparams.c:3182
static int real_dpi
Definition: sysparams.c:59
#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 3188 of file sysparams.c.

3189 {
3190  rect->left = MulDiv( rect->left, target_dpi, src_dpi );
3191  rect->top = MulDiv( rect->top, target_dpi, src_dpi );
3192  rect->right = MulDiv( rect->right, target_dpi, src_dpi );
3193  rect->bottom = MulDiv( rect->bottom, target_dpi, src_dpi );
3194 }
& rect
Definition: startmenu.cpp:1413
#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 3204 of file sysparams.c.

3205 {
3208  else if (from != DPI_AWARENESS_UNAWARE && to == DPI_AWARENESS_UNAWARE)
3210 }
& rect
Definition: startmenu.cpp:1413
static int real_dpi
Definition: sysparams.c:59
static void scale_rect_dpi(RECT *rect, UINT src_dpi, UINT target_dpi)
Definition: sysparams.c:3188
#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 3892 of file sysparams.c.

3893 {
3894  int argc;
3895  char** argv;
3896  WNDCLASSA wc;
3897  MSG msg;
3898  HDC hdc;
3899  HANDLE hThread;
3900  DWORD dwThreadId;
3902 
3903  hdll = GetModuleHandleA("user32.dll");
3904  pChangeDisplaySettingsExA = (void*)GetProcAddress(hdll, "ChangeDisplaySettingsExA");
3905  pIsProcessDPIAware = (void*)GetProcAddress(hdll, "IsProcessDPIAware");
3906  pSetProcessDPIAware = (void*)GetProcAddress(hdll, "SetProcessDPIAware");
3907  pGetDpiForSystem = (void*)GetProcAddress(hdll, "GetDpiForSystem");
3908  pGetDpiForWindow = (void*)GetProcAddress(hdll, "GetDpiForWindow");
3909  pGetDpiForMonitorInternal = (void*)GetProcAddress(hdll, "GetDpiForMonitorInternal");
3910  pSetProcessDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetProcessDpiAwarenessContext");
3911  pGetProcessDpiAwarenessInternal = (void*)GetProcAddress(hdll, "GetProcessDpiAwarenessInternal");
3912  pSetProcessDpiAwarenessInternal = (void*)GetProcAddress(hdll, "SetProcessDpiAwarenessInternal");
3913  pGetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetThreadDpiAwarenessContext");
3914  pSetThreadDpiAwarenessContext = (void*)GetProcAddress(hdll, "SetThreadDpiAwarenessContext");
3915  pGetWindowDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetWindowDpiAwarenessContext");
3916  pGetAwarenessFromDpiAwarenessContext = (void*)GetProcAddress(hdll, "GetAwarenessFromDpiAwarenessContext");
3917  pIsValidDpiAwarenessContext = (void*)GetProcAddress(hdll, "IsValidDpiAwarenessContext");
3918  pGetSystemMetricsForDpi = (void*)GetProcAddress(hdll, "GetSystemMetricsForDpi");
3919  pSystemParametersInfoForDpi = (void*)GetProcAddress(hdll, "SystemParametersInfoForDpi");
3920  pAdjustWindowRectExForDpi = (void*)GetProcAddress(hdll, "AdjustWindowRectExForDpi");
3921  pLogicalToPhysicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "LogicalToPhysicalPointForPerMonitorDPI");
3922  pPhysicalToLogicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "PhysicalToLogicalPointForPerMonitorDPI");
3923  pGetAutoRotationState = (void*)GetProcAddress(hdll, "GetAutoRotationState");
3924 
3926  hdc = GetDC(0);
3928  real_dpi = get_real_dpi();
3929  trace("dpi %d real_dpi %d\n", dpi, real_dpi);
3930  ReleaseDC( 0, hdc);
3931 
3932  /* This test requires interactivity, if we don't have it, give up */
3935 
3937  strict=(argc >= 3 && strcmp(argv[2],"strict")==0);
3938  trace("strict=%d\n",strict);
3939 
3940  trace("testing GetSystemMetrics with your current desktop settings\n");
3942  test_metrics_for_dpi( 192 );
3946 
3947  change_counter = 0;
3948  change_last_param = 0;
3949 
3950  wc.lpszClassName = "SysParamsTestClass";
3953  wc.hInstance = hInstance;
3954  wc.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION );
3955  wc.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW );
3956  wc.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
3957  wc.lpszMenuName = 0;
3958  wc.cbClsExtra = 0;
3959  wc.cbWndExtra = 0;
3960  RegisterClassA( &wc );
3961  wc.lpszClassName = "DpiTestClass";
3962  wc.lpfnWndProc = dpi_winproc;
3963  RegisterClassA( &wc );
3964 
3965  ghTestWnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application",
3966  WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, hInstance, NULL );
3967 
3969  assert( hThread );
3970  CloseHandle( hThread );
3971 
3972  while( GetMessageA( &msg, 0, 0, 0 )) {
3973  TranslateMessage( &msg );
3974  DispatchMessageA( &msg );
3975  }
3976 
3977  if (pSetThreadDpiAwarenessContext)
3978  {
3979  test_dpi_context();
3980  test_dpi_mapping();
3981  test_dpi_window();
3982  }
3983  else win_skip( "SetThreadDpiAwarenessContext not supported\n" );
3984 
3985  test_dpi_aware();
3986 }
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:407
static DWORD get_real_dpi(void)
Definition: sysparams.c:200
static void test_EnumDisplaySettings(void)
Definition: sysparams.c:3077
HDC WINAPI GetDC(_In_opt_ HWND)
static void test_GetAutoRotationState(void)
Definition: sysparams.c:3871
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static void test_dpi_context(void)
Definition: sysparams.c:3532
static HDC
Definition: imagelist.c:92
static int change_last_param
Definition: sysparams.c:176
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:3750
#define IDI_APPLICATION
Definition: winuser.h:699
static void test_GetSysColorBrush(void)
Definition: sysparams.c:3117
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:169
#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:2698
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:218
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:3212
static DWORD WINAPI SysParamsThreadFunc(LPVOID lpParam)
Definition: sysparams.c:2550
int winetest_get_mainargs(char ***pargv)
static BOOL strict
Definition: sysparams.c:58
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:812
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:174
#define SPIF_UPDATEINIFILE
Definition: winuser.h:1553
static int real_dpi
Definition: sysparams.c:59
HINSTANCE hInstance
Definition: winuser.h:3142
static LRESULT CALLBACK dpi_winproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: sysparams.c:3733
#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:2931
#define GetProcAddress(x, y)
Definition: compat.h:419
#define LOGPIXELSY
Definition: wingdi.h:718
static int dpi
Definition: sysparams.c:59
#define win_skip
Definition: test.h:149
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
static void test_dpi_aware(void)
Definition: sysparams.c:3510
HICON hIcon
Definition: winuser.h:3143

◆ SysParamsTestWndProc()

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

Definition at line 218 of file sysparams.c.

220 {
221  switch (msg) {
222 
223  case WM_DISPLAYCHANGE:
224  ok(displaychange_ok, "Unexpected WM_DISPLAYCHANGE message\n");
225  last_bpp = wParam;
228  break;
229 
230  case WM_SETTINGCHANGE:
231  if (change_counter>0) {
232  /* ignore these messages caused by resizing of toolbars */
233  if( wParam == SPI_SETWORKAREA){
235  break;
236  } else if( wParam == SPI_ICONVERTICALSPACING) {
238  break;
239  } else if( displaychange_test_active)
240  break;
241  if( !change_last_param){
243  break;
244  }
245  ok(0,"too many changes counter=%d last change=%d\n",
247  change_counter++;
249  break;
250  }
251  change_counter++;
253  if( wParam == SPI_SETWORKAREA)
255  else if( wParam == SPI_ICONVERTICALSPACING)
257  else
259  break;
260 
261  case WM_DESTROY:
262  PostQuitMessage( 0 );
263  break;
264 
265  /* drop through */
266  default:
267  return( DefWindowProcA( hWnd, msg, wParam, lParam ) );
268  }
269 
270  return 0;
271 }
static int change_setworkarea_param
Definition: sysparams.c:175
static int last_bpp
Definition: sysparams.c:177
static int change_last_param
Definition: sysparams.c:176
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:178
#define WM_DESTROY
Definition: winuser.h:1591
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
static HANDLE displaychange_sem
Definition: sysparams.c:179
static int change_iconverticalspacing_param
Definition: sysparams.c:175
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static int change_counter
Definition: sysparams.c:174
#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:178

Referenced by START_TEST().

◆ SysParamsThreadFunc()

static DWORD WINAPI SysParamsThreadFunc ( LPVOID  lpParam)
static

Definition at line 2550 of file sysparams.c.

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

Referenced by START_TEST().

◆ test_change_message()

static void test_change_message ( int  action,
int  optional 
)
static

Definition at line 279 of file sysparams.c.

280 {
281  if (change_counter==0 && optional==1)
282  return;
283  ok( 1 == change_counter,
284  "Missed a message: change_counter=%d\n", change_counter );
285  change_counter = 0;
287  ( change_setworkarea_param && action == SPI_SETWORKAREA) ||
289  "Wrong action got %d expected %d\n", change_last_param, action );
290  change_last_param = 0;
291 }
static int change_setworkarea_param
Definition: sysparams.c:175
static int change_last_param
Definition: sysparams.c:176
Definition: msg.h:41
#define SPI_ICONVERTICALSPACING
Definition: winuser.h:1355
static int change_iconverticalspacing_param
Definition: sysparams.c:175
static int change_counter
Definition: sysparams.c:174
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 3510 of file sysparams.c.

3511 {
3512  BOOL ret;
3513 
3514  if (!pIsProcessDPIAware)
3515  {
3516  win_skip("IsProcessDPIAware not available\n");
3517  return;
3518  }
3519 
3520  ret = pSetProcessDPIAware();
3521  ok(ret, "got %d\n", ret);
3522 
3523  ret = pIsProcessDPIAware();
3524  ok(ret, "got %d\n", ret);
3525 
3526  dpi = real_dpi;
3528  test_metrics_for_dpi( 96 );
3529  test_metrics_for_dpi( 192 );
3530 }
unsigned int BOOL
Definition: ntddk_ex.h:94
static void test_GetSystemMetrics(void)
Definition: sysparams.c:2698
int ret
static int real_dpi
Definition: sysparams.c:59
#define ok(value,...)
Definition: atltest.h:57
static void test_metrics_for_dpi(int custom_dpi)
Definition: sysparams.c:2931
static int dpi
Definition: sysparams.c:59
#define win_skip
Definition: test.h:149

Referenced by START_TEST().

◆ test_dpi_context()

static void test_dpi_context ( void  )
static

Definition at line 3532 of file sysparams.c.

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

3213 {
3214  HWND hwnd, child;
3215  HDC hdc;
3216  UINT win_dpi, units;
3217  POINT point;
3218  BOOL ret;
3219  HRGN rgn, update;
3220  RECT rect, orig, client, desktop, expect;
3221  ULONG_PTR i, j, k;
3222  WINDOWPLACEMENT wpl_orig, wpl;
3223  HMONITOR monitor;
3224  MONITORINFO mon_info;
3226 
3227  if (!pLogicalToPhysicalPointForPerMonitorDPI)
3228  {
3229  win_skip( "LogicalToPhysicalPointForPerMonitorDPI not supported\n" );
3230  return;
3231  }
3232  context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3233  GetWindowRect( GetDesktopWindow(), &desktop );
3235  {
3236  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3237  /* test desktop rect */
3239  expect = desktop;
3241  ok( EqualRect( &expect, &rect ), "%lu: wrong desktop rect %s expected %s\n",
3244  ok( EqualRect( &expect, &rect ), "%lu: wrong desktop rect %s expected %s\n",
3247  ok( EqualRect( &expect, &rect ), "%lu: wrong virt desktop rect %s expected %s\n",
3249  SetRect( &rect, 0, 0, 1, 1 );
3250  monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
3251  ok( monitor != 0, "failed to get monitor\n" );
3252  mon_info.cbSize = sizeof(mon_info);
3253  ok( GetMonitorInfoW( monitor, &mon_info ), "GetMonitorInfoExW failed\n" );
3254  ok( EqualRect( &expect, &mon_info.rcMonitor ), "%lu: wrong monitor rect %s expected %s\n",
3256  hdc = CreateDCA( "display", NULL, NULL, NULL );
3258  ok( EqualRect( &expect, &rect ), "%lu: wrong caps desktop rect %s expected %s\n",
3261  ok( EqualRect( &desktop, &rect ), "%lu: wrong caps virt desktop rect %s expected %s\n",
3262  i, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&desktop) );
3263  DeleteDC( hdc );
3264  /* test message window rect */
3265  hwnd = CreateWindowA( "SysParamsTestClass", "test", WS_CHILD,
3266  10, 10, 20, 20, HWND_MESSAGE, 0, GetModuleHandleA(0), NULL );
3268  SetRect( &expect, 0, 0, 100, 100 );
3270  ok( EqualRect( &expect, &rect ), "%lu: wrong message rect %s expected %s\n",
3272  DestroyWindow( hwnd );
3273  }
3275  {
3276  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~i );
3277  hwnd = CreateWindowA( "SysParamsTestClass", "test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
3278  193, 177, 295, 303, 0, 0, GetModuleHandleA(0), NULL );
3279  ok( hwnd != 0, "creating window failed err %u\n", GetLastError());
3280  child = CreateWindowA( "SysParamsTestClass", "child", WS_CHILD | WS_VISIBLE,
3281  50, 60, 70, 80, hwnd, 0, GetModuleHandleA(0), NULL );
3282  ok( child != 0, "creating child failed err %u\n", GetLastError());
3283  GetWindowRect( hwnd, &orig );
3284  SetRect( &rect, 0, 0, 0, 0 );
3285  pAdjustWindowRectExForDpi( &rect, WS_OVERLAPPEDWINDOW, FALSE, 0, pGetDpiForWindow( hwnd ));
3286  SetRect( &client, orig.left - rect.left, orig.top - rect.top,
3287  orig.right - rect.right, orig.bottom - rect.bottom );
3290  GetWindowPlacement( hwnd, &wpl_orig );
3292 
3294  {
3295  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3296  /* test window rect */
3297  GetWindowRect( hwnd, &rect );
3298  expect = orig;
3300  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong window rect %s expected %s\n",
3302  /* test client rect */
3303  GetClientRect( hwnd, &rect );
3304  expect = client;
3305  OffsetRect( &expect, -expect.left, -expect.top );
3307  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong client rect %s expected %s\n",
3309  /* test window placement */
3310  GetWindowPlacement( hwnd, &wpl );
3311  point = wpl_orig.ptMinPosition;
3312  if (point.x != -1 || point.y != -1) scale_point_dpi_aware( &point, i, j );
3313  ok( wpl.ptMinPosition.x == point.x && wpl.ptMinPosition.y == point.y,
3314  "%lu/%lu: wrong placement min pos %d,%d expected %d,%d\n", i, j,
3315  wpl.ptMinPosition.x, wpl.ptMinPosition.y, point.x, point.y );
3316  point = wpl_orig.ptMaxPosition;
3317  if (point.x != -1 || point.y != -1) scale_point_dpi_aware( &point, i, j );
3318  ok( wpl.ptMaxPosition.x == point.x && wpl.ptMaxPosition.y == point.y,
3319  "%lu/%lu: wrong placement max pos %d,%d expected %d,%d\n", i, j,
3320  wpl.ptMaxPosition.x, wpl.ptMaxPosition.y, point.x, point.y );
3321  expect = wpl_orig.rcNormalPosition;
3323  ok( EqualRect( &wpl.rcNormalPosition, &expect ),
3324  "%lu/%lu: wrong placement rect %s expect %s\n", i, j,
3326  /* test DC rect */
3327  hdc = GetDC( hwnd );
3328  GetClipBox( hdc, &rect );
3329  SetRect( &expect, 0, 0, client.right - client.left, client.bottom - client.top );
3330  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong clip box %s expected %s\n",
3332  /* test DC resolution */
3334  expect = desktop;
3336  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong DC resolution %s expected %s\n",
3339  ok( EqualRect( &desktop, &rect ), "%lu/%lu: wrong desktop resolution %s expected %s\n",
3340  i, j, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&desktop) );
3341  ReleaseDC( hwnd, hdc );
3342  /* test DC win rect */
3343  hdc = GetWindowDC( hwnd );
3344  GetClipBox( hdc, &rect );
3345  SetRect( &expect, 0, 0, 295, 303 );
3346  todo_wine
3347  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong clip box win DC %s expected %s\n",
3349  ReleaseDC( hwnd, hdc );
3350  /* test window invalidation */
3351  UpdateWindow( hwnd );
3352  update = CreateRectRgn( 0, 0, 0, 0 );
3353  ret = GetUpdateRgn( hwnd, update, FALSE );
3354  ok( ret == NULLREGION, "update region not empty\n" );
3355  rgn = CreateRectRgn( 20, 20, 25, 25 );
3357  {
3358  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~k );
3359  RedrawWindow( hwnd, 0, rgn, RDW_INVALIDATE );
3360  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3361  GetUpdateRgn( hwnd, update, FALSE );
3362  GetRgnBox( update, &rect );
3363  SetRect( &expect, 20, 20, 25, 25 );
3364  ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update region %s expected %s\n",
3366  GetUpdateRect( hwnd, &rect, FALSE );
3368  ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update rect %s expected %s\n",
3370  UpdateWindow( hwnd );
3371  }
3373  {
3374  RedrawWindow( hwnd, 0, rgn, RDW_INVALIDATE );
3375  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~k );
3376  GetUpdateRgn( hwnd, update, FALSE );
3377  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3378  GetRgnBox( update, &rect );
3379  SetRect( &expect, 20, 20, 25, 25 );
3380  ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update region %s expected %s\n",
3382  GetUpdateRect( hwnd, &rect, FALSE );
3384  ok( EqualRect( &expect, &rect ), "%lu/%lu/%lu: wrong update rect %s expected %s\n",
3386  UpdateWindow( hwnd );
3387  }
3388  /* test desktop window invalidation */
3389  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3390  GetClientRect( hwnd, &rect );
3391  InflateRect( &rect, -50, -50 );
3392  expect = rect;
3393  MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
3394  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3396  GetUpdateRgn( hwnd, update, TRUE );
3397  GetRgnBox( update, &rect );
3399  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong update region %s expected %s\n",
3401  GetUpdateRect( hwnd, &rect, FALSE );
3403  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong update rect %s expected %s\n",
3405  UpdateWindow( hwnd );
3406  DeleteObject( update );
3407  /* test dialog units */
3408  ret = GetDialogBaseUnits();
3409  point.x = LOWORD( units );
3410  point.y = HIWORD( units );
3412  ok( LOWORD(ret) == point.x && HIWORD(ret) == point.y, "%lu/%lu: wrong units %d,%d / %d,%d\n",
3413  i, j, LOWORD(ret), HIWORD(ret), point.x, point.y );
3414  /* test window points mapping */
3415  SetRect( &rect, 0, 0, 100, 100 );
3416  rect.right = rect.left + 100;
3417  rect.bottom = rect.top + 100;
3418  MapWindowPoints( hwnd, 0, (POINT *)&rect, 2 );
3419  expect = client;
3421  expect.right = expect.left + 100;
3422  expect.bottom = expect.top + 100;
3423  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong MapWindowPoints rect %s expected %s\n",
3425  SetRect( &rect, 50, 60, 70, 80 );
3426  scale_rect_dpi_aware( &rect, i, j );
3427  SetRect( &expect, 40, 30, 60, 80 );
3428  OffsetRect( &expect, -rect.left, -rect.top );
3429  SetRect( &rect, 40, 30, 60, 80 );
3430  MapWindowPoints( hwnd, child, (POINT *)&rect, 2 );
3431  ok( EqualRect( &expect, &rect ), "%lu/%lu: wrong MapWindowPoints child rect %s expected %s\n",
3433  /* test logical<->physical coords mapping */
3434  win_dpi = pGetDpiForWindow( hwnd );
3435  if (i == DPI_AWARENESS_UNAWARE)
3436  ok( win_dpi == USER_DEFAULT_SCREEN_DPI, "wrong dpi %u\n", win_dpi );
3437  else if (i == DPI_AWARENESS_SYSTEM_AWARE)
3438  ok( win_dpi == real_dpi, "wrong dpi %u / %u\n", win_dpi, real_dpi );
3439  point.x = 373;
3440  point.y = 377;
3441  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3442  ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3443  ok( point.x == MulDiv( 373, real_dpi, win_dpi ) &&
3444  point.y == MulDiv( 377, real_dpi, win_dpi ),
3445  "%lu/%lu: wrong pos %d,%d dpi %u\n", i, j, point.x, point.y, win_dpi );
3446  point.x = 405;
3447  point.y = 423;
3448  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3449  ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3450  ok( point.x == MulDiv( 405, win_dpi, real_dpi ) &&
3451  point.y == MulDiv( 423, win_dpi, real_dpi ),
3452  "%lu/%lu: wrong pos %d,%d dpi %u\n", i, j, point.x, point.y, win_dpi );
3453  /* point outside the window fails, but note that Windows (wrongly) checks against the
3454  * window rect transformed relative to the thread's awareness */
3455  GetWindowRect( hwnd, &rect );
3456  point.x = rect.left - 1;
3457  point.y = rect.top;
3458  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3459  ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3460  point.x++;
3461  point.y--;
3462  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3463  ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3464  point.y++;
3465  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3466  ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3467  point.x = rect.right;
3468  point.y = rect.bottom + 1;
3469  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3470  ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3471  point.x++;
3472  point.y--;
3473  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3474  ok( !ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI succeeded\n", i, j );
3475  point.x--;
3476  ret = pLogicalToPhysicalPointForPerMonitorDPI( hwnd, &point );
3477  ok( ret, "%lu/%lu: LogicalToPhysicalPointForPerMonitorDPI failed\n", i, j );
3478  /* get physical window rect */
3479  pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
3480  GetWindowRect( hwnd, &rect );
3481  pSetThreadDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~j );
3482  point.x = rect.left - 1;
3483  point.y = rect.top;
3484  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3485  ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3486  point.x++;
3487  point.y--;
3488  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3489  ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3490  point.y++;
3491  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3492  ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3493  point.x = rect.right;
3494  point.y = rect.bottom + 1;
3495  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3496  ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3497  point.x++;
3498  point.y--;
3499  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3500  ok( !ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI succeeded\n", i, j );
3501  point.x--;
3502  ret = pPhysicalToLogicalPointForPerMonitorDPI( hwnd, &point );
3503  ok( ret, "%lu/%lu: PhysicalToLogicalPointForPerMonitorDPI failed\n", i, j );
3504  }
3505  DestroyWindow( hwnd );
3506  }
3507  pSetThreadDpiAwarenessContext( context );
3508 }
#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:7094
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:64
#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:656
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:162
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:3196
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
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:59
#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:3204
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:3188
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:149
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:2152

Referenced by START_TEST().

◆ test_dpi_stock_objects()

static void test_dpi_stock_objects ( HDC  hdc)
static

Definition at line 3138 of file sysparams.c.

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

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