2015-12-28 20:31:10 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS api tests
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* PURPOSE: Test for NtUserEnumDisplayMonitors
|
|
|
|
* PROGRAMMERS:
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <win32nt.h>
|
Add tests for NtGdiCombineRgn (14), NtGdiCreateCompatibleDC (4), NtGdiDoPalette (1), NtGdiFlushUserBatch (10), NtGdiPolyPolyDraw (60), NtGdiselectBitmap (4), NtGdiSelectPen (6), NtGdiSetDIBitsToDeviceInternal (2), NtUserEnumDisplayMonitors (7), NtUserGetClassInfo (15), NtUserProcessConnect (1), NtUserSelectPalette (13), NtUserSystemParametersInfo (1) (= 138 new tests)
svn path=/trunk/; revision=38044
2008-12-13 16:48:01 +00:00
|
|
|
|
|
|
|
ULONG gMonitorCount = 0;
|
|
|
|
HDC ghdcMonitor = 0;
|
|
|
|
RECT grcMonitor = {0};
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
NTAPI
|
|
|
|
NtUserEnumDisplayMonitors1(
|
|
|
|
HDC hDC,
|
|
|
|
LPCRECT lprcClip,
|
|
|
|
MONITORENUMPROC lpfnEnum,
|
|
|
|
LPARAM dwData)
|
|
|
|
{
|
|
|
|
return (INT)Syscall(L"NtUserEnumDisplayMonitors", 4, &hDC);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL CALLBACK
|
|
|
|
MonitorEnumProc(
|
|
|
|
HMONITOR hMonitor,
|
|
|
|
HDC hdcMonitor,
|
|
|
|
LPRECT lprcMonitor,
|
|
|
|
LPARAM dwData)
|
|
|
|
{
|
|
|
|
gMonitorCount++;
|
|
|
|
if (gMonitorCount == 1)
|
|
|
|
{
|
|
|
|
ghdcMonitor = hdcMonitor;
|
|
|
|
grcMonitor = *lprcMonitor;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2015-12-28 20:31:10 +00:00
|
|
|
START_TEST(NtUserEnumDisplayMonitors)
|
Add tests for NtGdiCombineRgn (14), NtGdiCreateCompatibleDC (4), NtGdiDoPalette (1), NtGdiFlushUserBatch (10), NtGdiPolyPolyDraw (60), NtGdiselectBitmap (4), NtGdiSelectPen (6), NtGdiSetDIBitsToDeviceInternal (2), NtUserEnumDisplayMonitors (7), NtUserGetClassInfo (15), NtUserProcessConnect (1), NtUserSelectPalette (13), NtUserSystemParametersInfo (1) (= 138 new tests)
svn path=/trunk/; revision=38044
2008-12-13 16:48:01 +00:00
|
|
|
{
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
// WILL crash!
|
2019-01-30 13:55:10 +00:00
|
|
|
// TEST(NtUserEnumDisplayMonitors1(NULL, NULL, NULL, 0) == 0);
|
Add tests for NtGdiCombineRgn (14), NtGdiCreateCompatibleDC (4), NtGdiDoPalette (1), NtGdiFlushUserBatch (10), NtGdiPolyPolyDraw (60), NtGdiselectBitmap (4), NtGdiSelectPen (6), NtGdiSetDIBitsToDeviceInternal (2), NtUserEnumDisplayMonitors (7), NtUserGetClassInfo (15), NtUserProcessConnect (1), NtUserSelectPalette (13), NtUserSystemParametersInfo (1) (= 138 new tests)
svn path=/trunk/; revision=38044
2008-12-13 16:48:01 +00:00
|
|
|
|
2015-12-28 20:31:10 +00:00
|
|
|
ret = NtUserEnumDisplayMonitors(0, NULL, MonitorEnumProc, 0);
|
Add tests for NtGdiCombineRgn (14), NtGdiCreateCompatibleDC (4), NtGdiDoPalette (1), NtGdiFlushUserBatch (10), NtGdiPolyPolyDraw (60), NtGdiselectBitmap (4), NtGdiSelectPen (6), NtGdiSetDIBitsToDeviceInternal (2), NtUserEnumDisplayMonitors (7), NtUserGetClassInfo (15), NtUserProcessConnect (1), NtUserSelectPalette (13), NtUserSystemParametersInfo (1) (= 138 new tests)
svn path=/trunk/; revision=38044
2008-12-13 16:48:01 +00:00
|
|
|
TEST(ret == TRUE);
|
|
|
|
TEST(gMonitorCount > 0);
|
|
|
|
TEST(ghdcMonitor == 0);
|
|
|
|
TEST(grcMonitor.left == 0);
|
|
|
|
TEST(grcMonitor.right > 0);
|
|
|
|
TEST(grcMonitor.top == 0);
|
|
|
|
TEST(grcMonitor.bottom > 0);
|
|
|
|
|
|
|
|
}
|