Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers...
[reactos.git] / modules / rostests / apitests / win32nt / ntgdi / NtGdiEnumFontOpen.c
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
10 START_TEST(NtGdiEnumFontOpen)
11 {
12 HDC hDC;
13 ULONG_PTR idEnum;
14 ULONG ulCount;
15 PENTRY pEntry;
16
17 hDC = CreateDCW(L"DISPLAY",NULL,NULL,NULL);
18
19 // FIXME: We should load the font first
20
21 idEnum = NtGdiEnumFontOpen(hDC, 2, 0, 32, L"Courier", ANSI_CHARSET, &ulCount);
22 TEST(idEnum != 0);
23 if (idEnum == 0)
24 return;
25
26 /* we should have a gdi handle here */
27 TEST(GDI_HANDLE_GET_TYPE(idEnum) == GDI_OBJECT_TYPE_ENUMFONT);
28 pEntry = &GdiHandleTable[GDI_HANDLE_GET_INDEX(idEnum)];
29 TEST(pEntry->einfo.pobj != NULL);
30 TEST(pEntry->ObjectOwner.ulObj == GetCurrentProcessId());
31 TEST(pEntry->pUser == NULL);
32 TEST(pEntry->FullUnique == (idEnum >> 16));
33 TEST(pEntry->Objt == GDI_OBJECT_TYPE_ENUMFONT >> 16);
34 TEST(pEntry->Flags == 0);
35
36 /* We should not be able to use DeleteObject() on the handle */
37 TEST(DeleteObject((HGDIOBJ)idEnum) == FALSE);
38
39 NtGdiEnumFontClose(idEnum);
40
41 // Test no logfont (NULL): should word
42 // Test empty lfFaceName string: should not work
43
44 }
45