Author: tkreuzer
Date: Mon Aug 23 01:39:28 2010
New Revision: 48604
URL: http://svn.reactos.org/svn/reactos?rev=48604&view=rev
Log:
[WIN32K]
Move the allocation of the vis region of the DC to a later position, so that all mandatory fields are initialized before we try to delete the DC in failure case. Fixes yet another possible crash.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/dclife.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dclife.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Mon Aug 23 01:39:28 2010
@@ -48,18 +48,6 @@
}
hDC = NewDC->BaseObject.hHmgr;
-
- /* Allocate a Vis region */
- NewDC->prgnVis = IntSysCreateRectpRgn(0, 0, 1, 1);
- if (!NewDC->prgnVis)
- {
- DPRINT1("IntSysCreateRectpRgn failed\n");
- if (!GDIOBJ_FreeObjByHandle(hDC, GDI_OBJECT_TYPE_DC))
- {
- ASSERT(FALSE);
- }
- return NULL;
- }
NewDC->pdcattr = &NewDC->dcattr;
DC_AllocateDcAttr(hDC);
@@ -145,6 +133,18 @@
hsurf = (HBITMAP)PrimarySurface.pSurface; // <- what kind of haxx0ry is that?
NewDC->dclevel.pSurface = SURFACE_ShareLockSurface(hsurf);
+
+ /* Allocate a Vis region */
+ NewDC->prgnVis = IntSysCreateRectpRgn(0, 0, 1, 1);
+ if (!NewDC->prgnVis)
+ {
+ DPRINT1("IntSysCreateRectpRgn failed\n");
+ if (!GDIOBJ_FreeObjByHandle(hDC, GDI_OBJECT_TYPE_DC))
+ {
+ ASSERT(FALSE);
+ }
+ return NULL;
+ }
return NewDC;
}