From 2b7a66234abd1047491be2fe0fbd90c44b95a136 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 25 Aug 2007 11:34:16 +0000 Subject: [PATCH] Fix : make AddFontResourceA acts like AddFontResourceW Fix : smaller typo in AddFontResourceW svn path=/trunk/; revision=28539 --- reactos/dll/win32/gdi32/objects/font.c | 35 +++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/reactos/dll/win32/gdi32/objects/font.c b/reactos/dll/win32/gdi32/objects/font.c index 873a60b16f3..86e79e1ba77 100644 --- a/reactos/dll/win32/gdi32/objects/font.c +++ b/reactos/dll/win32/gdi32/objects/font.c @@ -1112,14 +1112,16 @@ int STDCALL AddFontResourceExA ( LPCSTR lpszFilename, DWORD fl, PVOID pvReserved ) { - NTSTATUS Status; - PWSTR FilenameW; - int rc = 0; + NTSTATUS Status; + PWSTR FilenameW; + int rc = 0; - Status = HEAP_strdupA2W ( &FilenameW, lpszFilename ); - if ( !NT_SUCCESS (Status) ) - SetLastError (RtlNtStatusToDosError(Status)); - else + Status = HEAP_strdupA2W ( &FilenameW, lpszFilename ); + if ( !NT_SUCCESS (Status) ) + { + SetLastError (RtlNtStatusToDosError(Status)); + } + else { rc = AddFontResourceExW ( FilenameW, fl, pvReserved ); @@ -1136,7 +1138,22 @@ int 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 @@ int STDCALL AddFontResourceW ( LPCWSTR lpszFilename ) { - return AddFontResourceExW ( lpszFilename, 0, 0 ); + return GdiAddFontResourceW ( lpszFilename, 0, 0 ); }