ReactOS  0.4.15-dev-2155-g06f57e1
NtUserEnumDisplayMonitors.c File Reference
#include <win32nt.h>
Include dependency graph for NtUserEnumDisplayMonitors.c:

Go to the source code of this file.

Functions

BOOL NTAPI NtUserEnumDisplayMonitors1 (HDC hDC, LPCRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData)
 
BOOL CALLBACK MonitorEnumProc (HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
 
 START_TEST (NtUserEnumDisplayMonitors)
 

Variables

ULONG gMonitorCount = 0
 
HDC ghdcMonitor = 0
 
RECT grcMonitor = {0}
 

Function Documentation

◆ MonitorEnumProc()

BOOL CALLBACK MonitorEnumProc ( HMONITOR  hMonitor,
HDC  hdcMonitor,
LPRECT  lprcMonitor,
LPARAM  dwData 
)

Definition at line 26 of file NtUserEnumDisplayMonitors.c.

31 {
32  gMonitorCount++;
33  if (gMonitorCount == 1)
34  {
35  ghdcMonitor = hdcMonitor;
36  grcMonitor = *lprcMonitor;
37  }
38  return TRUE;
39 }
#define TRUE
Definition: types.h:120
ULONG gMonitorCount
RECT grcMonitor

Referenced by START_TEST().

◆ NtUserEnumDisplayMonitors1()

BOOL NTAPI NtUserEnumDisplayMonitors1 ( HDC  hDC,
LPCRECT  lprcClip,
MONITORENUMPROC  lpfnEnum,
LPARAM  dwData 
)

Definition at line 16 of file NtUserEnumDisplayMonitors.c.

21 {
22  return (INT)Syscall(L"NtUserEnumDisplayMonitors", 4, &hDC);
23 }
int32_t INT
Definition: typedefs.h:58
static const WCHAR L[]
Definition: oid.c:1250
static HDC hDC
Definition: 3dtext.c:33
DWORD Syscall(LPWSTR pszFunction, int cParams, void *pParams)
Definition: w32knapi.c:90

◆ START_TEST()

START_TEST ( NtUserEnumDisplayMonitors  )

Definition at line 41 of file NtUserEnumDisplayMonitors.c.

42 {
43  BOOL ret;
44 
45  // WILL crash!
46 // TEST(NtUserEnumDisplayMonitors1(NULL, NULL, NULL, 0) == 0);
47 
49  TEST(ret == TRUE);
50  TEST(gMonitorCount > 0);
51  TEST(ghdcMonitor == 0);
52  TEST(grcMonitor.left == 0);
53  TEST(grcMonitor.right > 0);
54  TEST(grcMonitor.top == 0);
55  TEST(grcMonitor.bottom > 0);
56 
57 }
#define TRUE
Definition: types.h:120
BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
INT NTAPI NtUserEnumDisplayMonitors(OPTIONAL IN HDC hDC, OPTIONAL IN LPCRECT pRect, OPTIONAL OUT HMONITOR *hMonitorList, OPTIONAL OUT LPRECT monitorRectList, OPTIONAL IN DWORD listSize)
LONG right
Definition: windef.h:308
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG gMonitorCount
#define TEST(x)
Definition: precomp.h:20
int ret
RECT grcMonitor
#define NULL
Definition: types.h:112
LONG bottom
Definition: windef.h:309

Variable Documentation

◆ ghdcMonitor

HDC ghdcMonitor = 0

Definition at line 11 of file NtUserEnumDisplayMonitors.c.

Referenced by MonitorEnumProc(), and START_TEST().

◆ gMonitorCount

ULONG gMonitorCount = 0

Definition at line 10 of file NtUserEnumDisplayMonitors.c.

Referenced by MonitorEnumProc(), and START_TEST().

◆ grcMonitor

RECT grcMonitor = {0}

Definition at line 12 of file NtUserEnumDisplayMonitors.c.

Referenced by MonitorEnumProc(), and START_TEST().