ReactOS  0.4.15-dev-1070-ge1a01de
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,
19  CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
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 
37  ReleaseDC(hWnd, hDC);
39 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define SetLastError(x)
Definition: compat.h:500
int ret
static const WCHAR L[]
Definition: oid.c:1250
static HRGN hrgn
Definition: win.c:55
static HDC hDC
Definition: 3dtext.c:33
#define ok(value,...)
Definition: atltest.h:57
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by START_TEST().