"Mikolaj Zalewski" mikolajz@google.com writes:
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index c516736..efc044b 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3214,8 +3214,18 @@ BOOL WINAPI RemoveFontResourceW( LPCWSTR */ HANDLE WINAPI AddFontMemResourceEx( PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD *pcFonts) {
- FIXME("(%p,%08x,%p,%p): stub\n", pbFont, cbFont, pdv, pcFonts);
- return NULL;
- PVOID pFontCopy = HeapAlloc(GetProcessHeap(), 0, cbFont);
- HANDLE ret;
- TRACE("Copying %d bytes of data from %p to %p\n", cbFont, pbFont, pFontCopy);
- memcpy(pFontCopy, pbFont, cbFont);
- ret = WineEngAddFontMemResourceEx(pFontCopy, cbFont, pdv, pcFonts);
- if (ret == NULL)
- {
TRACE("Font create failed - freeing %p\n", pFontCopy);
HeapFree(GetProcessHeap(), 0, pFontCopy);
- }
- return ret;
}
The memory copy should be done in WineEngAddFontMemResourceEx since that's where the data is managed.