Author: jimtabor
Date: Thu Nov 6 05:55:08 2008
New Revision: 37223
URL:
http://svn.reactos.org/svn/reactos?rev=37223&view=rev
Log:
- Fix WidenPath. Now Area.exe runs and crashes when using real hardware. That is a good
thing. We now know our Xorg based region code has problems. It allocates all the memory
building PolyPolygon region data.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/path.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/path.c [iso-8859-1] Thu Nov 6 05:55:08
2008
@@ -1490,9 +1490,9 @@
FASTCALL
PATH_WidenPath(DC *dc)
{
- INT i, j, numStrokes, penWidth, penWidthIn, penWidthOut, size, penStyle;
+ INT i, j, numStrokes, numOldStrokes, penWidth, penWidthIn, penWidthOut, size,
penStyle;
BOOL ret = FALSE;
- PPATH pPath, pNewPath, *pStrokes, pUpPath, pDownPath;
+ PPATH pPath, pNewPath, *pStrokes, *pOldStrokes, pUpPath, pDownPath;
EXTLOGPEN *elp;
DWORD obj_type, joint, endcap, penType;
PDC_ATTR Dc_Attr = dc->pDc_Attr;
@@ -1560,6 +1560,7 @@
penWidthOut++;
numStrokes = 0;
+ numOldStrokes = 1;
pStrokes = ExAllocatePoolWithTag(PagedPool, sizeof(PPATH), TAG_PATH);
pStrokes[0] = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
@@ -1588,8 +1589,11 @@
}
numStrokes++;
j = 0;
- ExFreePoolWithTag(pStrokes, TAG_PATH);
+ pOldStrokes = pStrokes; // Save old pointer.
pStrokes = ExAllocatePoolWithTag(PagedPool, numStrokes * sizeof(PPATH),
TAG_PATH);
+ RtlCopyMemory(pStrokes, pOldStrokes, numOldStrokes * sizeof(PPATH));
+ numOldStrokes = numStrokes; // Save orig count.
+ ExFreePoolWithTag(pOldStrokes, TAG_PATH); // Free old pointer.
pStrokes[numStrokes - 1] = ExAllocatePoolWithTag(PagedPool, sizeof(PATH),
TAG_PATH);
PATH_InitGdiPath(pStrokes[numStrokes - 1]);