ReactOS  0.4.15-dev-2537-g99d7768
NtGdiSelectFont.c File Reference
#include <win32nt.h>
Include dependency graph for NtGdiSelectFont.c:

Go to the source code of this file.

Functions

 START_TEST (NtGdiSelectFont)
 

Function Documentation

◆ START_TEST()

START_TEST ( NtGdiSelectFont  )

Definition at line 10 of file NtGdiSelectFont.c.

11 {
12  HDC hDC;
13  HFONT hFont, hOldFont;
14 
15  hDC = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
16 
18 
19  /* Test NULL DC */
21  hOldFont = NtGdiSelectFont(NULL, hFont);
22  TEST(hOldFont == NULL);
24 
25  /* Test invalid DC */
27  hOldFont = NtGdiSelectFont((HDC)((ULONG_PTR)hDC & 0x0000ffff), hFont);
28  TEST(hOldFont == NULL);
30 
31  /* Test NULL font */
33  hOldFont = NtGdiSelectFont(hDC, NULL);
34  TEST(hOldFont == NULL);
36 
37  /* Test invalid font */
39  hOldFont = NtGdiSelectFont(hDC, (HFONT)((ULONG_PTR)hFont & 0x0000ffff));
40  TEST(hOldFont == NULL);
42 
44  hOldFont = NtGdiSelectFont(hDC, hFont);
45  TEST(hOldFont != NULL);
46  hOldFont = NtGdiSelectFont(hDC, hOldFont);
47  TEST(hOldFont == hFont);
49 
50 
51  DeleteDC(hDC);
52 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define ERROR_SUCCESS
Definition: deptool.c:10
static HDC
Definition: imagelist.c:92
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
HFONT hFont
Definition: main.c:53
uint32_t ULONG_PTR
Definition: typedefs.h:65
__kernel_entry W32KAPI HFONT APIENTRY NtGdiSelectFont(_In_ HDC hdc, _In_ HFONT hf)
Definition: dcobjs.c:597
#define TEST(x)
Definition: precomp.h:20
#define SetLastError(x)
Definition: compat.h:611
#define DEFAULT_GUI_FONT
Definition: wingdi.h:908
static const WCHAR L[]
Definition: oid.c:1250
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI DeleteDC(_In_ HDC)
#define NULL
Definition: types.h:112
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)