ReactOS 0.4.16-dev-340-g0540c21
monitor.c File Reference
#include "wine/test.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include <stdio.h>
Include dependency graph for monitor.c:

Go to the source code of this file.

Classes

struct  vid_mode
 

Macros

#define GET_PROC(func)
 

Functions

static LONG (WINAPI *pChangeDisplaySettingsExA)(LPCSTR
 
static BOOL (WINAPI *pEnumDisplayDevicesA)(LPCSTR
 
static HMONITOR (WINAPI *pMonitorFromPoint)(POINT
 
static UINT32 UINT32 *static void init_function_pointers (void)
 
static BOOL CALLBACK monitor_enum_proc (HMONITOR hmon, HDC hdc, LPRECT lprc, LPARAM lparam)
 
static void test_enumdisplaydevices_adapter (int index, const DISPLAY_DEVICEA *device, DWORD flags)
 
static void test_enumdisplaydevices_monitor (int adapter_index, int monitor_index, const char *adapter_name, const DISPLAY_DEVICEA *device, DWORD flags)
 
static void test_enumdisplaydevices (void)
 
static void test_ChangeDisplaySettingsEx (void)
 
static void test_monitors (void)
 
static BOOL CALLBACK find_primary_mon (HMONITOR hmon, HDC hdc, LPRECT rc, LPARAM lp)
 
static void test_work_area (void)
 
static void test_display_config (void)
 
 START_TEST (monitor)
 

Variables

static HMODULE hdll
 
static LPDEVMODEA
 
static HWND
 
static DWORD
 
static LPVOID
 
static LPDEVMODEW
 
static LPDISPLAY_DEVICEA
 
static LPRECT
 
static MONITORENUMPROC
 
static LPARAM
 
static LPMONITORINFO
 
static int adapter_count = 0
 
static int monitor_count = 0
 
static const struct vid_mode vid_modes_test []
 

Macro Definition Documentation

◆ GET_PROC

#define GET_PROC (   func)
Value:
p ## func = (void*)GetProcAddress(hdll, #func); \
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
#define GetProcAddress(x, y)
Definition: compat.h:753
GLenum func
Definition: glext.h:6028
GLfloat GLfloat p
Definition: glext.h:8902
static HMODULE hdll
Definition: monitor.c:29

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pEnumDisplayDevicesA)
static

◆ find_primary_mon()

static BOOL CALLBACK find_primary_mon ( HMONITOR  hmon,
HDC  hdc,
LPRECT  rc,
LPARAM  lp 
)
static

Definition at line 614 of file monitor.c.

615{
617 BOOL ret;
618
619 mi.cbSize = sizeof(mi);
620 ret = pGetMonitorInfoA(hmon, &mi);
621 ok(ret, "GetMonitorInfo failed\n");
622 if (mi.dwFlags & MONITORINFOF_PRIMARY)
623 {
624 *(HMONITOR *)lp = hmon;
625 return FALSE;
626 }
627 return TRUE;
628}
#define ok(value,...)
Definition: atltest.h:57
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static HANDLE hmon
Definition: localmon.c:41
DWORD dwFlags
Definition: winuser.h:3790
DWORD cbSize
Definition: winuser.h:3787
int ret
static MONITORINFO mi
Definition: win.c:7338

Referenced by test_work_area().

◆ HMONITOR()

static HMONITOR ( WINAPI pMonitorFromPoint)
static

◆ init_function_pointers()

static UINT32 UINT32 *static void init_function_pointers ( void  )
static

Definition at line 41 of file monitor.c.

42{
43 hdll = GetModuleHandleA("user32.dll");
44
45#define GET_PROC(func) \
46 p ## func = (void*)GetProcAddress(hdll, #func); \
47 if(!p ## func) \
48 trace("GetProcAddress(%s) failed\n", #func);
49
54 GET_PROC(GetDisplayConfigBufferSizes)
60
61#undef GET_PROC
62}
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define GET_PROC(func)
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR lpszDeviceName, LPDEVMODEW lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam)
Definition: display.c:585
BOOL WINAPI EnumDisplayDevicesA(LPCSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEA lpDisplayDevice, DWORD dwFlags)
Definition: display.c:23
LONG WINAPI ChangeDisplaySettingsExA(LPCSTR lpszDeviceName, LPDEVMODEA lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam)
Definition: display.c:521
BOOL WINAPI EnumDisplayMonitors(_In_opt_ HDC, _In_opt_ LPCRECT, _In_ MONITORENUMPROC, _In_ LPARAM)
BOOL WINAPI GetMonitorInfoA(_In_ HMONITOR, _Inout_ LPMONITORINFO)
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)

Referenced by START_TEST().

◆ LONG()

static LONG ( WINAPI pChangeDisplaySettingsExA)
static

◆ monitor_enum_proc()

static BOOL CALLBACK monitor_enum_proc ( HMONITOR  hmon,
HDC  hdc,
LPRECT  lprc,
LPARAM  lparam 
)
static

Definition at line 64 of file monitor.c.

66{
68 char *primary = (char *)lparam;
69
70 mi.cbSize = sizeof(mi);
71
72 ok(pGetMonitorInfoA(hmon, (MONITORINFO*)&mi), "GetMonitorInfo failed\n");
73 if (mi.dwFlags & MONITORINFOF_PRIMARY)
74 strcpy(primary, mi.szDevice);
75
76 return TRUE;
77}
@ lparam
Definition: SystemMenu.c:31
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by test_enumdisplaydevices().

◆ START_TEST()

START_TEST ( monitor  )

Definition at line 745 of file monitor.c.

746{
753}
static void test_enumdisplaydevices(void)
Definition: monitor.c:216
static void test_ChangeDisplaySettingsEx(void)
Definition: monitor.c:308
static UINT32 UINT32 *static void init_function_pointers(void)
Definition: monitor.c:41
static void test_monitors(void)
Definition: monitor.c:450
static void test_display_config(void)
Definition: monitor.c:693
static void test_work_area(void)
Definition: monitor.c:630

◆ test_ChangeDisplaySettingsEx()

static void test_ChangeDisplaySettingsEx ( void  )
static

Definition at line 308 of file monitor.c.

309{
310 DEVMODEA dm;
311 DEVMODEW dmW;
312 DWORD width;
313 LONG res;
314 int i;
315
316 if (!pChangeDisplaySettingsExA)
317 {
318 win_skip("ChangeDisplaySettingsExA is not available\n");
319 return;
320 }
321
322 SetLastError(0xdeadbeef);
324 ok(res, "EnumDisplaySettings error %u\n", GetLastError());
325
326 width = dm.dmPelsWidth;
327
328 dm.dmDriverExtra = 1;
331 "ChangeDisplaySettingsA returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
332 ok(dm.dmDriverExtra == 0 || broken(dm.dmDriverExtra == 1) /* win9x */,
333 "ChangeDisplaySettingsA didn't reset dmDriverExtra to 0\n");
334
335 /* crashes under XP SP3 for large dmDriverExtra values */
336 dm.dmDriverExtra = 1;
337 res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
339 "ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
340 ok(dm.dmDriverExtra == 1, "ChangeDisplaySettingsExA shouldn't reset dmDriverExtra to 0\n");
341
342 memset(&dmW, 0, sizeof(dmW));
343 dmW.dmSize = sizeof(dmW);
345 dmW.dmPelsWidth = dm.dmPelsWidth;
346 dmW.dmPelsHeight = dm.dmPelsHeight;
347 dmW.dmDriverExtra = 1;
348 SetLastError(0xdeadbeef);
351 {
353 "ChangeDisplaySettingsW returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
354 ok(dmW.dmDriverExtra == 0, "ChangeDisplaySettingsW didn't reset dmDriverExtra to 0\n");
355 }
356
357 /* Apparently XP treats dmDriverExtra being != 0 as an error */
358 dmW.dmDriverExtra = 1;
359 res = pChangeDisplaySettingsExW(NULL, &dmW, NULL, CDS_TEST, NULL);
361 {
363 "ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res);
364 ok(dmW.dmDriverExtra == 1, "ChangeDisplaySettingsExW shouldn't reset dmDriverExtra to 0\n");
365 }
366
367 /* the following 2 tests show that dm.dmSize being 0 is invalid, but
368 * ChangeDisplaySettingsExA still reports success.
369 */
370 memset(&dm, 0, sizeof(dm));
372 dm.dmPelsWidth = width;
373 res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
375 res == DISP_CHANGE_BADMODE || /* Win98, WinMe */
376 res == DISP_CHANGE_FAILED, /* NT4 */
377 "ChangeDisplaySettingsExA returned unexpected %d\n", res);
378
379 memset(&dmW, 0, sizeof(dmW));
381 dmW.dmPelsWidth = width;
382 SetLastError(0xdeadbeef);
383 res = pChangeDisplaySettingsExW(NULL, &dmW, NULL, CDS_TEST, NULL);
386 res == DISP_CHANGE_BADPARAM || /* NT4 */
387 res == DISP_CHANGE_BADMODE /* XP SP3 */,
388 "ChangeDisplaySettingsExW returned %d\n", res);
389
390 memset(&dm, 0, sizeof(dm));
391 dm.dmSize = sizeof(dm);
392
393 for (i = 0; i < ARRAY_SIZE(vid_modes_test); i++)
394 {
397 dm.dmBitsPerPel = vid_modes_test[i].bpp;
399 dm.dmFields = vid_modes_test[i].fields;
400 res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL);
401 ok(vid_modes_test[i].must_succeed ?
405 "Unexpected ChangeDisplaySettingsEx() return code for resolution[%d]: %d\n", i, res);
406
408 {
409 RECT r, r1, virt;
410
412 if (IsRectEmpty(&virt)) /* NT4 doesn't have SM_CX/YVIRTUALSCREEN */
415
416 /* Resolution change resets clip rect */
417 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
418 ok(EqualRect(&r, &virt), "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
419
420 if (!ClipCursor(NULL)) continue;
421 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
422 ok(EqualRect(&r, &virt), "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
423
424 /* This should always work. Primary monitor is at (0,0) */
425 SetRect(&r1, 10, 10, 20, 20);
426 ok(ClipCursor(&r1), "ClipCursor() failed\n");
427 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
428 ok(EqualRect(&r, &r1), "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
429 SetRect(&r1, 10, 10, 10, 10);
430 ok(ClipCursor(&r1), "ClipCursor() failed\n");
431 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
432 ok(EqualRect(&r, &r1), "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
433 SetRect(&r1, 10, 10, 10, 9);
434 ok(!ClipCursor(&r1), "ClipCursor() succeeded\n");
435 /* Windows bug: further clipping fails once an empty rect is set, so we have to reset it */
437
438 SetRect(&r1, virt.left - 10, virt.top - 10, virt.right + 20, virt.bottom + 20);
439 ok(ClipCursor(&r1), "ClipCursor() failed\n");
440 ok(GetClipCursor(&r), "GetClipCursor() failed\n");
441 ok(EqualRect(&r, &virt) || broken(EqualRect(&r, &r1)) /* win9x */,
442 "Invalid clip rect: %s\n", wine_dbgstr_rect(&r));
443 ClipCursor(&virt);
444 }
445 }
446 res = pChangeDisplaySettingsExA(NULL, NULL, NULL, CDS_RESET, NULL);
447 ok(res == DISP_CHANGE_SUCCESSFUL, "Failed to reset default resolution: %d\n", res);
448}
#define broken(x)
Definition: atltest.h:178
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define ARRAY_SIZE(A)
Definition: main.h:20
#define NULL
Definition: types.h:112
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint res
Definition: glext.h:9613
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 DNS_RECORDW r1
Definition: record.c:37
static const struct vid_mode vid_modes_test[]
Definition: monitor.c:287
long LONG
Definition: pedump.c:60
#define win_skip
Definition: test.h:163
#define memset(x, y, z)
Definition: compat.h:39
DWORD dmDisplayFrequency
Definition: wingdi.h:1602
DWORD dmFields
Definition: wingdi.h:1570
DWORD dmPelsWidth
Definition: wingdi.h:1596
DWORD dmPelsHeight
Definition: wingdi.h:1597
DWORD dmBitsPerPel
Definition: wingdi.h:1595
WORD dmDriverExtra
Definition: wingdi.h:1569
WORD dmSize
Definition: wingdi.h:1568
DWORD dmFields
Definition: wingdi.h:1622
DWORD dmPelsWidth
Definition: wingdi.h:1648
WORD dmDriverExtra
Definition: wingdi.h:1621
DWORD dmPelsHeight
Definition: wingdi.h:1649
WORD dmSize
Definition: wingdi.h:1620
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEA lpDevMode)
Definition: display.c:312
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
LONG WINAPI ChangeDisplaySettingsA(LPDEVMODEA lpDevMode, DWORD dwflags)
Definition: display.c:570
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
#define CDS_TEST
Definition: winuser.h:182
#define SM_CYVIRTUALSCREEN
Definition: winuser.h:1042
BOOL WINAPI GetClipCursor(_Out_ LPRECT)
#define SM_CYSCREEN
Definition: winuser.h:963
#define DISP_CHANGE_BADMODE
Definition: winuser.h:195
BOOL WINAPI ClipCursor(_In_opt_ LPCRECT)
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define DISP_CHANGE_BADPARAM
Definition: winuser.h:193
#define DISP_CHANGE_FAILED
Definition: winuser.h:194
#define SM_CXVIRTUALSCREEN
Definition: winuser.h:1041
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
#define CDS_RESET
Definition: winuser.h:187
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SM_CXSCREEN
Definition: winuser.h:962
#define SM_XVIRTUALSCREEN
Definition: winuser.h:1039
#define DISP_CHANGE_RESTART
Definition: winuser.h:191
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
int WINAPI GetSystemMetrics(_In_ int)
#define SM_YVIRTUALSCREEN
Definition: winuser.h:1040
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by START_TEST().

◆ test_display_config()

static void test_display_config ( void  )
static

Definition at line 693 of file monitor.c.

694{
695 UINT32 paths, modes;
696 LONG ret;
697
698 if (!pGetDisplayConfigBufferSizes)
699 {
700 win_skip("GetDisplayConfigBufferSizes is not supported\n");
701 return;
702 }
703
704 ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, NULL, NULL);
705 ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
706
707 paths = 100;
708 ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, &paths, NULL);
709 ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
710 ok(paths == 100, "got %u\n", paths);
711
712 modes = 100;
713 ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, NULL, &modes);
714 ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
715 ok(modes == 100, "got %u\n", modes);
716
717 paths = modes = 0;
718 ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, &paths, &modes);
719 if (!ret)
720 ok(paths > 0 && modes > 0, "got %u, %u\n", paths, modes);
721 else
722 ok(ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
723
724 /* Invalid flags, non-zero invalid flags validation is version (or driver?) dependent,
725 it's unreliable to use in tests. */
726 ret = pGetDisplayConfigBufferSizes(0, NULL, NULL);
727 ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
728
729 paths = 100;
730 ret = pGetDisplayConfigBufferSizes(0, &paths, NULL);
731 ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
732 ok(paths == 100, "got %u\n", paths);
733
734 modes = 100;
735 ret = pGetDisplayConfigBufferSizes(0, NULL, &modes);
736 ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
737 ok(modes == 100, "got %u\n", modes);
738
739 paths = modes = 100;
740 ret = pGetDisplayConfigBufferSizes(0, &paths, &modes);
742 ok((modes == 0 || modes == 100) && paths == 0, "got %u, %u\n", modes, paths);
743}
unsigned int UINT32
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
GLsizei const GLuint * paths
Definition: glext.h:11717
#define QDC_ALL_PATHS
Definition: wingdi.h:1283

Referenced by START_TEST().

◆ test_enumdisplaydevices()

static void test_enumdisplaydevices ( void  )
static

Definition at line 216 of file monitor.c.

217{
218 static const DWORD flags[] = {0, EDD_GET_DEVICE_INTERFACE_NAME};
220 char primary_device_name[32];
221 char primary_monitor_device_name[32];
222 char adapter_name[32];
223 int number;
224 int flag_index;
225 int adapter_index;
226 int monitor_index;
227 BOOL ret;
228
229 if (!pEnumDisplayDevicesA)
230 {
231 win_skip("EnumDisplayDevicesA is not available\n");
232 return;
233 }
234
235 /* Doesn't accept \\.\DISPLAY */
236 dd.cb = sizeof(dd);
237 ret = pEnumDisplayDevicesA("\\\\.\\DISPLAY", 0, &dd, 0);
238 ok(!ret, "Expect failure\n");
239
240 /* Enumeration */
241 for (flag_index = 0; flag_index < ARRAY_SIZE(flags); flag_index++)
242 for (adapter_index = 0; pEnumDisplayDevicesA(NULL, adapter_index, &dd, flags[flag_index]); adapter_index++)
243 {
244 lstrcpyA(adapter_name, dd.DeviceName);
245
246 if (sscanf(adapter_name, "\\\\.\\DISPLAYV%d", &number) == 1)
247 {
248 skip("Skipping software devices %s:%s\n", adapter_name, dd.DeviceString);
249 continue;
250 }
251
252 test_enumdisplaydevices_adapter(adapter_index, &dd, flags[flag_index]);
253
254 for (monitor_index = 0; pEnumDisplayDevicesA(adapter_name, monitor_index, &dd, flags[flag_index]);
255 monitor_index++)
256 test_enumdisplaydevices_monitor(adapter_index, monitor_index, adapter_name, &dd, flags[flag_index]);
257 }
258
259 ok(adapter_count > 0, "Expect at least one adapter found\n");
260 /* XP on Testbot doesn't report a monitor, whereas XP on real machine does */
261 ok(broken(monitor_count == 0) || monitor_count > 0, "Expect at least one monitor found\n");
262
263 if (!pEnumDisplayMonitors || !pGetMonitorInfoA)
264 {
265 win_skip("EnumDisplayMonitors or GetMonitorInfoA are not available\n");
266 return;
267 }
268
269 ret = pEnumDisplayDevicesA(NULL, 0, &dd, 0);
270 ok(ret, "Expect success\n");
271 lstrcpyA(primary_device_name, dd.DeviceName);
272
273 primary_monitor_device_name[0] = 0;
274 ret = pEnumDisplayMonitors(NULL, NULL, monitor_enum_proc, (LPARAM)primary_monitor_device_name);
275 ok(ret, "EnumDisplayMonitors failed\n");
276 ok(!strcmp(primary_monitor_device_name, primary_device_name),
277 "monitor device name %s, device name %s\n", primary_monitor_device_name,
278 primary_device_name);
279}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define skip(...)
Definition: atltest.h:64
GLbitfield flags
Definition: glext.h:7161
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
static unsigned int number
Definition: dsound.c:1479
static BOOL CALLBACK monitor_enum_proc(HMONITOR hmon, HDC hdc, LPRECT lprc, LPARAM lparam)
Definition: monitor.c:64
static void test_enumdisplaydevices_monitor(int adapter_index, int monitor_index, const char *adapter_name, const DISPLAY_DEVICEA *device, DWORD flags)
Definition: monitor.c:161
static int adapter_count
Definition: monitor.c:79
static int monitor_count
Definition: monitor.c:80
static void test_enumdisplaydevices_adapter(int index, const DISPLAY_DEVICEA *device, DWORD flags)
Definition: monitor.c:82
CHAR DeviceString[128]
Definition: wingdi.h:2811
CHAR DeviceName[32]
Definition: wingdi.h:2810
LONG_PTR LPARAM
Definition: windef.h:208

Referenced by START_TEST().

◆ test_enumdisplaydevices_adapter()

static void test_enumdisplaydevices_adapter ( int  index,
const DISPLAY_DEVICEA device,
DWORD  flags 
)
static

Definition at line 82 of file monitor.c.

83{
84 char video_name[32];
85 char video_value[128];
86 char buffer[128];
87 int number;
88 int vendor_id;
89 int device_id;
90 int subsys_id;
91 int revision_id;
92 size_t length;
93 HKEY hkey;
94 HDC hdc;
95 DWORD size;
96 LSTATUS ls;
97
99
100 /* DeviceName */
101 ok(sscanf(device->DeviceName, "\\\\.\\DISPLAY%d", &number) == 1, "#%d: wrong DeviceName %s\n", index,
102 device->DeviceName);
103
104 /* DeviceKey */
105 /* win7 is the only OS version where \Device\Video? value in HLKM\HARDWARE\DEVICEMAP\VIDEO are not in order with adapter index. */
106 if (GetVersion() != 0x1db10106 || !strcmp(winetest_platform, "wine"))
107 {
108 sprintf(video_name, "\\Device\\Video%d", index);
109 ls = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\VIDEO", 0, KEY_READ, &hkey);
110 ok(!ls, "#%d: failed to open registry, error: %#x\n", index, ls);
111 if (!ls)
112 {
113 memset(video_value, 0, sizeof(video_value));
114 size = sizeof(video_value);
115 ls = RegQueryValueExA(hkey, video_name, NULL, NULL, (unsigned char *)video_value, &size);
116 ok(!ls, "#%d: failed to get registry value, error: %#x\n", index, ls);
117 RegCloseKey(hkey);
118 ok(!strcmp(video_value, device->DeviceKey), "#%d: wrong DeviceKey: %s\n", index, device->DeviceKey);
119 }
120 }
121 else
122 ok(sscanf(device->DeviceKey, "\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\%[^\\]\\%04d", buffer, &number) == 2,
123 "#%d: wrong DeviceKey %s\n", index, device->DeviceKey);
124
125 /* DeviceString */
126 length = strlen(device->DeviceString);
127 ok(broken(length == 0) || /* XP on Testbot will return an empty string, whereas XP on real machine doesn't. Probably a bug in virtual adapter driver */
128 length > 0, "#%d: expect DeviceString not empty\n", index);
129
130 /* StateFlags */
131 if (index == 0)
132 ok(device->StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE, "#%d: adapter should be primary\n", index);
133 else
134 ok(!(device->StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE), "#%d: adapter should not be primary\n", index);
135
137 {
138 /* Test creating DC */
139 hdc = CreateDCA(device->DeviceName, NULL, NULL, NULL);
140 ok(hdc != NULL, "#%d: failed to CreateDC(\"%s\") err=%d\n", index, device->DeviceName, GetLastError());
141 DeleteDC(hdc);
142 }
143
144 /* DeviceID */
145 /* DeviceID should equal to the first string of HardwareID value data in PCI GPU instance. You can verify this
146 * by changing the data and rerun EnumDisplayDevices. But it's difficult to find corresponding PCI device on
147 * userland. So here we check the expected format instead. */
148 if (flags & EDD_GET_DEVICE_INTERFACE_NAME)
149 ok(strlen(device->DeviceID) == 0 || /* vista+ */
150 sscanf(device->DeviceID, "PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X",
151 &vendor_id, &device_id, &subsys_id, &revision_id) == 4, /* XP/2003 ignores EDD_GET_DEVICE_INTERFACE_NAME */
152 "#%d: got %s\n", index, device->DeviceID);
153 else
154 {
155 ok(broken(strlen(device->DeviceID) == 0) || /* XP on Testbot returns an empty string, whereas real machine doesn't */
156 sscanf(device->DeviceID, "PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X", &vendor_id, &device_id, &subsys_id,
157 &revision_id) == 4, "#%d: wrong DeviceID %s\n", index, device->DeviceID);
158 }
159}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
void ls(int argc, const char *argv[])
Definition: cmds.c:1136
#define RegCloseKey(hKey)
Definition: registry.h:49
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define sprintf(buf, format,...)
Definition: sprintf.c:55
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
#define KEY_READ
Definition: nt_native.h:1023
DWORD WINAPI GetVersion()
Definition: redirtest.c:5
const char * winetest_platform
Definition: devices.h:37
HDC WINAPI CreateDCA(_In_opt_ LPCSTR pszDriver, _In_opt_ LPCSTR pszDevice, _In_opt_ LPCSTR pszOutput, _In_opt_ const DEVMODEA *pdmInit)
#define DISPLAY_DEVICE_PRIMARY_DEVICE
Definition: wingdi.h:1398
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Definition: wingdi.h:1396
BOOL WINAPI DeleteDC(_In_ HDC)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by test_enumdisplaydevices().

◆ test_enumdisplaydevices_monitor()

static void test_enumdisplaydevices_monitor ( int  adapter_index,
int  monitor_index,
const char adapter_name,
const DISPLAY_DEVICEA device,
DWORD  flags 
)
static

Definition at line 161 of file monitor.c.

163{
164 static const char device_id_prefix[] = "MONITOR\\Default_Monitor\\{4d36e96e-e325-11ce-bfc1-08002be10318}\\";
165 static const char device_key_prefix[] = "\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Class"
166 "\\{4d36e96e-e325-11ce-bfc1-08002be10318}\\";
167 char monitor_name[32];
168 char buffer[128];
169 int number;
170
172
173 /* DeviceName */
174 lstrcpyA(monitor_name, adapter_name);
175 sprintf(monitor_name + strlen(monitor_name), "\\Monitor%d", monitor_index);
176 ok(!strcmp(monitor_name, device->DeviceName), "#%d: expect %s, got %s\n", monitor_index, monitor_name, device->DeviceName);
177
178 /* DeviceString */
179 ok(strlen(device->DeviceString) > 0, "#%d: expect DeviceString not empty\n", monitor_index);
180
181 /* StateFlags */
182 if (adapter_index == 0 && monitor_index == 0)
183 ok(device->StateFlags & DISPLAY_DEVICE_ATTACHED, "#%d expect to have a primary monitor attached\n", monitor_index);
184 else
185 ok(device->StateFlags <= (DISPLAY_DEVICE_ATTACHED | DISPLAY_DEVICE_ACTIVE), "#%d wrong state %#x\n", monitor_index,
186 device->StateFlags);
187
188 /* DeviceID */
189 lstrcpynA(buffer, device->DeviceID, sizeof(device_id_prefix));
190 if (flags & EDD_GET_DEVICE_INTERFACE_NAME)
191 { /* HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\Default_Monitor\4&2abfaa30&0&UID0 GUID_DEVINTERFACE_MONITOR
192 * ^ ^ ^
193 * Expect format \\?\DISPLAY#Default_Monitor#4&2abfaa30&0&UID0#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7} */
194 ok(strlen(device->DeviceID) == 0 || /* vista ~ win7 */
195 sscanf(device->DeviceID, "\\\\?\\DISPLAY#Default_Monitor#%[^#]#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}", buffer) == 1 || /* win8+ */
196 (!lstrcmpiA(buffer, device_id_prefix) &&
197 sscanf(device->DeviceID + sizeof(device_id_prefix) - 1, "%04d", &number) == 1), /* XP/2003 ignores EDD_GET_DEVICE_INTERFACE_NAME */
198 "#%d: wrong DeviceID : %s\n", monitor_index, device->DeviceID);
199 }
200 else
201 {
202 /* Expect HarewareID value data + Driver value data in HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\Default_Monitor\{Instance} */
203 /* But we don't know which monitor instance this belongs to, so check format instead */
204 ok(!lstrcmpiA(buffer, device_id_prefix), "#%d wrong DeviceID : %s\n", monitor_index, device->DeviceID);
205 ok(sscanf(device->DeviceID + sizeof(device_id_prefix) - 1, "%04d", &number) == 1,
206 "#%d wrong DeviceID : %s\n", monitor_index, device->DeviceID);
207 }
208
209 /* DeviceKey */
210 lstrcpynA(buffer, device->DeviceKey, sizeof(device_key_prefix));
211 ok(!lstrcmpiA(buffer, device_key_prefix), "#%d: wrong DeviceKey : %s\n", monitor_index, device->DeviceKey);
212 ok(sscanf(device->DeviceKey + sizeof(device_key_prefix) - 1, "%04d", &number) == 1,
213 "#%d wrong DeviceKey : %s\n", monitor_index, device->DeviceKey);
214}
#define lstrcpynA
Definition: compat.h:751
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4224
#define DISPLAY_DEVICE_ACTIVE
Definition: wingdi.h:1406
#define DISPLAY_DEVICE_ATTACHED
Definition: wingdi.h:1407

Referenced by test_enumdisplaydevices().

◆ test_monitors()

static void test_monitors ( void  )
static

Definition at line 450 of file monitor.c.

451{
452 HMONITOR monitor, primary, nearest;
453 POINT pt;
454 RECT rc;
456 MONITORINFOEXA miexa;
457 MONITORINFOEXW miexw;
458 BOOL ret;
459 DWORD i;
460
461 static const struct
462 {
463 DWORD cbSize;
464 BOOL ret;
465 } testdatami[] = {
466 {0, FALSE},
467 {sizeof(MONITORINFO)+1, FALSE},
468 {sizeof(MONITORINFO)-1, FALSE},
469 {sizeof(MONITORINFO), TRUE},
470 {-1, FALSE},
471 {0xdeadbeef, FALSE},
472 },
473 testdatamiexa[] = {
474 {0, FALSE},
475 {sizeof(MONITORINFOEXA)+1, FALSE},
476 {sizeof(MONITORINFOEXA)-1, FALSE},
477 {sizeof(MONITORINFOEXA), TRUE},
478 {-1, FALSE},
479 {0xdeadbeef, FALSE},
480 },
481 testdatamiexw[] = {
482 {0, FALSE},
483 {sizeof(MONITORINFOEXW)+1, FALSE},
484 {sizeof(MONITORINFOEXW)-1, FALSE},
485 {sizeof(MONITORINFOEXW), TRUE},
486 {-1, FALSE},
487 {0xdeadbeef, FALSE},
488 };
489
490 if (!pMonitorFromPoint || !pMonitorFromWindow || !pMonitorFromRect)
491 {
492 win_skip("MonitorFromPoint, MonitorFromWindow, or MonitorFromRect is not available\n");
493 return;
494 }
495
496 pt.x = pt.y = 0;
497 primary = pMonitorFromPoint( pt, MONITOR_DEFAULTTOPRIMARY );
498 ok( primary != 0, "couldn't get primary monitor\n" );
499
500 monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTONULL );
501 ok( !monitor, "got %p, should not get a monitor for an invalid window\n", monitor );
502 monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTOPRIMARY );
503 ok( monitor == primary, "got %p, should get primary %p for MONITOR_DEFAULTTOPRIMARY\n", monitor, primary );
504 monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTONEAREST );
505 ok( monitor == primary, "got %p, should get primary %p for MONITOR_DEFAULTTONEAREST\n", monitor, primary );
506
507 SetRect( &rc, 0, 0, 1, 1 );
508 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
509 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
510
511 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTOPRIMARY );
512 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
513
514 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONEAREST );
515 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
516
517 /* Empty rect at 0,0 is considered inside the primary monitor */
518 SetRect( &rc, 0, 0, -1, -1 );
519 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
520 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
521
522 /* Even if there is a monitor left of the primary, the primary will have the most overlapping area */
523 SetRect( &rc, -1, 0, 2, 1 );
524 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
525 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
526
527 /* But the width of the rect doesn't matter if it's empty. */
528 SetRect( &rc, -1, 0, 2, -1 );
529 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
530 ok( monitor != primary, "got primary %p\n", monitor );
531
532 if (!pGetMonitorInfoA)
533 {
534 win_skip("GetMonitorInfoA is not available\n");
535 return;
536 }
537
538 /* Search for a monitor that has no others equally near to (left, top-1) */
539 SetRect( &rc, -1, -2, 2, 0 );
540 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
541 nearest = primary;
542 while (monitor != NULL)
543 {
544 ok( monitor != primary, "got primary %p\n", monitor );
545 nearest = monitor;
546 mi.cbSize = sizeof(mi);
547 ret = pGetMonitorInfoA( monitor, &mi );
548 ok( ret, "GetMonitorInfo failed\n" );
550 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
551 }
552
553 /* tests for cbSize in MONITORINFO */
554 monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTOPRIMARY );
555 for (i = 0; i < ARRAY_SIZE(testdatami); i++)
556 {
557 memset( &mi, 0, sizeof(mi) );
558 mi.cbSize = testdatami[i].cbSize;
559 ret = pGetMonitorInfoA( monitor, &mi );
560 ok( ret == testdatami[i].ret, "GetMonitorInfo returned wrong value\n" );
561 if (ret)
562 ok( (mi.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag isn't set\n" );
563 else
564 ok( !(mi.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag is set\n" );
565
566 memset( &miexw, 0, sizeof(miexw) );
567 miexw.cbSize = testdatamiexw[i].cbSize;
568 ret = pGetMonitorInfoW( monitor, (LPMONITORINFO)&miexw );
569 ok( ret == testdatamiexw[i].ret, "GetMonitorInfo returned wrong value\n" );
570 if (ret)
571 ok( (miexw.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag isn't set\n" );
572 else
573 ok( !(miexw.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag is set\n" );
574 }
575
576 /* tests for cbSize in MONITORINFOEXA */
577 for (i = 0; i < ARRAY_SIZE(testdatamiexa); i++)
578 {
579 memset( &miexa, 0, sizeof(miexa) );
580 miexa.cbSize = testdatamiexa[i].cbSize;
581 ret = pGetMonitorInfoA( monitor, (LPMONITORINFO)&miexa );
582 ok( ret == testdatamiexa[i].ret, "GetMonitorInfo returned wrong value\n" );
583 if (ret)
584 ok( (miexa.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag isn't set\n" );
585 else
586 ok( !(miexa.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag is set\n" );
587 }
588
589 /* tests for cbSize in MONITORINFOEXW */
590 for (i = 0; i < ARRAY_SIZE(testdatamiexw); i++)
591 {
592 memset( &miexw, 0, sizeof(miexw) );
593 miexw.cbSize = testdatamiexw[i].cbSize;
594 ret = pGetMonitorInfoW( monitor, (LPMONITORINFO)&miexw );
595 ok( ret == testdatamiexw[i].ret, "GetMonitorInfo returned wrong value\n" );
596 if (ret)
597 ok( (miexw.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag isn't set\n" );
598 else
599 ok( !(miexw.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag is set\n" );
600 }
601
602 SetRect( &rc, rc.left+1, rc.top+1, rc.left+2, rc.top+2 );
603
604 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL );
605 ok( monitor == NULL, "got %p\n", monitor );
606
607 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTOPRIMARY );
608 ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary );
609
610 monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONEAREST );
611 ok( monitor == nearest, "got %p, should get nearest %p\n", monitor, nearest );
612}
#define pt(x, y)
Definition: drawing.c:79
RECT rcMonitor
Definition: winuser.h:3788
struct tagMONITORINFOEXA MONITORINFOEXA
struct tagMONITORINFOEXW MONITORINFOEXW
struct tagMONITORINFO MONITORINFO

Referenced by START_TEST().

◆ test_work_area()

static void test_work_area ( void  )
static

Definition at line 630 of file monitor.c.

631{
634 RECT rc_work, rc_normal;
635 HWND hwnd;
637 BOOL ret;
638
639 if (!pEnumDisplayMonitors || !pGetMonitorInfoA)
640 {
641 win_skip("EnumDisplayMonitors or GetMonitorInfoA are not available\n");
642 return;
643 }
644
645 hmon = 0;
646 ret = pEnumDisplayMonitors(NULL, NULL, find_primary_mon, (LPARAM)&hmon);
647 ok(!ret && hmon != 0, "Failed to find primary monitor\n");
648
649 mi.cbSize = sizeof(mi);
650 SetLastError(0xdeadbeef);
651 ret = pGetMonitorInfoA(hmon, &mi);
652 ok(ret, "GetMonitorInfo error %u\n", GetLastError());
653 ok(mi.dwFlags & MONITORINFOF_PRIMARY, "not a primary monitor\n");
654 trace("primary monitor %s\n", wine_dbgstr_rect(&mi.rcMonitor));
655
656 SetLastError(0xdeadbeef);
657 ret = SystemParametersInfoA(SPI_GETWORKAREA, 0, &rc_work, 0);
658 ok(ret, "SystemParametersInfo error %u\n", GetLastError());
659 trace("work area %s\n", wine_dbgstr_rect(&rc_work));
660 ok(EqualRect(&rc_work, &mi.rcWork), "work area is different\n");
661
662 hwnd = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW|WS_VISIBLE,100,100,10,10,0,0,0,NULL);
663 ok(hwnd != 0, "CreateWindowEx failed\n");
664
665 ret = GetWindowRect(hwnd, &rc_normal);
666 ok(ret, "GetWindowRect failed\n");
667 trace("normal %s\n", wine_dbgstr_rect(&rc_normal));
668
669 wp.length = sizeof(wp);
671 ok(ret, "GetWindowPlacement failed\n");
672 trace("min: %d,%d max %d,%d normal %s\n", wp.ptMinPosition.x, wp.ptMinPosition.y,
674 OffsetRect(&wp.rcNormalPosition, rc_work.left, rc_work.top);
676 mi.rcMonitor.top != mi.rcWork.top) /* FIXME: remove once Wine is fixed */
677 {
678 ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
679 }
680
682
683 wp.length = sizeof(wp);
685 ok(ret, "GetWindowPlacement failed\n");
686 trace("min: %d,%d max %d,%d normal %s\n", wp.ptMinPosition.x, wp.ptMinPosition.y,
688 ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n");
689
691}
#define trace
Definition: atltest.h:70
#define todo_wine_if(is_todo)
Definition: custom.c:86
static BOOL CALLBACK find_primary_mon(HMONITOR hmon, HDC hdc, LPRECT rc, LPARAM lp)
Definition: monitor.c:614
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
POINT ptMaxPosition
Definition: winuser.h:3297
RECT rcNormalPosition
Definition: winuser.h:3298
POINT ptMinPosition
Definition: winuser.h:3296
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
BOOL WINAPI SystemParametersInfoA(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define GWL_EXSTYLE
Definition: winuser.h:854

Referenced by START_TEST().

Variable Documentation

◆ adapter_count

int adapter_count = 0
static

Definition at line 79 of file monitor.c.

Referenced by test_enumdisplaydevices(), and test_enumdisplaydevices_adapter().

◆ DWORD

Definition at line 30 of file monitor.c.

◆ hdll

HMODULE hdll
static

Definition at line 29 of file monitor.c.

Referenced by init_function_pointers().

◆ HWND

Definition at line 30 of file monitor.c.

◆ LPARAM

Definition at line 33 of file monitor.c.

◆ LPDEVMODEA

Definition at line 30 of file monitor.c.

◆ LPDEVMODEW

Definition at line 31 of file monitor.c.

◆ LPDISPLAY_DEVICEA

Definition at line 32 of file monitor.c.

◆ LPMONITORINFO

Definition at line 34 of file monitor.c.

◆ LPRECT

Definition at line 33 of file monitor.c.

◆ LPVOID

Definition at line 30 of file monitor.c.

◆ monitor_count

int monitor_count = 0
static

Definition at line 80 of file monitor.c.

Referenced by test_enumdisplaydevices(), and test_enumdisplaydevices_monitor().

◆ MONITORENUMPROC

MONITORENUMPROC

Definition at line 33 of file monitor.c.

◆ vid_modes_test

const struct vid_mode vid_modes_test[]
static
Initial value:
= {
{640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL , 0},
{640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT , 1},
{640, 480, 0, 0, DM_BITSPERPEL , 0},
{640, 480, 0, 0, DM_DISPLAYFREQUENCY, 0},
{0, 0, 0, 0, DM_PELSWIDTH, 0},
{0, 0, 0, 0, DM_PELSHEIGHT, 0},
{640, 480, 0, 0, DM_PELSWIDTH, 0},
{640, 480, 0, 0, DM_PELSHEIGHT, 0},
{ 0, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT, 0},
{640, 0, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT, 0},
}
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
#define DM_BITSPERPEL
Definition: wingdi.h:1268

Definition at line 287 of file monitor.c.

Referenced by test_ChangeDisplaySettingsEx().