a53821b5889c630f1d8d670fdc9fb90e664bef32
[reactos.git] / rostests / apitests / w32knapi / ntgdi / NtGdiCreateCompatibleDC.c
1
2 INT
3 Test_NtGdiCreateCompatibleDC(PTESTINFO pti)
4 {
5 HDC hDC;
6 HGDIOBJ hObj;
7
8 /* Test if aa NULL DC is accepted */
9 hDC = NtGdiCreateCompatibleDC(NULL);
10 TEST(hDC != NULL);
11
12 /* We select a nwe palette. Note: SelectObject doesn't work with palettes! */
13 hObj = SelectPalette(hDC, GetStockObject(DEFAULT_PALETTE), 0);
14 /* The old palette should be GetStockObject(DEFAULT_PALETTE) */
15 TEST(hObj == GetStockObject(DEFAULT_PALETTE));
16
17 /* The default bitmap should be GetStockObject(21) */
18 hObj = SelectObject(hDC, GetStockObject(21));
19 TEST(hObj == GetStockObject(21));
20
21 /* The default pen should be GetStockObject(BLACK_PEN) */
22 hObj = SelectObject(hDC, GetStockObject(WHITE_PEN));
23 TEST(hObj == GetStockObject(BLACK_PEN));
24
25 return APISTATUS_NORMAL;
26 }
27