Return a better status code in ObReferenceObjectByPointer().

svn path=/trunk/; revision=2236
This commit is contained in:
Eric Kohl 2001-09-08 08:57:59 +00:00
parent cf1883980d
commit b62d5e3184

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: handle.c,v 1.31 2001/05/05 19:13:10 chorns Exp $ /* $Id: handle.c,v 1.32 2001/09/08 08:57:59 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -88,6 +88,7 @@ static PHANDLE_REP ObpGetObjectByHandle(PHANDLE_TABLE HandleTable, HANDLE h)
} }
blk = CONTAINING_RECORD(current,HANDLE_BLOCK,entry); blk = CONTAINING_RECORD(current,HANDLE_BLOCK,entry);
DPRINT("object: %p\n",&(blk->handles[handle%HANDLE_BLOCK_ENTRIES]));
return(&(blk->handles[handle%HANDLE_BLOCK_ENTRIES])); return(&(blk->handles[handle%HANDLE_BLOCK_ENTRIES]));
} }
@ -475,13 +476,13 @@ NTSTATUS ObCreateHandle(PEPROCESS Process,
} }
NTSTATUS STDCALL ObReferenceObjectByHandle(HANDLE Handle, NTSTATUS STDCALL
ACCESS_MASK DesiredAccess, ObReferenceObjectByHandle(HANDLE Handle,
POBJECT_TYPE ObjectType, ACCESS_MASK DesiredAccess,
KPROCESSOR_MODE AccessMode, POBJECT_TYPE ObjectType,
PVOID* Object, KPROCESSOR_MODE AccessMode,
POBJECT_HANDLE_INFORMATION PVOID* Object,
HandleInformationPtr) POBJECT_HANDLE_INFORMATION HandleInformationPtr)
/* /*
* FUNCTION: Increments the reference count for an object and returns a * FUNCTION: Increments the reference count for an object and returns a
* pointer to its body * pointer to its body
@ -558,6 +559,9 @@ NTSTATUS STDCALL ObReferenceObjectByHandle(HANDLE Handle,
return(STATUS_INVALID_HANDLE); return(STATUS_INVALID_HANDLE);
} }
ObjectBody = HandleRep->ObjectBody; ObjectBody = HandleRep->ObjectBody;
DPRINT("ObjectBody %p\n",ObjectBody);
ObjectHeader = BODY_TO_HEADER(ObjectBody);
DPRINT("ObjectHeader->RefCount %lu\n",ObjectHeader->RefCount);
ObReferenceObjectByPointer(ObjectBody, ObReferenceObjectByPointer(ObjectBody,
0, 0,
NULL, NULL,
@ -567,6 +571,7 @@ NTSTATUS STDCALL ObReferenceObjectByHandle(HANDLE Handle,
oldIrql); oldIrql);
ObjectHeader = BODY_TO_HEADER(ObjectBody); ObjectHeader = BODY_TO_HEADER(ObjectBody);
DPRINT("ObjectHeader->RefCount %lu\n",ObjectHeader->RefCount);
if (ObjectType != NULL && ObjectType != ObjectHeader->ObjectType) if (ObjectType != NULL && ObjectType != ObjectHeader->ObjectType)
{ {