2015-12-28 20:31:10 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS api tests
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* PURPOSE: Test for NtGdiEnumFontOpen
|
|
|
|
* PROGRAMMERS:
|
|
|
|
*/
|
2008-06-01 18:06:22 +00:00
|
|
|
|
2015-12-28 20:31:10 +00:00
|
|
|
#include <win32nt.h>
|
|
|
|
|
|
|
|
START_TEST(NtGdiEnumFontOpen)
|
2008-06-01 18:06:22 +00:00
|
|
|
{
|
|
|
|
HDC hDC;
|
|
|
|
ULONG_PTR idEnum;
|
|
|
|
ULONG ulCount;
|
2015-12-28 20:31:10 +00:00
|
|
|
PENTRY pEntry;
|
2008-06-01 18:06:22 +00:00
|
|
|
|
|
|
|
hDC = CreateDCW(L"DISPLAY",NULL,NULL,NULL);
|
|
|
|
|
|
|
|
// FIXME: We should load the font first
|
|
|
|
|
|
|
|
idEnum = NtGdiEnumFontOpen(hDC, 2, 0, 32, L"Courier", ANSI_CHARSET, &ulCount);
|
|
|
|
ASSERT(idEnum != 0);
|
|
|
|
|
|
|
|
/* we should have a gdi handle here */
|
|
|
|
TEST(GDI_HANDLE_GET_TYPE(idEnum) == GDI_OBJECT_TYPE_ENUMFONT);
|
|
|
|
pEntry = &GdiHandleTable[GDI_HANDLE_GET_INDEX(idEnum)];
|
2015-12-28 20:31:10 +00:00
|
|
|
TEST(pEntry->einfo.pobj != NULL);
|
|
|
|
TEST(pEntry->ObjectOwner.ulObj == GetCurrentProcessId());
|
|
|
|
TEST(pEntry->pUser == NULL);
|
|
|
|
TEST(pEntry->FullUnique == (idEnum >> 16));
|
|
|
|
TEST(pEntry->Objt == GDI_OBJECT_TYPE_ENUMFONT >> 16);
|
|
|
|
TEST(pEntry->Flags == 0);
|
2008-06-01 18:06:22 +00:00
|
|
|
|
|
|
|
/* We should not be able to use DeleteObject() on the handle */
|
|
|
|
TEST(DeleteObject((HGDIOBJ)idEnum) == FALSE);
|
|
|
|
|
|
|
|
NtGdiEnumFontClose(idEnum);
|
|
|
|
|
|
|
|
// Test no logfont (NULL): should word
|
|
|
|
// Test empty lfFaceName string: should not work
|
|
|
|
|
|
|
|
}
|
|
|
|
|