Return handle information in ObReferenceObjectByHandle().
authorEric Kohl <eric.kohl@reactos.org>
Sun, 5 Oct 2003 16:57:39 +0000 (16:57 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 5 Oct 2003 16:57:39 +0000 (16:57 +0000)
svn path=/trunk/; revision=6243

reactos/ntoskrnl/ob/handle.c

index 891cbea..9e3f5b1 100644 (file)
@@ -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;