diff --git a/include/font.h b/include/font.h index e6291269e3d..a1bc16a2422 100644 --- a/include/font.h +++ b/include/font.h @@ -58,7 +58,7 @@ typedef struct { extern BOOL32 FONT_Init( UINT16* pTextCaps ); extern INT16 FONT_GetObject16( FONTOBJ * font, INT16 count, LPSTR buffer ); extern INT32 FONT_GetObject32A( FONTOBJ * font, INT32 count, LPSTR buffer ); - +extern INT32 FONT_GetObject32W( FONTOBJ * font, INT32 count, LPSTR buffer ); extern void FONT_LogFont32ATo16( const LOGFONT32A* font32, LPLOGFONT16 font16 ); extern void FONT_LogFont32WTo16( const LOGFONT32W* font32, LPLOGFONT16 font16 ); extern void FONT_LogFont16To32A( const LPLOGFONT16 font16, LPLOGFONT32A font32 ); diff --git a/objects/font.c b/objects/font.c index a51b7b89d11..7c966f1ac91 100644 --- a/objects/font.c +++ b/objects/font.c @@ -343,6 +343,19 @@ INT32 FONT_GetObject32A( FONTOBJ *font, INT32 count, LPSTR buffer ) memcpy( buffer, &fnt32, count ); return count; } +/*********************************************************************** + * FONT_GetObject32W + */ +INT32 FONT_GetObject32W( FONTOBJ *font, INT32 count, LPSTR buffer ) +{ + LOGFONT32W fnt32; + + FONT_LogFont16To32W( &font->logfont, &fnt32 ); + + if (count > sizeof(fnt32)) count = sizeof(fnt32); + memcpy( buffer, &fnt32, count ); + return count; +} /*********************************************************************** diff --git a/objects/gdiobj.c b/objects/gdiobj.c index fce6c50789a..88242e4ab29 100644 --- a/objects/gdiobj.c +++ b/objects/gdiobj.c @@ -478,6 +478,47 @@ INT32 WINAPI GetObject32A( HANDLE32 handle, INT32 count, LPVOID buffer ) GDI_HEAP_UNLOCK( handle ); return result; } +/*********************************************************************** + * GetObject32W (GDI32.206) + */ +INT32 WINAPI GetObject32W( HANDLE32 handle, INT32 count, LPVOID buffer ) +{ + GDIOBJHDR * ptr = NULL; + INT32 result = 0; + TRACE(gdi, "%08x %d %p\n", handle, count, buffer ); + if (!count) return 0; + + if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE)) + ptr = StockObjects[handle - FIRST_STOCK_HANDLE]; + else + ptr = (GDIOBJHDR *) GDI_HEAP_LOCK( handle ); + if (!ptr) return 0; + + switch(ptr->wMagic) + { + case PEN_MAGIC: + result = PEN_GetObject32( (PENOBJ *)ptr, count, buffer ); + break; + case BRUSH_MAGIC: + result = BRUSH_GetObject32( (BRUSHOBJ *)ptr, count, buffer ); + break; + case BITMAP_MAGIC: + result = BITMAP_GetObject32( (BITMAPOBJ *)ptr, count, buffer ); + break; + case FONT_MAGIC: + result = FONT_GetObject32W( (FONTOBJ *)ptr, count, buffer ); + break; + case PALETTE_MAGIC: + result = PALETTE_GetObject( (PALETTEOBJ *)ptr, count, buffer ); + break; + default: + FIXME(gdi, "Magic %04x not implemented\n", + ptr->wMagic ); + break; + } + GDI_HEAP_UNLOCK( handle ); + return result; +} /*********************************************************************** * GetObjectType (GDI32.205) @@ -536,14 +577,6 @@ DWORD WINAPI GetObjectType( HANDLE32 handle ) return result; } -/*********************************************************************** - * GetObject32W (GDI32.206) - */ -INT32 WINAPI GetObject32W( HANDLE32 handle, INT32 count, LPVOID buffer ) -{ - return GetObject32A( handle, count, buffer ); -} - /*********************************************************************** * GetCurrentObject (GDI32.166) */