mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 06:21:42 +00:00
make AddFontResourceExA lite faster.
svn path=/trunk/; revision=28540
This commit is contained in:
parent
2b7a66234a
commit
850675cbdd
1 changed files with 12 additions and 6 deletions
|
@ -1116,16 +1116,22 @@ AddFontResourceExA ( LPCSTR lpszFilename, DWORD fl, PVOID pvReserved )
|
|||
PWSTR FilenameW;
|
||||
int rc = 0;
|
||||
|
||||
Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
|
||||
if ( !NT_SUCCESS (Status) )
|
||||
if (!(fl & (FR_PRIVATE | FR_NOT_ENUM)))
|
||||
{
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue