mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Added CloseInProcess to the structure OBJECT_HEADER.
Check for close operation in ObReferenceObjectByPointer, ObpPerformRetentionChecks, ObfReferenceObject. svn path=/trunk/; revision=3402
This commit is contained in:
parent
9e3bef3b3c
commit
06226b583c
2 changed files with 19 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _INCLUDE_DDK_OBTYPES_H
|
#ifndef _INCLUDE_DDK_OBTYPES_H
|
||||||
#define _INCLUDE_DDK_OBTYPES_H
|
#define _INCLUDE_DDK_OBTYPES_H
|
||||||
/* $Id: obtypes.h,v 1.15 2002/06/20 21:28:55 ekohl Exp $ */
|
/* $Id: obtypes.h,v 1.16 2002/08/27 06:34:22 hbirr Exp $ */
|
||||||
struct _DIRECTORY_OBJECT;
|
struct _DIRECTORY_OBJECT;
|
||||||
struct _OBJECT_ATTRIBUTES;
|
struct _OBJECT_ATTRIBUTES;
|
||||||
|
|
||||||
|
@ -131,6 +131,7 @@ typedef struct _OBJECT_HEADER
|
||||||
LIST_ENTRY Entry;
|
LIST_ENTRY Entry;
|
||||||
LONG RefCount;
|
LONG RefCount;
|
||||||
LONG HandleCount;
|
LONG HandleCount;
|
||||||
|
BOOLEAN CloseInProcess;
|
||||||
BOOLEAN Permanent;
|
BOOLEAN Permanent;
|
||||||
struct _DIRECTORY_OBJECT* Parent;
|
struct _DIRECTORY_OBJECT* Parent;
|
||||||
POBJECT_TYPE ObjectType;
|
POBJECT_TYPE ObjectType;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: object.c,v 1.53 2002/08/14 20:58:38 dwelch Exp $
|
/* $Id: object.c,v 1.54 2002/08/27 06:34:22 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -379,6 +379,11 @@ ObReferenceObjectByPointer(IN PVOID Object,
|
||||||
DPRINT("eip %x\n", ((PULONG)&Object)[-1]);
|
DPRINT("eip %x\n", ((PULONG)&Object)[-1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Header->CloseInProcess)
|
||||||
|
{
|
||||||
|
return(STATUS_UNSUCCESSFUL);
|
||||||
|
}
|
||||||
|
|
||||||
InterlockedIncrement(&Header->RefCount);
|
InterlockedIncrement(&Header->RefCount);
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
|
@ -442,6 +447,12 @@ ObpPerformRetentionChecks(POBJECT_HEADER Header)
|
||||||
Header->HandleCount == 0 &&
|
Header->HandleCount == 0 &&
|
||||||
Header->Permanent == FALSE)
|
Header->Permanent == FALSE)
|
||||||
{
|
{
|
||||||
|
if (Header->CloseInProcess)
|
||||||
|
{
|
||||||
|
KeBugCheck(0);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
Header->CloseInProcess = TRUE;
|
||||||
if (Header->ObjectType != NULL &&
|
if (Header->ObjectType != NULL &&
|
||||||
Header->ObjectType->Delete != NULL)
|
Header->ObjectType->Delete != NULL)
|
||||||
{
|
{
|
||||||
|
@ -482,6 +493,10 @@ ObfReferenceObject(IN PVOID Object)
|
||||||
|
|
||||||
Header = BODY_TO_HEADER(Object);
|
Header = BODY_TO_HEADER(Object);
|
||||||
|
|
||||||
|
if (Header->CloseInProcess)
|
||||||
|
{
|
||||||
|
KeBugCheck(0);
|
||||||
|
}
|
||||||
InterlockedIncrement(&Header->RefCount);
|
InterlockedIncrement(&Header->RefCount);
|
||||||
|
|
||||||
ObpPerformRetentionChecks(Header);
|
ObpPerformRetentionChecks(Header);
|
||||||
|
|
Loading…
Reference in a new issue