Author: tfaber
Date: Mon Oct 13 14:06:40 2014
New Revision: 64720

URL: http://svn.reactos.org/svn/reactos?rev=64720&view=rev
Log:
[GDI32]
- Return 1 on failure in IntEnumFontFamilies, as shown by the test
CORE-8628 #resolve

Modified:
    trunk/reactos/win32ss/gdi/gdi32/objects/font.c
    trunk/rostests/apitests/gdi32/EnumFontFamilies.c

Modified: trunk/reactos/win32ss/gdi/gdi32/objects/font.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/font.c?rev=64720&r1=64719&r2=64720&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/gdi32/objects/font.c      [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/gdi32/objects/font.c      [iso-8859-1] Mon Oct 13 
14:06:40 2014
@@ -206,7 +206,7 @@
     int FontFamilyCount;
     int FontFamilySize;
     PFONTFAMILYINFO Info;
-    int Ret = 0;
+    int Ret = 1;
     int i;
     ENUMLOGFONTEXA EnumLogFontExA;
     NEWTEXTMETRICEXA NewTextMetricExA;
@@ -216,7 +216,7 @@
                            INITIAL_FAMILY_COUNT * sizeof(FONTFAMILYINFO));
     if (NULL == Info)
     {
-        return 0;
+        return 1;
     }
 
     if (!LogFont)
@@ -231,7 +231,7 @@
     if (FontFamilyCount < 0)
     {
         RtlFreeHeap(GetProcessHeap(), 0, Info);
-        return 0;
+        return 1;
     }
     if (INITIAL_FAMILY_COUNT < FontFamilyCount)
     {
@@ -241,13 +241,13 @@
                                FontFamilyCount * sizeof(FONTFAMILYINFO));
         if (NULL == Info)
         {
-            return 0;
+            return 1;
         }
         FontFamilyCount = NtGdiGetFontFamilyInfo(Dc, LogFont, Info, 
FontFamilySize);
         if (FontFamilyCount < 0 || FontFamilySize < FontFamilyCount)
         {
             RtlFreeHeap(GetProcessHeap(), 0, Info);
-            return 0;
+            return 1;
         }
     }
 

Modified: trunk/rostests/apitests/gdi32/EnumFontFamilies.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/EnumFontFamilies.c?rev=64720&r1=64719&r2=64720&view=diff
==============================================================================
--- trunk/rostests/apitests/gdi32/EnumFontFamilies.c    [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/EnumFontFamilies.c    [iso-8859-1] Mon Oct 13 
14:06:40 2014
@@ -74,7 +74,7 @@
                             EnumProcA,
                             (LPARAM)&ContextContinue);
     error = GetLastError();
-    ok(ret == 1, "ret is %d, expected 0\n", ret);
+    ok(ret == 1, "ret is %d, expected 1\n", ret);
     ok(error == 0xdeadbeef, "error is %lu\n", error);
     ok(EnumProcCalls == 0, "EnumProcCalls is %d\n", EnumProcCalls);
 }
@@ -95,7 +95,7 @@
                             EnumProcW,
                             (LPARAM)&ContextContinue);
     error = GetLastError();
-    ok(ret == 1, "ret is %d, expected 0\n", ret);
+    ok(ret == 1, "ret is %d, expected 1\n", ret);
     ok(error == 0xdeadbeef, "error is %lu\n", error);
     ok(EnumProcCalls == 0, "EnumProcCalls is %d\n", EnumProcCalls);
 }
@@ -122,7 +122,7 @@
                               (LPARAM)&ContextContinue,
                               0);
     error = GetLastError();
-    ok(ret == 1, "ret is %d, expected 0\n", ret);
+    ok(ret == 1, "ret is %d, expected 1\n", ret);
     ok(error == 0xdeadbeef, "error is %lu\n", error);
     ok(EnumProcCalls == 0, "EnumProcCalls is %d\n", EnumProcCalls);
 }
@@ -149,7 +149,7 @@
                               (LPARAM)&ContextContinue,
                               0);
     error = GetLastError();
-    ok(ret == 1, "ret is %d, expected 0\n", ret);
+    ok(ret == 1, "ret is %d, expected 1\n", ret);
     ok(error == 0xdeadbeef, "error is %lu\n", error);
     ok(EnumProcCalls == 0, "EnumProcCalls is %d\n", EnumProcCalls);
 }


Reply via email to