125198d5cSjimtabor /*
225198d5cSjimtabor  * PROJECT:         ReactOS api tests
325198d5cSjimtabor  * LICENSE:         GPL - See COPYING in the top level directory
4ef8c9239Sjimtabor  * PURPOSE:         Test for NtGdiExtSelectClipRgn
525198d5cSjimtabor  * PROGRAMMERS:
625198d5cSjimtabor  */
725198d5cSjimtabor 
8*a5c3bb5bSSerge Gautherie #include "../win32nt.h"
925198d5cSjimtabor 
START_TEST(NtGdiExtSelectClipRgn)1025198d5cSjimtabor START_TEST(NtGdiExtSelectClipRgn)
1125198d5cSjimtabor {
1225198d5cSjimtabor     HRGN hRgnDest, hRgn1, hRgn2;
1325198d5cSjimtabor     HDC hdc;
1425198d5cSjimtabor // test what params are accepted for what operations
1525198d5cSjimtabor // 0? invalid? are params maybe ignored in some cases?
1625198d5cSjimtabor // LastError
1725198d5cSjimtabor 
1825198d5cSjimtabor     /* Preparation */
1925198d5cSjimtabor     hRgnDest = CreateRectRgn(100, 100, 100, 100);
2025198d5cSjimtabor     hRgn1 = CreateRectRgn(1,1,4,4);
2125198d5cSjimtabor     hRgn2 = CreateRectRgn(2,2,6,3);
2225198d5cSjimtabor 
2325198d5cSjimtabor     hdc = GetDC(NULL);
2425198d5cSjimtabor 
2525198d5cSjimtabor     /* RGN_AND = 1, RGN_OR = 2, RGN_XOR = 3, RGN_DIFF = 4, RGN_COPY = 5 */
2625198d5cSjimtabor 
2725198d5cSjimtabor     SetLastError(0xDEADFACE);
2825198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(NULL, NULL, RGN_AND-1), ERROR);
2925198d5cSjimtabor     ok_long(GetLastError(), ERROR_INVALID_PARAMETER);
3025198d5cSjimtabor     SetLastError(0xDEADFACE);
3125198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(NULL, NULL, RGN_COPY+1), ERROR);
3225198d5cSjimtabor     ok_long(GetLastError(), ERROR_INVALID_PARAMETER);
3325198d5cSjimtabor     SetLastError(0xDEADFACE);
3425198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(NULL, NULL, RGN_COPY), ERROR);
3525198d5cSjimtabor     ok_long(GetLastError(), ERROR_INVALID_HANDLE);
3625198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgnDest, RGN_COPY), NULLREGION);
3725198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
3825198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgnDest, RGN_DIFF), SIMPLEREGION);
3925198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgn1, RGN_COPY), SIMPLEREGION);
4025198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgn2, RGN_DIFF), COMPLEXREGION);
4125198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
4225198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
4325198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgnDest, RGN_COPY), NULLREGION);
4425198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgn1, RGN_AND), NULLREGION);
4525198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgn2, RGN_AND), NULLREGION);
4625198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
4725198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgn1, RGN_OR), SIMPLEREGION);
4825198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgn2, RGN_OR), SIMPLEREGION);
4925198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, hRgn1, RGN_XOR), COMPLEXREGION);
5025198d5cSjimtabor     SetLastError(0xDEADFACE);
5125198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_DIFF), ERROR);
5225198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_OR), ERROR);
5325198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_XOR), ERROR);
5425198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_AND), ERROR);
5525198d5cSjimtabor     ok_long(GetLastError(), 0xDEADFACE);
5625198d5cSjimtabor     ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
5725198d5cSjimtabor }
58