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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <wine/test.h>
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|