Respect OBJ_OPENIF flag in ObCreateObject
[reactos.git] / reactos / ntoskrnl / ob / namespc.c
index 60bee7f..99a635c 100644 (file)
@@ -4,9 +4,8 @@
  * PROJECT:        ReactOS kernel
  * FILE:           ntoskrnl/ob/namespc.c
  * PURPOSE:        Manages the system namespace
- * PROGRAMMER:     David Welch (welch@mcmail.com)
- * UPDATE HISTORY:
- *                 22/05/98: Created
+ * 
+ * PROGRAMMERS:    David Welch (welch@mcmail.com)
  */
 
 /* INCLUDES ***************************************************************/
@@ -56,10 +55,12 @@ ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
    UNICODE_STRING RemainingPath;
    OBJECT_ATTRIBUTES ObjectAttributes;
    NTSTATUS Status;
+   
+   PAGED_CODE();
 
    InitializeObjectAttributes(&ObjectAttributes,
                              ObjectPath,
-                             Attributes,
+                             Attributes | OBJ_OPENIF,
                              NULL,
                              NULL);
    Status = ObFindObject(&ObjectAttributes,
@@ -127,6 +128,8 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
    UNICODE_STRING RemainingPath;
    PVOID Object = NULL;
    NTSTATUS Status;
+   
+   PAGED_CODE();
 
    DPRINT("ObOpenObjectByName(...)\n");
 
@@ -196,7 +199,7 @@ ObpAddEntryDirectory(PDIRECTORY_OBJECT Parent,
 {
   KIRQL oldlvl;
 
-  RtlCreateUnicodeString(&Header->Name, Name);
+  RtlpCreateUnicodeString(&Header->Name, Name, NonPagedPool);
   Header->Parent = Parent;
 
   KeAcquireSpinLock(&Parent->Lock, &oldlvl);
@@ -392,7 +395,7 @@ ObInit(VOID)
   ObDirectoryType->Create = ObpCreateDirectory;
   ObDirectoryType->DuplicationNotify = NULL;
 
-  RtlRosInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
+  RtlInitUnicodeString(&ObDirectoryType->TypeName,
                       L"Directory");
 
   /* create 'type' object type*/
@@ -417,7 +420,7 @@ ObInit(VOID)
   ObTypeObjectType->Create = NULL;
   ObTypeObjectType->DuplicationNotify = NULL;
 
-  RtlRosInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
+  RtlInitUnicodeString(&ObTypeObjectType->TypeName,
                       L"ObjectType");
 
   /* Create security descriptor */