Author: greatlrd
Date: Sat Aug 25 15:38:35 2007
New Revision: 28540
URL:
http://svn.reactos.org/svn/reactos?rev=28540&view=rev
Log:
make AddFontResourceExA lite faster.
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/fo…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/font.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/font.c Sat Aug 25 15:38:35 2007
@@ -1116,16 +1116,22 @@
PWSTR FilenameW;
int rc = 0;
- Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
- if ( !NT_SUCCESS (Status) )
- {
- SetLastError (RtlNtStatusToDosError(Status));
+ if (!(fl & (FR_PRIVATE | FR_NOT_ENUM)))
+ {
+ SetLastError( ERROR_INVALID_PARAMETER );
}
else
{
- rc = AddFontResourceExW ( FilenameW, fl, pvReserved );
-
- HEAP_free ( FilenameW );
+ Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
+ if ( !NT_SUCCESS (Status) )
+ {
+ SetLastError (RtlNtStatusToDosError(Status));
+ }
+ else
+ {
+ rc = GdiAddFontResourceW ( FilenameW, fl, 0 );
+ HEAP_free ( FilenameW );
+ }
}
return rc;
}