-/* $Id: namespc.c,v 1.36 2003/02/25 16:49:08 ekohl Exp $
+/* $Id: namespc.c,v 1.37 2003/05/12 13:59:09 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* INCLUDES ***************************************************************/
-#ifdef WIN32_REGDBG
-#include "cm_win32.h"
-#else
-
#include <limits.h>
#include <ddk/ntddk.h>
#include <internal/ob.h>
#define NDEBUG
#include <internal/debug.h>
-#endif
/* GLOBALS ****************************************************************/
0x000F0001};
/* FUNCTIONS **************************************************************/
-#ifndef WIN32_REGDBG
+
NTSTATUS STDCALL
ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
ULONG Attributes,
RtlFreeUnicodeString (&RemainingPath);
return(STATUS_SUCCESS);
}
-#endif // WIN32_REGDBG
+
/**********************************************************************
* NAME EXPORTED
ObjectType);
if (!NT_SUCCESS(Status))
{
+ DPRINT("ObFindObject() failed (Status %lx)\n", Status);
return Status;
}
KeReleaseSpinLock(&Parent->Lock, oldlvl);
}
+
VOID
ObpRemoveEntryDirectory(POBJECT_HEADER Header)
/*
KeReleaseSpinLock(&(Header->Parent->Lock),oldlvl);
}
+
PVOID
ObpFindEntryDirectory(PDIRECTORY_OBJECT DirectoryObject,
PWSTR Name,
return(NULL);
}
+
NTSTATUS STDCALL
ObpParseDirectory(PVOID Object,
PVOID * NextObject,
PWSTR * Path,
ULONG Attributes)
{
- PWSTR end;
- PVOID FoundObject;
-
- DPRINT("ObpParseDirectory(Object %x, Path %x, *Path %S)\n",
- Object,Path,*Path);
-
- *NextObject = NULL;
-
- if ((*Path) == NULL)
- {
- return STATUS_UNSUCCESSFUL;
- }
-
- end = wcschr((*Path)+1, '\\');
- if (end != NULL)
- {
- *end = 0;
- }
-
- FoundObject = ObpFindEntryDirectory(Object, (*Path)+1, Attributes);
-
- if (FoundObject == NULL)
- {
- if (end != NULL)
- {
- *end = '\\';
- }
- return STATUS_UNSUCCESSFUL;
- }
-
- ObReferenceObjectByPointer(FoundObject,
- STANDARD_RIGHTS_REQUIRED,
- NULL,
- UserMode);
-
- if (end != NULL)
- {
- *end = '\\';
- *Path = end;
- }
- else
- {
- *Path = NULL;
- }
-
- *NextObject = FoundObject;
-
- return STATUS_SUCCESS;
+ PWSTR Start;
+ PWSTR End;
+ PVOID FoundObject;
+
+ DPRINT("ObpParseDirectory(Object %x, Path %x, *Path %S)\n",
+ Object,Path,*Path);
+
+ *NextObject = NULL;
+
+ if ((*Path) == NULL)
+ {
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ Start = *Path;
+ if (*Start == L'\\')
+ Start++;
+
+ End = wcschr(Start, L'\\');
+ if (End != NULL)
+ {
+ *End = 0;
+ }
+
+ FoundObject = ObpFindEntryDirectory(Object, Start, Attributes);
+ if (FoundObject == NULL)
+ {
+ if (End != NULL)
+ {
+ *End = L'\\';
+ }
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ ObReferenceObjectByPointer(FoundObject,
+ STANDARD_RIGHTS_REQUIRED,
+ NULL,
+ UserMode);
+
+ if (End != NULL)
+ {
+ *End = L'\\';
+ *Path = End;
+ }
+ else
+ {
+ *Path = NULL;
+ }
+
+ *NextObject = FoundObject;
+
+ return STATUS_SUCCESS;
}
+
NTSTATUS STDCALL
ObpCreateDirectory(PVOID ObjectBody,
PVOID Parent,
return(STATUS_SUCCESS);
}
-
/* EOF */