Author: tkreuzer
Date: Sun Sep 2 03:11:16 2007
New Revision: 28754
URL:
http://svn.reactos.org/svn/reactos?rev=28754&view=rev
Log:
Revert wars! ;-)
I talked with GL, he agrees, it is correct.
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 Sun Sep 2 03:11:16 2007
@@ -1091,17 +1091,13 @@
STDCALL
AddFontResourceExW ( LPCWSTR lpszFilename, DWORD fl, PVOID pvReserved )
{
- int retVal = 0;
-
- if (fl & (FR_PRIVATE | FR_NOT_ENUM))
- {
- retVal = GdiAddFontResourceW(lpszFilename, fl,0);
- }
- else
+ if (fl & ~(FR_PRIVATE | FR_NOT_ENUM))
{
SetLastError( ERROR_INVALID_PARAMETER );
- }
- return retVal;
+ return 0;
+ }
+
+ return GdiAddFontResourceW(lpszFilename, fl,0);
}
@@ -1114,26 +1110,24 @@
{
NTSTATUS Status;
PWSTR FilenameW;
- int rc = 0;
-
- if (!(fl & (FR_PRIVATE | FR_NOT_ENUM)))
+ int rc;
+
+ if (fl & ~(FR_PRIVATE | FR_NOT_ENUM))
{
SetLastError( ERROR_INVALID_PARAMETER );
- }
- else
- {
- Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
- if ( !NT_SUCCESS (Status) )
- {
- SetLastError (RtlNtStatusToDosError(Status));
- }
- else
- {
- rc = GdiAddFontResourceW ( FilenameW, fl, 0 );
- HEAP_free ( FilenameW );
- }
- }
- return rc;
+ return 0;
+ }
+
+ Status = HEAP_strdupA2W ( &FilenameW, lpszFilename );
+ if ( !NT_SUCCESS (Status) )
+ {
+ SetLastError (RtlNtStatusToDosError(Status));
+ return 0;
+ }
+
+ rc = GdiAddFontResourceW ( FilenameW, fl, 0 );
+ HEAP_free ( FilenameW );
+ return rc;
}