1 /*
2  * PROJECT:         ReactOS api tests
3  * LICENSE:         GPL - See COPYING in the top level directory
4  * PURPOSE:         Test for NtGdiCreateCompatibleDC
5  * PROGRAMMERS:
6  */
7 
8 #include <win32nt.h>
9 
10 START_TEST(NtGdiCreateCompatibleDC)
11 {
12 	HDC hDC;
13 	HGDIOBJ hObj;
14 
15 	/* Test if aa NULL DC is accepted */
16 	hDC = NtGdiCreateCompatibleDC(NULL);
17 	TEST(hDC != NULL);
18 
19 	/* We select a nwe palette. Note: SelectObject doesn't work with palettes! */
20 	hObj = SelectPalette(hDC, GetStockObject(DEFAULT_PALETTE), 0);
21 	/* The old palette should be GetStockObject(DEFAULT_PALETTE) */
22 	TEST(hObj == GetStockObject(DEFAULT_PALETTE));
23 
24 	/* The default bitmap should be GetStockObject(21) */
25 	hObj = SelectObject(hDC, GetStockObject(21));
26 	TEST(hObj == GetStockObject(21));
27 
28 	/* The default pen should be GetStockObject(BLACK_PEN) */
29 	hObj = SelectObject(hDC, GetStockObject(WHITE_PEN));
30 	TEST(hObj == GetStockObject(BLACK_PEN));
31 
32 	TEST(NtGdiDeleteObjectApp(hDC) != 0);
33 }
34 
35