Author: jimtabor
Date: Thu Sep 26 23:59:19 2013
New Revision: 60389
URL: 
http://svn.reactos.org/svn/reactos?rev=60389&view=rev
Log:
- Separate NtGdiHfontCreate to allow calling it direct without SEH.
Modified:
    trunk/reactos/win32ss/gdi/ntgdi/font.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/font.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/font.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/font.c      [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/font.c      [iso-8859-1] Thu Sep 26 23:59:19 2013
@@ -1003,6 +1003,61 @@
   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 @@
   IN PVOID pvCliData )
 {
   ENUMLOGFONTEXDVW SafeLogfont;
-  HFONT hNewFont;
-  PLFONT plfont;
   NTSTATUS Status = STATUS_SUCCESS;
   /* Silence GCC warnings */
@@ -1042,40 +1095,7 @@
       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);
 }