mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Mark ScreenDeviceContext as local before destroying it
svn path=/trunk/; revision=6023
This commit is contained in:
parent
840130bc87
commit
f7cd42043b
3 changed files with 26 additions and 2 deletions
|
@ -120,6 +120,7 @@ VOID FASTCALL CreateStockObjects (VOID);
|
|||
BOOL FASTCALL CleanupForProcess (struct _EPROCESS *Process, INT Pid);
|
||||
|
||||
VOID FASTCALL GDIOBJ_MarkObjectGlobal (HGDIOBJ ObjectHandle);
|
||||
VOID FASTCALL GDIOBJ_UnmarkObjectGlobal (HGDIOBJ ObjectHandle);
|
||||
BOOL FASTCALL GDIOBJ_LockMultipleObj (PGDIMULTILOCK pList, INT nObj);
|
||||
|
||||
PPOINT FASTCALL GDI_Bezier (const POINT *Points, INT count, PINT nPtsOut);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: winsta.c,v 1.33 2003/08/29 08:46:20 weiden Exp $
|
||||
/* $Id: winsta.c,v 1.34 2003/09/09 10:57:03 gvg Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -956,6 +956,7 @@ IntEndDesktopGraphics(VOID)
|
|||
EnableMouse(FALSE);
|
||||
if (NULL != ScreenDeviceContext)
|
||||
{
|
||||
GDIOBJ_UnmarkObjectGlobal(ScreenDeviceContext);
|
||||
NtGdiDeleteDC(ScreenDeviceContext);
|
||||
ScreenDeviceContext = NULL;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
/*
|
||||
* GDIOBJ.C - GDI object manipulation routines
|
||||
*
|
||||
* $Id: gdiobj.c,v 1.40 2003/08/25 23:24:03 rcampbell Exp $
|
||||
* $Id: gdiobj.c,v 1.41 2003/09/09 10:57:03 gvg Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -416,6 +416,28 @@ GDIOBJ_MarkObjectGlobal(HGDIOBJ ObjectHandle)
|
|||
ObjHdr->hProcessId = GDI_GLOBAL_PROCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Removes the global mark from the object. Global objects may be
|
||||
* accessed by any process.
|
||||
* \param ObjectHandle - handle of the object to make local.
|
||||
*
|
||||
* \note Only stock objects should be marked global.
|
||||
*/
|
||||
VOID FASTCALL
|
||||
GDIOBJ_UnmarkObjectGlobal(HGDIOBJ ObjectHandle)
|
||||
{
|
||||
PGDIOBJHDR ObjHdr;
|
||||
|
||||
DPRINT("GDIOBJ_MarkObjectGlobal handle 0x%08x\n", ObjectHandle);
|
||||
ObjHdr = GDIOBJ_iGetObjectForIndex(GDI_HANDLE_GET_INDEX(ObjectHandle));
|
||||
if (NULL == ObjHdr || GDI_GLOBAL_PROCESS != ObjHdr->hProcessId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ObjHdr->hProcessId = PsGetCurrentProcessId();
|
||||
}
|
||||
|
||||
/*!
|
||||
* Get the type of the object.
|
||||
* \param ObjectHandle - handle of the object.
|
||||
|
|
Loading…
Reference in a new issue