ReactOS  0.4.15-dev-2103-g9dff498
NtGdiGetRandomRgn.c File Reference
#include <win32nt.h>
Include dependency graph for NtGdiGetRandomRgn.c:

Go to the source code of this file.

Functions

 START_TEST (NtGdiGetRandomRgn)
 

Function Documentation

◆ START_TEST()

START_TEST ( NtGdiGetRandomRgn  )

Definition at line 10 of file NtGdiGetRandomRgn.c.

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,
19  CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
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);
59  ok_int(NtGdiGetRandomRgn(hDC, hrgn, 10), 0);
60  ok_int(NtGdiGetRandomRgn(hDC, hrgn, -10), 0);
62 
64  ok_int(NtGdiGetRandomRgn(hDC, 0, 1), -1);
69 
70  SetRectRgn(hrgn2,0,0,0,0);
73 
76 
79 
80 
82 
84 
85  ReleaseDC(hWnd, hDC);
87 
88 }
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
#define ERROR_SUCCESS
Definition: deptool.c:10
HDC WINAPI GetDC(_In_opt_ HWND)
static HRGN hrgn2
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
#define NULLREGION
Definition: wingdi.h:360
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define ok_long(expression, result)
Definition: atltest.h:133
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
#define RGN_XOR
Definition: wingdi.h:359
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CW_USEDEFAULT
Definition: winuser.h:225
#define ok_int(expression, result)
Definition: atltest.h:134
#define RGN_OR
Definition: wingdi.h:358
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI SetRectRgn(_In_ HRGN, _In_ int, _In_ int, _In_ int, _In_ int)
#define SetLastError(x)
Definition: compat.h:611
static const WCHAR L[]
Definition: oid.c:1250
static HRGN hrgn
Definition: win.c:55
#define SIMPLEREGION
Definition: wingdi.h:361
static HDC hDC
Definition: 3dtext.c:33
#define GetModuleHandle
Definition: winbase.h:3683
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
__kernel_entry W32KAPI INT APIENTRY NtGdiGetRandomRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ INT iRgn)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
static HINSTANCE hinst
Definition: edit.c:551
#define WS_VISIBLE
Definition: pedump.c:620