From 25e902187c059b6534d7f9e1682d48575d97e52a Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 26 Apr 2007 04:34:46 +0000 Subject: [PATCH] Update FontGetObject, point out required modifications to support ENUMLOGFONTEXDVW for font objects. svn path=/trunk/; revision=26511 --- .../subsystems/win32/win32k/objects/text.c | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/text.c b/reactos/subsystems/win32/win32k/objects/text.c index 92eabe233e4..adb750dd82d 100644 --- a/reactos/subsystems/win32/win32k/objects/text.c +++ b/reactos/subsystems/win32/win32k/objects/text.c @@ -4108,12 +4108,39 @@ FontGetObject(PTEXTOBJ Font, INT Count, PVOID Buffer) { if( Buffer == NULL ) return sizeof(LOGFONTW); - /* fixme SetLastWin32Error(ERROR_BUFFER_OVERFLOW); in count<0*/ - if (Count < sizeof(LOGFONTW)) return 0; - if (Count > sizeof(LOGFONTW)) Count = sizeof(LOGFONTW); + switch (Count) + { +/* Everything will need to be converted over to ENUMLOGFONTEXDVW. + case sizeof(ENUMLOGFONTEXDVW): + RtlCopyMemory( (LPENUMLOGFONTEXDVW) Buffer.elfDesignVector, + &Font->logFont.elfDesignVector, + sizeof(DESIGNVECTOR)); + case sizeof(ENUMLOGFONTEXW): + RtlCopyMemory( (LPENUMLOGFONTEXW) Buffer, + &Font->logFont.elfEnumLogfontEx, + sizeof(ENUMLOGFONTEXW)); + break; - RtlCopyMemory(Buffer, &Font->logfont, sizeof(LOGFONTW)); - return sizeof(LOGFONTW); + case sizeof(EXTLOGFONTW): + case sizeof(ENUMLOGFONTW): + RtlCopyMemory((LPENUMLOGFONTW) Buffer, + (LPENUMLOGFONTW) &Font->logfont.elfEnumLogfontEx.elfLogFont, + sizeof(ENUMLOGFONTW)); + break; +*/ + case sizeof(LOGFONTW): +/* RtlCopyMemory((LPLOGFONTW) Buffer, + &Font->logFont.elfEnumLogfontEx.elfLogFont, + sizeof(LOGFONTW)); +*/ + RtlCopyMemory(Buffer, &Font->logfont, sizeof(LOGFONTW)); + break; + + default: + SetLastWin32Error(ERROR_BUFFER_OVERFLOW); + return 0; + } + return Count; }