ReactOS 0.4.16-dev-838-g27bb510
NtGdiEnumFontOpen.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 NtGdiEnumFontOpen
5 * PROGRAMMERS:
6 */
7
8#include "../win32nt.h"
9
11{
12 HDC hDC;
13 ULONG_PTR idEnum;
14 ULONG ulCount;
16
17 DWORD dwOsVer = NtCurrentPeb()->OSMajorVersion << 8 | NtCurrentPeb()->OSMinorVersion;
18 if (dwOsVer >= _WIN32_WINNT_WIN7)
19 {
20 skip("NtGdiEnumFontOpen is not supported on Windows 7 or later\n");
21 return;
22 }
23
24 hDC = CreateDCW(L"DISPLAY",NULL,NULL,NULL);
25
26 // FIXME: We should load the font first
27
28 idEnum = NtGdiEnumFontOpen(hDC, 2, 0, 32, L"Courier", ANSI_CHARSET, &ulCount);
29 ok(idEnum != 0, "idEnum was 0.\n");
30 if (idEnum == 0)
31 {
32 skip("idEnum == 0\n");
33 return;
34 }
35
36 /* we should have a gdi handle here */
39 ok(pEntry->einfo.pobj != NULL, "pEntry->einfo.pobj was NULL.\n");
40 ok_long(pEntry->ObjectOwner.ulObj, GetCurrentProcessId());
41 ok_ptr(pEntry->pUser, NULL);
42 ok_int(pEntry->FullUnique, (idEnum >> 16) & 0xFFFF);
44 ok_int(pEntry->Flags, 0);
45
46 /* We should not be able to use DeleteObject() on the handle */
48
49 NtGdiEnumFontClose(idEnum);
50
51 // Test no logfont (NULL): should word
52 // Test empty lfFaceName string: should not work
53}
static HDC hDC
Definition: 3dtext.c:33
#define NtCurrentPeb()
Definition: FLS.c:22
#define ok_long(expression, result)
Definition: atltest.h:133
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
#define ok_ptr(expression, result)
Definition: atltest.h:108
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
pKey DeleteObject()
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
static HDC
Definition: imagelist.c:88
__kernel_entry W32KAPI BOOL APIENTRY NtGdiEnumFontClose(_In_ ULONG_PTR idEnum)
__kernel_entry W32KAPI ULONG_PTR APIENTRY NtGdiEnumFontOpen(_In_ HDC hdc, _In_ ULONG iEnumType, _In_ FLONG flWin31Compat, _In_ ULONG cwchMax, _In_opt_ LPWSTR pwszFaceName, _In_ ULONG lfCharSet, _Out_ ULONG *pulCount)
#define GDI_OBJECT_TYPE_ENUMFONT
Definition: ntgdihdl.h:62
#define L(x)
Definition: ntvdm.h:50
#define _WIN32_WINNT_WIN7
Definition: sdkddkver.h:28
Definition: ntgdihdl.h:218
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
#define GdiHandleTable
Definition: win32nt.h:37
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
#define ANSI_CHARSET
Definition: wingdi.h:383
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)