Author: tkreuzer Date: Wed Dec 24 09:35:40 2008 New Revision: 38328
URL: http://svn.reactos.org/svn/reactos?rev=38328&view=rev Log: - Put Dx values at start of buffer to have alignemnt of 4 - increase size of stack buffer to 100, results in >90% buffer hits - Handle Dy values when ETO_PDY is specified (patch by Alexander Potashev, aspotashev at gmail dot com)
See issue #3958 for more details.
Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Wed Dec 24 09:35:40 2008 @@ -3603,6 +3603,12 @@ TextLeft += Dx[i<<DxShift] << 6; // DbgPrint("new TextLeft2: %d\n", TextLeft); } + + if (DxShift) + { + TextTop -= Dx[2 * i + 1] << 6; + } + previous = glyph_index;
String++; @@ -3651,7 +3657,7 @@ return FALSE; }
-#define STACK_TEXT_BUFFER_SIZE 50 +#define STACK_TEXT_BUFFER_SIZE 100 BOOL APIENTRY NtGdiExtTextOutW( @@ -3706,17 +3712,19 @@ /* Probe and copy user mode data to the buffer */ _SEH2_TRY { + /* Put the Dx before the String to assure alignment of 4 */ + SafeString = (LPWSTR)(((ULONG_PTR)Buffer) + DxSize); + /* Probe and copy the string */ ProbeForRead(UnsafeString, StringSize, 1); - SafeString = Buffer; memcpy((PVOID)SafeString, UnsafeString, StringSize);
/* If we have Dx values... */ if (UnsafeDx) { /* ... probe and copy them */ + SafeDx = Buffer; ProbeForRead(UnsafeDx, DxSize, 1); - SafeDx = (LPINT)(((ULONG_PTR)Buffer) + StringSize); memcpy(SafeDx, UnsafeDx, DxSize); } }