From e8648f8a003cf4679288107de063544e25c328b9 Mon Sep 17 00:00:00 2001 From: Alexander Potashev Date: Sun, 21 Dec 2008 19:36:05 +0300 Subject: [PATCH] make NtGdiExtTextOutW support ETO_PDY flag --- subsystems/win32/win32k/objects/freetype.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/subsystems/win32/win32k/objects/freetype.c b/subsystems/win32/win32k/objects/freetype.c index af69675..55e9c53 100644 --- a/subsystems/win32/win32k/objects/freetype.c +++ b/subsystems/win32/win32k/objects/freetype.c @@ -3131,6 +3131,7 @@ NtGdiExtTextOutW( BOOLEAN Render; NTSTATUS Status; INT *Dx = NULL; + int DxPairs; // 1 if ETO_PDY flag is used, 0 otherwise POINT Start; BOOL DoBreak = FALSE; LPCWSTR String, SafeString = NULL; @@ -3175,14 +3176,17 @@ NtGdiExtTextOutW( } String = SafeString; + DxPairs = 0; if (NULL != UnsafeDx && Count > 0) { - Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), TAG_GDITEXT); + if (fuOptions & ETO_PDY) + DxPairs = 1; + Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT) << DxPairs, TAG_GDITEXT); if (NULL == Dx) { goto fail; } - Status = MmCopyFromCaller(Dx, UnsafeDx, Count * sizeof(INT)); + Status = MmCopyFromCaller(Dx, UnsafeDx, Count * sizeof(INT) << DxPairs); if (!NT_SUCCESS(Status)) { goto fail; @@ -3638,9 +3642,15 @@ NtGdiExtTextOutW( } else { - TextLeft += Dx[i] << 6; + TextLeft += Dx[i << DxPairs] << 6; // DbgPrint("new TextLeft2: %d\n", TextLeft); } + + if (DxPairs) + { + TextTop -= Dx[2 * i + 1] << 6; + } + previous = glyph_index; String++; -- 1.6.0.4