From 7301a9d4b0fdcbe35b42d9a306bdcc64e0c0fc91 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 5 Oct 2003 16:57:39 +0000 Subject: [PATCH] Return handle information in ObReferenceObjectByHandle(). svn path=/trunk/; revision=6243 --- reactos/ntoskrnl/ob/handle.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/ob/handle.c b/reactos/ntoskrnl/ob/handle.c index 891cbeafa6f..9e3f5b18c44 100644 --- a/reactos/ntoskrnl/ob/handle.c +++ b/reactos/ntoskrnl/ob/handle.c @@ -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: handle.c,v 1.51 2003/09/25 20:07:46 ekohl Exp $ +/* $Id: handle.c,v 1.52 2003/10/05 16:57:39 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -597,7 +597,7 @@ ObReferenceObjectByHandle(HANDLE Handle, POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, PVOID* Object, - POBJECT_HANDLE_INFORMATION HandleInformationPtr) + POBJECT_HANDLE_INFORMATION HandleInformation) /* * FUNCTION: Increments the reference count for an object and returns a * pointer to its body @@ -625,7 +625,6 @@ ObReferenceObjectByHandle(HANDLE Handle, "ObjectType %x, AccessMode %d, Object %x)\n",Handle,DesiredAccess, ObjectType,AccessMode,Object); - /* * Handle special handle names */ @@ -643,6 +642,12 @@ ObReferenceObjectByHandle(HANDLE Handle, return Status; } + if (HandleInformation != NULL) + { + HandleInformation->HandleAttributes = 0; /* FIXME? */ + HandleInformation->GrantedAccess = PROCESS_ALL_ACCESS; + } + *Object = PsGetCurrentProcess(); DPRINT("Referencing current process %x\n", PsGetCurrentProcess()); return STATUS_SUCCESS; @@ -664,6 +669,12 @@ ObReferenceObjectByHandle(HANDLE Handle, return Status; } + if (HandleInformation != NULL) + { + HandleInformation->HandleAttributes = 0; /* FIXME? */ + HandleInformation->GrantedAccess = THREAD_ALL_ACCESS; + } + *Object = PsGetCurrentThread(); CHECKPOINT; return STATUS_SUCCESS; @@ -721,7 +732,13 @@ ObReferenceObjectByHandle(HANDLE Handle, return(STATUS_ACCESS_DENIED); } } - + + if (HandleInformation != NULL) + { + HandleInformation->HandleAttributes = 0; /* FIXME */ + HandleInformation->GrantedAccess = GrantedAccess; + } + *Object = ObjectBody; CHECKPOINT;