mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[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. svn path=/trunk/; revision=48604
This commit is contained in:
@@ -49,18 +49,6 @@ DC_AllocDC(PUNICODE_STRING Driver)
|
||||
|
||||
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);
|
||||
|
||||
@@ -146,6 +134,18 @@ DC_AllocDC(PUNICODE_STRING Driver)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user