ReactOS 0.4.15-dev-8390-g075894b
NtGdiGetRandomRgn.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 NtGdiGetRandomRgn
5 * PROGRAMMERS:
6 */
7
8#include "../win32nt.h"
9
11{
13 HWND hWnd;
14 HDC hDC;
15 HRGN hrgn, hrgn2;
16
17 /* Create a window */
18 hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
20 NULL, NULL, hinst, 0);
21// UpdateWindow(hWnd);
22 hDC = GetDC(hWnd);
23
24 ok(hDC != NULL, "hDC was NULL.\n");
25
26 hrgn = CreateRectRgn(0,0,0,0);
27 hrgn2 = CreateRectRgn(3,3,10,10);
29 ok_int(NtGdiGetRandomRgn(0, hrgn, 0), -1);
31
33 ok_int(NtGdiGetRandomRgn((HDC)2345, hrgn, 1), -1);
35
37 ok_int(NtGdiGetRandomRgn((HDC)2345, hrgn, 10), -1);
39
41 ok_int(NtGdiGetRandomRgn((HDC)2345, (HRGN)10, 10), -1);
43
45 ok_int(NtGdiGetRandomRgn((HDC)2345, 0, 1), -1);
47
49 ok_int(NtGdiGetRandomRgn(hDC, 0, 0), 0);
50 ok_int(NtGdiGetRandomRgn(hDC, 0, 1), 0);
51 ok_int(NtGdiGetRandomRgn(hDC, (HRGN)-5, 0), 0);
52 ok_int(NtGdiGetRandomRgn(hDC, (HRGN)-5, 1), 0);
62
64 ok_int(NtGdiGetRandomRgn(hDC, 0, 1), -1);
69
70 SetRectRgn(hrgn2,0,0,0,0);
73
76
79
80
82
84
87
88}
static HDC hDC
Definition: 3dtext.c:33
static HRGN hrgn2
static HRGN hrgn
#define ok_long(expression, result)
Definition: atltest.h:133
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
HWND hWnd
Definition: settings.c:17
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static HINSTANCE hinst
Definition: edit.c:551
static HDC
Definition: imagelist.c:92
__kernel_entry W32KAPI INT APIENTRY NtGdiGetRandomRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ INT iRgn)
#define L(x)
Definition: ntvdm.h:50
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GetModuleHandle
Definition: winbase.h:3827
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define NULLREGION
Definition: wingdi.h:361
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
#define SIMPLEREGION
Definition: wingdi.h:362
#define RGN_XOR
Definition: wingdi.h:360
#define RGN_OR
Definition: wingdi.h:359
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
BOOL WINAPI SetRectRgn(_In_ HRGN, _In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4316
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI DestroyWindow(_In_ HWND)