ReactOS  0.4.14-dev-831-gef8c9239
NtGdiCreateCompatibleDC.c
Go to the documentation of this file.
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 
11 {
12  HDC hDC;
13  HGDIOBJ hObj;
14 
15  /* Test if aa NULL DC is accepted */
17  ok(hDC != NULL, "hDC was NULL.\n");
18 
19  /* We select a nwe palette. Note: SelectObject doesn't work with palettes! */
21  /* The old palette should be GetStockObject(DEFAULT_PALETTE) */
23 
24  /* The default bitmap should be GetStockObject(21) */
25  hObj = SelectObject(hDC, GetStockObject(21));
26  ok_ptr(hObj, GetStockObject(21));
27 
28  /* The default pen should be GetStockObject(BLACK_PEN) */
31 
32  ok(NtGdiDeleteObjectApp(hDC) != 0, "NtGdiDeleteObjectApp(hDC) was zero.\n");
33 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
START_TEST(NtGdiCreateCompatibleDC)
#define WHITE_PEN
Definition: wingdi.h:904
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define ok_ptr(expression, result)
Definition: atltest.h:108
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
#define DEFAULT_PALETTE
Definition: wingdi.h:912
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateCompatibleDC(_In_opt_ HDC hdc)
static HDC hDC
Definition: 3dtext.c:33
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
#define BLACK_PEN
Definition: wingdi.h:902
#define ok(value,...)
Definition: atltest.h:57