Remove DCE from linked list on destroy

svn path=/trunk/; revision=4261
This commit is contained in:
Gé van Geldorp 2003-03-08 00:46:14 +00:00
parent 4817869d83
commit 10283bad30
3 changed files with 34 additions and 2 deletions

View file

@ -44,5 +44,6 @@ PDCE DCE_FreeDCE(PDCE dce);
VOID DCE_FreeWindowDCE(HWND);
INT DCE_ExcludeRgn(HDC, HWND, HRGN);
BOOL DCE_InvalidateDCE(HWND, const PRECTL);
BOOL DCE_InternalDelete(PDCE dce);
#endif

View file

@ -1,4 +1,4 @@
/* $Id: windc.c,v 1.6 2002/09/01 20:39:56 dwelch Exp $
/* $Id: windc.c,v 1.7 2003/03/08 00:46:14 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -528,4 +528,31 @@ NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags)
return(Dce->hDC);
}
BOOL
DCE_InternalDelete(PDCE Dce)
{
PDCE PrevInList;
if (Dce == FirstDce)
{
FirstDce = Dce->next;
PrevInList = Dce;
}
else
{
for (PrevInList = FirstDce; NULL != PrevInList; PrevInList = PrevInList->next)
{
if (Dce == PrevInList->next)
{
PrevInList->next = Dce->next;
break;
}
}
assert(NULL != PrevInList);
}
return NULL != PrevInList;
}
/* EOF */

View file

@ -1,13 +1,14 @@
/*
* GDIOBJ.C - GDI object manipulation routines
*
* $Id: gdiobj.c,v 1.20 2003/01/18 20:50:43 ei Exp $
* $Id: gdiobj.c,v 1.21 2003/03/08 00:46:14 gvg Exp $
*
*/
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ddk/ntddk.h>
#include <include/dce.h>
#include <win32k/gdiobj.h>
#include <win32k/brush.h>
#include <win32k/pen.h>
@ -277,6 +278,9 @@ BOOL GDIOBJ_FreeObj(HGDIOBJ hObj, WORD Magic, DWORD Flag)
case GO_BRUSH_MAGIC:
case GO_FONT_MAGIC:
break;
case GO_DCE_MAGIC:
bRet = DCE_InternalDelete( (PDCE) Obj );
break;
}
handleEntry->hProcessId = 0;
ExFreePool (handleEntry->pObject);