Commit 03ccce70 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdi32: Improve GetFontFileInfo() compatibility.

parent 65ef40bf
......@@ -727,7 +727,7 @@ struct font_fileinfo {
/* Undocumented gdi32 exports, used to access actually selected font information */
extern BOOL WINAPI GetFontRealizationInfo(HDC hdc, struct font_realization_info *info);
extern BOOL WINAPI GetFontFileInfo(DWORD instance_id, DWORD unknown, struct font_fileinfo *info, DWORD size, DWORD *needed);
extern BOOL WINAPI GetFontFileInfo(DWORD instance_id, DWORD unknown, struct font_fileinfo *info, SIZE_T size, SIZE_T *needed);
static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface,
HDC hdc, IDWriteFontFace **fontface)
......@@ -740,7 +740,7 @@ static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop1 *iface
IDWriteFontFile *file;
BOOL is_supported;
UINT32 facenum;
DWORD needed;
SIZE_T needed;
HRESULT hr;
TRACE("(%p)->(%p %p)\n", This, hdc, fontface);
......
......@@ -8576,9 +8576,10 @@ static BOOL freetype_GetFontRealizationInfo( PHYSDEV dev, void *ptr )
/*************************************************************************
* GetFontFileInfo (GDI32.@)
*/
BOOL WINAPI GetFontFileInfo( DWORD instance_id, DWORD unknown, struct font_fileinfo *info, DWORD size, DWORD *needed )
BOOL WINAPI GetFontFileInfo( DWORD instance_id, DWORD unknown, struct font_fileinfo *info, SIZE_T size, SIZE_T *needed )
{
struct font_handle_entry *entry = handle_entry( instance_id );
SIZE_T required_size;
const GdiFont *font;
if (!entry)
......@@ -8587,6 +8588,9 @@ BOOL WINAPI GetFontFileInfo( DWORD instance_id, DWORD unknown, struct font_filei
return FALSE;
}
if (!needed)
needed = &required_size;
font = entry->obj;
*needed = sizeof(*info) + strlenW(font->fileinfo->path) * sizeof(WCHAR);
if (*needed > size)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment