[ROSTESTS]
[reactos.git] / rostests / apitests / w32knapi / ntgdi / NtGdiEnumFontOpen.c
1
2 INT
3 Test_NtGdiEnumFontOpen(PTESTINFO pti)
4 {
5 HDC hDC;
6 ULONG_PTR idEnum;
7 ULONG ulCount;
8 PGDI_TABLE_ENTRY pEntry;
9
10 hDC = CreateDCW(L"DISPLAY",NULL,NULL,NULL);
11
12 // FIXME: We should load the font first
13
14 idEnum = NtGdiEnumFontOpen(hDC, 2, 0, 32, L"Courier", ANSI_CHARSET, &ulCount);
15 ASSERT(idEnum != 0);
16
17 /* we should have a gdi handle here */
18 TEST(GDI_HANDLE_GET_TYPE(idEnum) == GDI_OBJECT_TYPE_ENUMFONT);
19 pEntry = &GdiHandleTable[GDI_HANDLE_GET_INDEX(idEnum)];
20 TEST(pEntry->KernelData != NULL);
21 TEST(pEntry->ProcessId == GetCurrentProcessId());
22 TEST(pEntry->UserData == 0);
23 TEST(pEntry->Type == ((idEnum >> 16) | GDI_OBJECT_TYPE_ENUMFONT));
24
25 /* We should not be able to use DeleteObject() on the handle */
26 TEST(DeleteObject((HGDIOBJ)idEnum) == FALSE);
27
28 NtGdiEnumFontClose(idEnum);
29
30 // Test no logfont (NULL): should word
31 // Test empty lfFaceName string: should not work
32
33
34 return APISTATUS_NORMAL;
35 }
36