ReactOS 0.4.15-dev-6068-g8061a6f
GetClipRgn.c File Reference
#include "precomp.h"
Include dependency graph for GetClipRgn.c:

Go to the source code of this file.

Functions

void Test_GetClipRgn ()
 
 START_TEST (GetClipRgn)
 

Function Documentation

◆ START_TEST()

START_TEST ( GetClipRgn  )

Definition at line 41 of file GetClipRgn.c.

42{
44}
void Test_GetClipRgn()
Definition: GetClipRgn.c:10

◆ Test_GetClipRgn()

void Test_GetClipRgn ( )

Definition at line 10 of file GetClipRgn.c.

11{
12 HWND hWnd;
13 HDC hDC;
14 HRGN hrgn;//, hrgn2;
15 int ret;
16
17 /* Create a window */
18 hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
20 NULL, NULL, 0, 0);
21
22 hDC = GetDC(hWnd);
23 hrgn = CreateRectRgn(0,0,0,0);
24
25 /* Test invalid DC */
27 ret = GetClipRgn((HDC)0x12345, hrgn);
28 ok(ret == -1, "Expected -1, got %d\n", ret);
29 ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
30
31 /* Test invalid hrgn */
33 ret = GetClipRgn(hDC, (HRGN)0x12345);
34 ok(ret == 0, "Expected 0, got %d\n", ret);
35 ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
36
39}
static HDC hDC
Definition: 3dtext.c:33
static HRGN hrgn
#define ok(value,...)
Definition: atltest.h:57
HWND hWnd
Definition: settings.c:17
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
static HDC
Definition: imagelist.c:92
#define L(x)
Definition: ntvdm.h:50
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
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:4306
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by START_TEST().