Go to Home Page

Gets a handle to a named object directory for the current session.


NTSTATUS WINAPI BaseGetNamedObjectDirectory (
    HANDLE* phDir


A pointer to a handle that recieves the directory handle

Return Value

STATUS_SUCCESS on success, other NTSTATUS values on error


The handle returned in phDir is cached within kernel32, do not free it. The returned handle may refer to the BaseNamedObject directory if the current user can gain full access to it, or the BaseNamedObjects\Restricted directory if not.

On the first call to this function, the directory access checks are made using the process security context, regardless if the calling thread is impersonating or not.