ReactOS  0.4.15-dev-1374-g8d3e80e
EnumDisplaySettings.c File Reference
#include "precomp.h"
Include dependency graph for EnumDisplaySettings.c:

Go to the source code of this file.

Macros

#define SIZEOF_DEVMODEW_300_W   188
 
#define SIZEOF_DEVMODEW_400_W   212
 
#define SIZEOF_DEVMODEW_500_W   220
 
#define SIZEOF_DEVMODEW_300_A   124
 
#define SIZEOF_DEVMODEW_400_A   148
 
#define SIZEOF_DEVMODEW_500_A   156
 

Functions

 START_TEST (EnumDisplaySettings)
 

Macro Definition Documentation

◆ SIZEOF_DEVMODEW_300_A

#define SIZEOF_DEVMODEW_300_A   124

Definition at line 8 of file EnumDisplaySettings.c.

◆ SIZEOF_DEVMODEW_300_W

#define SIZEOF_DEVMODEW_300_W   188

Definition at line 4 of file EnumDisplaySettings.c.

◆ SIZEOF_DEVMODEW_400_A

#define SIZEOF_DEVMODEW_400_A   148

Definition at line 9 of file EnumDisplaySettings.c.

◆ SIZEOF_DEVMODEW_400_W

#define SIZEOF_DEVMODEW_400_W   212

Definition at line 5 of file EnumDisplaySettings.c.

◆ SIZEOF_DEVMODEW_500_A

#define SIZEOF_DEVMODEW_500_A   156

Definition at line 10 of file EnumDisplaySettings.c.

◆ SIZEOF_DEVMODEW_500_W

#define SIZEOF_DEVMODEW_500_W   220

Definition at line 6 of file EnumDisplaySettings.c.

Function Documentation

◆ START_TEST()

START_TEST ( EnumDisplaySettings  )

Definition at line 12 of file EnumDisplaySettings.c.

13 {
14  DEVMODEW dmW;
15  DEVMODEA dmA;
16  HDC icDisplay;
17 
18  /* TODO: test with a printer driver */
19 
20  icDisplay = CreateICW(L"DISPLAY", NULL, NULL, NULL);
21  ok(icDisplay != NULL, "\n");
22 
23  dmW.dmDriverExtra = 0x7777;
24 
25  /* Try ridiculous size */
26  dmW.dmSize = 0x8888;
28  ok(dmW.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmW.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
29  ok(dmW.dmSize == SIZEOF_DEVMODEW_300_W, "%d\n", dmW.dmSize);
30  ok(dmW.dmDriverExtra == 0, "%d\n", dmW.dmDriverExtra);
31 
32  /* Try a tiny size */
33  dmW.dmSize = 4;
35  ok(dmW.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmW.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
36  ok(dmW.dmSize == SIZEOF_DEVMODEW_300_W, "%d\n", dmW.dmSize);
37 
38  /* Something in between */
41  ok(dmW.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmW.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
42  ok(dmW.dmSize == SIZEOF_DEVMODEW_300_W, "%d\n", dmW.dmSize);
43 
44  /* WINVER < 0x0400 */
47  ok(dmW.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmW.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
48  ok(dmW.dmSize == SIZEOF_DEVMODEW_300_W, "%d\n", dmW.dmSize);
49 
50  /* WINVER < 0x0500 */
53  ok(dmW.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmW.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
54  ok(dmW.dmSize == SIZEOF_DEVMODEW_300_W, "%d\n", dmW.dmSize);
55 
56  /* "Modern" windows */
59  ok(dmW.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmW.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
60  ok(dmW.dmSize == SIZEOF_DEVMODEW_300_W, "%d\n", dmW.dmSize);
61 
62  DeleteDC(icDisplay);
63 
64  icDisplay = CreateICA("DISPLAY", NULL, NULL, NULL);
65  ok(icDisplay != NULL, "\n");
66 
67  dmA.dmDriverExtra = 0x7777;
68 
69  /* Try ridiculous size */
70  dmA.dmSize = 0x8888;
72  ok(dmA.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmA.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
73  ok(dmA.dmSize == SIZEOF_DEVMODEW_300_A, "%d\n", dmA.dmSize);
74  ok(dmA.dmDriverExtra == 0, "%d\n", dmA.dmDriverExtra);
75 
76  /* Try a tiny size */
77  dmA.dmSize = 4;
79  ok(dmA.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmA.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
80  ok(dmA.dmSize == SIZEOF_DEVMODEW_300_A, "%d\n", dmA.dmSize);
81 
82  /* Something in between */
85  ok(dmA.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmA.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
86  ok(dmA.dmSize == SIZEOF_DEVMODEW_300_A, "%d\n", dmA.dmSize);
87 
88  /* WINVER < 0x0400 */
91  ok(dmA.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmA.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
92  ok(dmA.dmSize == SIZEOF_DEVMODEW_300_A, "%d\n", dmA.dmSize);
93 
94  /* WINVER < 0x0500 */
97  ok(dmA.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmA.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
98  ok(dmA.dmSize == SIZEOF_DEVMODEW_300_A, "%d\n", dmA.dmSize);
99 
100  /* "Modern" windows */
103  ok(dmA.dmBitsPerPel == GetDeviceCaps(icDisplay, BITSPIXEL), "%lu, should be %d.\n", dmA.dmBitsPerPel, GetDeviceCaps(icDisplay, BITSPIXEL));
104  ok(dmA.dmSize == SIZEOF_DEVMODEW_300_A, "%d\n", dmA.dmSize);
105 
106  DeleteDC(icDisplay);
107 }
#define BITSPIXEL
Definition: wingdi.h:719
#define SIZEOF_DEVMODEW_300_W
WORD dmSize
Definition: wingdi.h:1567
WORD dmDriverExtra
Definition: wingdi.h:1568
static HDC
Definition: imagelist.c:92
WORD dmDriverExtra
Definition: wingdi.h:1620
#define SIZEOF_DEVMODEW_500_A
DWORD dmBitsPerPel
Definition: wingdi.h:1646
#define SIZEOF_DEVMODEW_500_W
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
HDC WINAPI CreateICA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ const DEVMODEA *)
#define SIZEOF_DEVMODEW_300_A
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
#define SIZEOF_DEVMODEW_400_A
BOOL WINAPI EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEA lpDevMode)
Definition: display.c:312
WORD dmSize
Definition: wingdi.h:1619
#define SIZEOF_DEVMODEW_400_W
static const WCHAR L[]
Definition: oid.c:1250
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
DWORD dmBitsPerPel
Definition: wingdi.h:1594
BOOL WINAPI DeleteDC(_In_ HDC)
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
HDC WINAPI CreateICW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ const DEVMODEW *)