RESEND: Page Fault With Freetype calls fixed

Rein Klazes wijn at wanadoo.nl
Wed Nov 23 05:19:50 CST 2005


Hi,

Not included in the new release, no comments. Is there a problem with
this one ?

Changelog:
dlls/gdi	: font.c
Make GetFontData return the actual number of bytes put in the buffer.

Rein.
-------------- next part --------------
--- wine/dlls/gdi/font.c	2005-11-09 09:34:03.000000000 +0100
+++ mywine/dlls/gdi/font.c	2005-11-16 18:31:34.000000000 +0100
@@ -2588,9 +2588,17 @@ DWORD WINAPI GetFontData(HDC hdc, DWORD 
 
     if(!dc) return GDI_ERROR;
 
-    if(dc->gdiFont)
-      ret = WineEngGetFontData(dc->gdiFont, table, offset, buffer, length);
-
+    if(dc->gdiFont) {
+        /* GetFontData must return the actual size of the data, 
+         * WineEngGetFontData only returns that when called with size
+         * zero, otherwise it returns the supplied size. Therefore we must
+         * call it twice. */
+        if( buffer && length) {
+          ret = WineEngGetFontData( dc->gdiFont, table, offset, NULL, 0);
+          if( ret < length) length = ret; 
+        }
+        ret = WineEngGetFontData(dc->gdiFont, table, offset, buffer, length);
+    }
     GDI_ReleaseObj(hdc);
     return ret;
 }


More information about the wine-patches mailing list