2010-08-24 13:54:10 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS api tests
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* PURPOSE: Test for GetClipRgn
|
|
|
|
* PROGRAMMERS: Timo Kreuzer
|
|
|
|
*/
|
|
|
|
|
2013-09-22 17:52:42 +00:00
|
|
|
#include <apitest.h>
|
|
|
|
|
2013-02-05 17:54:22 +00:00
|
|
|
#include <wingdi.h>
|
|
|
|
#include <winuser.h>
|
2010-08-24 13:54:10 +00:00
|
|
|
|
|
|
|
void Test_GetClipRgn()
|
|
|
|
{
|
|
|
|
HWND hWnd;
|
|
|
|
HDC hDC;
|
|
|
|
HRGN hrgn;//, hrgn2;
|
2011-03-21 14:36:32 +00:00
|
|
|
int ret;
|
2010-08-24 13:54:10 +00:00
|
|
|
|
|
|
|
/* Create a window */
|
|
|
|
hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
|
|
|
CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
|
|
|
|
NULL, NULL, 0, 0);
|
|
|
|
|
|
|
|
hDC = GetDC(hWnd);
|
|
|
|
hrgn = CreateRectRgn(0,0,0,0);
|
|
|
|
|
|
|
|
/* Test invalid DC */
|
|
|
|
SetLastError(ERROR_SUCCESS);
|
2011-03-21 14:36:32 +00:00
|
|
|
ret = GetClipRgn((HDC)0x12345, hrgn);
|
|
|
|
ok(ret == -1, "Expected -1, got %d\n", ret);
|
|
|
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
|
2010-08-24 13:54:10 +00:00
|
|
|
|
|
|
|
/* Test invalid hrgn */
|
|
|
|
SetLastError(ERROR_SUCCESS);
|
2011-03-21 14:36:32 +00:00
|
|
|
ret = GetClipRgn(hDC, (HRGN)0x12345);
|
|
|
|
ok(ret == 0, "Expected 0, got %d\n", ret);
|
|
|
|
ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
|
2010-08-24 13:54:10 +00:00
|
|
|
|
|
|
|
ReleaseDC(hWnd, hDC);
|
|
|
|
DestroyWindow(hWnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
START_TEST(GetClipRgn)
|
|
|
|
{
|
|
|
|
Test_GetClipRgn();
|
|
|
|
}
|
|
|
|
|