ReactOS  0.4.15-dev-3453-gff89651
NtUserEnumDisplayMonitors.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS api tests
3  * LICENSE: GPL - See COPYING in the top level directory
4  * PURPOSE: Test for NtUserEnumDisplayMonitors
5  * PROGRAMMERS:
6  */
7 
8 #include <win32nt.h>
9 
13 
14 BOOL
15 NTAPI
17  HDC hDC,
18  LPCRECT lprcClip,
19  MONITORENUMPROC lpfnEnum,
20  LPARAM dwData)
21 {
22  return (INT)Syscall(L"NtUserEnumDisplayMonitors", 4, &hDC);
23 }
24 
27  HMONITOR hMonitor,
28  HDC hdcMonitor,
29  LPRECT lprcMonitor,
30  LPARAM dwData)
31 {
32  gMonitorCount++;
33  if (gMonitorCount == 1)
34  {
35  ghdcMonitor = hdcMonitor;
36  grcMonitor = *lprcMonitor;
37  }
38  return TRUE;
39 }
40 
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)
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:35
LONG top
Definition: windef.h:307
static HANDLE ULONG_PTR dwData
Definition: file.c:35
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
int32_t INT
Definition: typedefs.h:58
BOOL NTAPI NtUserEnumDisplayMonitors1(HDC hDC, LPCRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData)
#define L(x)
Definition: ntvdm.h:50
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG gMonitorCount
LONG_PTR LPARAM
Definition: windef.h:208
#define TEST(x)
Definition: precomp.h:20
int ret
BOOL(CALLBACK * MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM)
Definition: winuser.h:2889
RECT grcMonitor
START_TEST(NtUserEnumDisplayMonitors)
static HDC hDC
Definition: 3dtext.c:33
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
LONG bottom
Definition: windef.h:309
DWORD Syscall(LPWSTR pszFunction, int cParams, void *pParams)
Definition: w32knapi.c:90