[ros-diffs] [greatlrd] 28539: Fix : make AddFontResourceA acts like AddFontResourceW Fix : smaller typo in AddFontResourceW

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Sat Aug 25 13:34:16 CEST 2007


Author: greatlrd
Date: Sat Aug 25 15:34:16 2007
New Revision: 28539

URL: http://svn.reactos.org/svn/reactos?rev=28539&view=rev
Log:
Fix : make AddFontResourceA acts like AddFontResourceW
Fix : smaller typo in AddFontResourceW 

Modified:
    trunk/reactos/dll/win32/gdi32/objects/font.c

Modified: trunk/reactos/dll/win32/gdi32/objects/font.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/font.c?rev=28539&r1=28538&r2=28539&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/font.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/font.c Sat Aug 25 15:34:16 2007
@@ -1112,14 +1112,16 @@
 STDCALL
 AddFontResourceExA ( LPCSTR lpszFilename, DWORD fl, PVOID pvReserved )
 {
-  NTSTATUS Status;
-  PWSTR FilenameW;
-  int rc = 0;
-
-  Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
-  if ( !NT_SUCCESS (Status) )
-    SetLastError (RtlNtStatusToDosError(Status));
-  else
+    NTSTATUS Status;
+    PWSTR FilenameW;
+    int rc = 0;
+
+    Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
+    if ( !NT_SUCCESS (Status) )
+    {
+        SetLastError (RtlNtStatusToDosError(Status));
+    }
+    else
     {
       rc = AddFontResourceExW ( FilenameW, fl, pvReserved );
 
@@ -1136,7 +1138,22 @@
 STDCALL
 AddFontResourceA ( LPCSTR lpszFilename )
 {
-  return AddFontResourceExA ( lpszFilename, 0, 0 );
+    NTSTATUS Status;
+    PWSTR FilenameW;
+    int rc = 0;
+
+    Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
+    if ( !NT_SUCCESS (Status) )
+    {
+        SetLastError (RtlNtStatusToDosError(Status));
+    }
+    else
+    {
+      rc = GdiAddFontResourceW ( FilenameW, 0, 0);
+
+      HEAP_free ( FilenameW );
+    }
+    return rc;
 }
 
 
@@ -1147,7 +1164,7 @@
 STDCALL
 AddFontResourceW ( LPCWSTR lpszFilename )
 {
-	return AddFontResourceExW ( lpszFilename, 0, 0 );
+	return GdiAddFontResourceW ( lpszFilename, 0, 0 );
 }
 
 




More information about the Ros-diffs mailing list