From 746ac9c64441a8878fa5f266c945dd534f353b5e Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 9 Mar 2008 19:04:26 +0000 Subject: [PATCH] partly implement gdi32 Escape implemented command GETCOLORTABLE and GETEXTENDEDTEXTMETRICS in Escape MS have releae docs over this api in msdn, u can also found docs in nt4 ddk and win98 ddk how this api works. and thanks to Filip and Blight that have explain how this api works time to time, in gdi32 svn path=/trunk/; revision=32628 --- reactos/dll/win32/gdi32/misc/stubs.c | 51 ++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index b3d9fa8b84b..1bf2602a0f9 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -178,17 +178,7 @@ EnumObjects(HDC hdc, return 0; } -/* - * @unimplemented - */ -int -STDCALL -Escape(HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out_data) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} + /* * @implemented @@ -1505,6 +1495,45 @@ GetETM(HDC hdc, return Ret; } +/* + * @unimplemented + */ +int +STDCALL +Escape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpvInData, LPVOID lpvOutData) +{ + int retValue = -1; + + /* FIXME gdi share memory */ + + if (nEscape == GETCOLORTABLE) + { + retValue = GetSystemPaletteEntries(hdc, (UINT)*lpvInData, 1, (LPPALETTEENTRY)lpvOutData); + if ( !retValue ) + { + retValue = -1; + } + + /* FIXME tempary until Escape are completed */ + return retValue; + } + else if (nEscape == GETEXTENDEDTEXTMETRICS) + { + retValue = (int) GetETM( hdc, (EXTTEXTMETRIC *) lpvOutData) != 0; + + /* FIXME tempary until Escape are completed */ + return retValue; + } + else if ( nEscape != QUERYESCSUPPORT ) + { + + } + + UNIMPLEMENTED; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return retValue; +} + /* * @unimplemented */