[PATCH] stop gdi font test crashing under win98

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue Jun 10 07:20:55 CDT 2008


---
 dlls/gdi32/tests/font.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 710148a..c42350e 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1319,6 +1319,9 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
      */
     if (!*font_name && font_charset == DEFAULT_CHARSET) /* do it only once */
     {
+        LOGFONT lf;
+        memset(&lf, 0, sizeof(LOGFONT));
+        
         efd.total = 0;
         SetLastError(0xdeadbeef);
         ret = EnumFontFamilies(hdc, NULL, arial_enum_proc, (LPARAM)&efd);
@@ -1333,7 +1336,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset)
 
         efd.total = 0;
         SetLastError(0xdeadbeef);
-        ret = EnumFontFamiliesEx(hdc, NULL, arial_enum_proc, (LPARAM)&efd, 0);
+        ret = EnumFontFamiliesEx(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0);
         ok(ret, "EnumFontFamiliesEx error %u\n", GetLastError());
         get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset);
         trace("enumerated ansi %d, symbol %d, russian %d fonts for NULL\n",
@@ -1502,6 +1505,12 @@ static void test_negative_width(HDC hdc, const LOGFONTA *lf)
     LOGFONTA lf2 = *lf;
     WORD idx;
     MAT2 mat = { {0,1}, {0,0}, {0,0}, {0,1} };
+    
+    if(!pGetGlyphIndicesA)
+    {
+        skip("GetGlyphIndicesA not available\n");
+        return;
+    }
 
     /* negative widths are handled just as positive ones */
     lf2.lfWidth = -lf->lfWidth;
-- 
1.5.4.1


--------------010304040007030901000707--




More information about the wine-patches mailing list