mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 06:58:10 +00:00
- Separate NtGdiHfontCreate to allow calling it direct without SEH.
svn path=/trunk/; revision=60389
This commit is contained in:
parent
bbf5eb22bd
commit
4490e12ecd
1 changed files with 56 additions and 36 deletions
|
@ -1003,6 +1003,61 @@ NtGdiGetRealizationInfo(
|
|||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
HFONT
|
||||
APIENTRY
|
||||
HfontCreate(
|
||||
IN PENUMLOGFONTEXDVW pelfw,
|
||||
IN ULONG cjElfw,
|
||||
IN LFTYPE lft,
|
||||
IN FLONG fl,
|
||||
IN PVOID pvCliData )
|
||||
{
|
||||
HFONT hNewFont;
|
||||
PLFONT plfont;
|
||||
|
||||
if (!pelfw)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
plfont = LFONT_AllocFontWithHandle();
|
||||
if (!plfont)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
hNewFont = plfont->BaseObject.hHmgr;
|
||||
|
||||
plfont->lft = lft;
|
||||
plfont->fl = fl;
|
||||
RtlCopyMemory (&plfont->logfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
|
||||
ExInitializePushLock(&plfont->lock);
|
||||
|
||||
if (pelfw->elfEnumLogfontEx.elfLogFont.lfEscapement !=
|
||||
pelfw->elfEnumLogfontEx.elfLogFont.lfOrientation)
|
||||
{
|
||||
/* This should really depend on whether GM_ADVANCED is set */
|
||||
plfont->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation =
|
||||
plfont->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement;
|
||||
}
|
||||
LFONT_UnlockFont(plfont);
|
||||
|
||||
if (pvCliData && hNewFont)
|
||||
{
|
||||
// FIXME: Use GDIOBJ_InsertUserData
|
||||
KeEnterCriticalRegion();
|
||||
{
|
||||
INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)hNewFont);
|
||||
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
|
||||
Entry->UserData = pvCliData;
|
||||
}
|
||||
KeLeaveCriticalRegion();
|
||||
}
|
||||
|
||||
return hNewFont;
|
||||
}
|
||||
|
||||
|
||||
HFONT
|
||||
APIENTRY
|
||||
NtGdiHfontCreate(
|
||||
|
@ -1013,8 +1068,6 @@ NtGdiHfontCreate(
|
|||
IN PVOID pvCliData )
|
||||
{
|
||||
ENUMLOGFONTEXDVW SafeLogfont;
|
||||
HFONT hNewFont;
|
||||
PLFONT plfont;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
/* Silence GCC warnings */
|
||||
|
@ -1042,40 +1095,7 @@ NtGdiHfontCreate(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
plfont = LFONT_AllocFontWithHandle();
|
||||
if (!plfont)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
hNewFont = plfont->BaseObject.hHmgr;
|
||||
|
||||
plfont->lft = lft;
|
||||
plfont->fl = fl;
|
||||
RtlCopyMemory (&plfont->logfont, &SafeLogfont, sizeof(ENUMLOGFONTEXDVW));
|
||||
ExInitializePushLock(&plfont->lock);
|
||||
|
||||
if (SafeLogfont.elfEnumLogfontEx.elfLogFont.lfEscapement !=
|
||||
SafeLogfont.elfEnumLogfontEx.elfLogFont.lfOrientation)
|
||||
{
|
||||
/* This should really depend on whether GM_ADVANCED is set */
|
||||
plfont->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation =
|
||||
plfont->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement;
|
||||
}
|
||||
LFONT_UnlockFont(plfont);
|
||||
|
||||
if (pvCliData && hNewFont)
|
||||
{
|
||||
// FIXME: Use GDIOBJ_InsertUserData
|
||||
KeEnterCriticalRegion();
|
||||
{
|
||||
INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)hNewFont);
|
||||
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
|
||||
Entry->UserData = pvCliData;
|
||||
}
|
||||
KeLeaveCriticalRegion();
|
||||
}
|
||||
|
||||
return hNewFont;
|
||||
return HfontCreate(&SafeLogfont, cjElfw, lft, fl, pvCliData);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue