ReactOS 0.4.15-dev-7907-g95bf896
NtGdiCombineRgn.c File Reference
#include "../win32nt.h"
Include dependency graph for NtGdiCombineRgn.c:

Go to the source code of this file.

Functions

 START_TEST (NtGdiCombineRgn)
 

Function Documentation

◆ START_TEST()

START_TEST ( NtGdiCombineRgn  )

Definition at line 10 of file NtGdiCombineRgn.c.

11{
12 HRGN hRgnDest, hRgn1, hRgn2;
13// test what params are accepted for what operations
14// 0? invalid? are params maybe ignored in some cases?
15// LastError
16
17 /* Preparation */
18 hRgnDest = CreateRectRgn(0,0,1,1);
19 hRgn1 = CreateRectRgn(1,1,4,4);
20 hRgn2 = CreateRectRgn(2,2,6,3);
21
22 /* RGN_AND = 1, RGN_OR = 2, RGN_XOR = 3, RGN_DIFF = 4, RGN_COPY = 5 */
23
24 ok_int(NtGdiCombineRgn(hRgnDest, hRgn1, hRgn2, 0), ERROR);
25 ok_int(NtGdiCombineRgn(hRgnDest, hRgn1, hRgn2, 6), ERROR);
26
28 ok_int(NtGdiCombineRgn(hRgnDest, 0, 0, RGN_AND), ERROR);
31 ok_int(NtGdiCombineRgn(hRgnDest, hRgn1, 0, RGN_AND), ERROR);
34 ok_int(NtGdiCombineRgn(hRgnDest, 0, hRgn1, RGN_AND), ERROR);
37 ok_int(NtGdiCombineRgn(0, hRgn1, hRgn2, RGN_AND), ERROR);
39
40 /* Create intersection */
41 ok_int(NtGdiCombineRgn(hRgnDest, hRgn1, hRgn2, RGN_AND), SIMPLEREGION);
42 SetRectRgn(hRgn1, 2, 2, 4, 3);
43 ok_int(NtGdiCombineRgn(hRgnDest, hRgnDest, hRgn1, RGN_XOR), NULLREGION);
44
45 /* Create intersection with itself */
46 SetRectRgn(hRgnDest, 2, 2, 4, 3);
47 ok_int(NtGdiCombineRgn(hRgnDest, hRgnDest, hRgnDest, RGN_AND), SIMPLEREGION);
48 SetRectRgn(hRgn1, 2, 2, 4, 3);
49 ok_int(NtGdiCombineRgn(hRgnDest, hRgnDest, hRgn1, RGN_XOR), NULLREGION);
50
51 /* What if 2 regions are the same */
52}
#define ok_long(expression, result)
Definition: atltest.h:133
#define ok_int(expression, result)
Definition: atltest.h:134
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR(name)
Definition: error_private.h:53
__kernel_entry W32KAPI INT APIENTRY NtGdiCombineRgn(_In_ HRGN hrgnDst, _In_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ INT iMode)
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define NULLREGION
Definition: wingdi.h:361
#define RGN_AND
Definition: wingdi.h:356
#define SIMPLEREGION
Definition: wingdi.h:362
#define RGN_XOR
Definition: wingdi.h:360
BOOL WINAPI SetRectRgn(_In_ HRGN, _In_ int, _In_ int, _In_ int, _In_ int)