mirror of
https://github.com/reactos/reactos.git
synced 2024-09-15 15:19:37 +00:00
Directory objects must be able to parse a 'remaining path' that does not start with a backslash.
This is needed to support relative path names in the object tree. svn path=/trunk/; revision=4678
This commit is contained in:
parent
c0f1cf6933
commit
484cf7d5bf
|
@ -1,4 +1,4 @@
|
||||||
/* $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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -11,10 +11,6 @@
|
||||||
|
|
||||||
/* INCLUDES ***************************************************************/
|
/* INCLUDES ***************************************************************/
|
||||||
|
|
||||||
#ifdef WIN32_REGDBG
|
|
||||||
#include "cm_win32.h"
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <internal/ob.h>
|
#include <internal/ob.h>
|
||||||
|
@ -24,7 +20,6 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* GLOBALS ****************************************************************/
|
/* GLOBALS ****************************************************************/
|
||||||
|
|
||||||
|
@ -46,7 +41,7 @@ static GENERIC_MAPPING ObpTypeMapping = {
|
||||||
0x000F0001};
|
0x000F0001};
|
||||||
|
|
||||||
/* FUNCTIONS **************************************************************/
|
/* FUNCTIONS **************************************************************/
|
||||||
#ifndef WIN32_REGDBG
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
|
ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
|
||||||
ULONG Attributes,
|
ULONG Attributes,
|
||||||
|
@ -90,7 +85,7 @@ DPRINT("Object %p\n", Object);
|
||||||
RtlFreeUnicodeString (&RemainingPath);
|
RtlFreeUnicodeString (&RemainingPath);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
#endif // WIN32_REGDBG
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* NAME EXPORTED
|
* NAME EXPORTED
|
||||||
|
@ -139,6 +134,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
ObjectType);
|
ObjectType);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
DPRINT("ObFindObject() failed (Status %lx)\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,6 +180,7 @@ ObpAddEntryDirectory(PDIRECTORY_OBJECT Parent,
|
||||||
KeReleaseSpinLock(&Parent->Lock, oldlvl);
|
KeReleaseSpinLock(&Parent->Lock, oldlvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
ObpRemoveEntryDirectory(POBJECT_HEADER Header)
|
ObpRemoveEntryDirectory(POBJECT_HEADER Header)
|
||||||
/*
|
/*
|
||||||
|
@ -201,6 +198,7 @@ ObpRemoveEntryDirectory(POBJECT_HEADER Header)
|
||||||
KeReleaseSpinLock(&(Header->Parent->Lock),oldlvl);
|
KeReleaseSpinLock(&(Header->Parent->Lock),oldlvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PVOID
|
PVOID
|
||||||
ObpFindEntryDirectory(PDIRECTORY_OBJECT DirectoryObject,
|
ObpFindEntryDirectory(PDIRECTORY_OBJECT DirectoryObject,
|
||||||
PWSTR Name,
|
PWSTR Name,
|
||||||
|
@ -249,6 +247,7 @@ ObpFindEntryDirectory(PDIRECTORY_OBJECT DirectoryObject,
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
ObpParseDirectory(PVOID Object,
|
ObpParseDirectory(PVOID Object,
|
||||||
PVOID * NextObject,
|
PVOID * NextObject,
|
||||||
|
@ -256,56 +255,61 @@ ObpParseDirectory(PVOID Object,
|
||||||
PWSTR * Path,
|
PWSTR * Path,
|
||||||
ULONG Attributes)
|
ULONG Attributes)
|
||||||
{
|
{
|
||||||
PWSTR end;
|
PWSTR Start;
|
||||||
PVOID FoundObject;
|
PWSTR End;
|
||||||
|
PVOID FoundObject;
|
||||||
DPRINT("ObpParseDirectory(Object %x, Path %x, *Path %S)\n",
|
|
||||||
Object,Path,*Path);
|
DPRINT("ObpParseDirectory(Object %x, Path %x, *Path %S)\n",
|
||||||
|
Object,Path,*Path);
|
||||||
*NextObject = NULL;
|
|
||||||
|
*NextObject = NULL;
|
||||||
if ((*Path) == NULL)
|
|
||||||
{
|
if ((*Path) == NULL)
|
||||||
return STATUS_UNSUCCESSFUL;
|
{
|
||||||
}
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
end = wcschr((*Path)+1, '\\');
|
|
||||||
if (end != NULL)
|
Start = *Path;
|
||||||
{
|
if (*Start == L'\\')
|
||||||
*end = 0;
|
Start++;
|
||||||
}
|
|
||||||
|
End = wcschr(Start, L'\\');
|
||||||
FoundObject = ObpFindEntryDirectory(Object, (*Path)+1, Attributes);
|
if (End != NULL)
|
||||||
|
{
|
||||||
if (FoundObject == NULL)
|
*End = 0;
|
||||||
{
|
}
|
||||||
if (end != NULL)
|
|
||||||
{
|
FoundObject = ObpFindEntryDirectory(Object, Start, Attributes);
|
||||||
*end = '\\';
|
if (FoundObject == NULL)
|
||||||
}
|
{
|
||||||
return STATUS_UNSUCCESSFUL;
|
if (End != NULL)
|
||||||
}
|
{
|
||||||
|
*End = L'\\';
|
||||||
ObReferenceObjectByPointer(FoundObject,
|
}
|
||||||
STANDARD_RIGHTS_REQUIRED,
|
return STATUS_UNSUCCESSFUL;
|
||||||
NULL,
|
}
|
||||||
UserMode);
|
|
||||||
|
ObReferenceObjectByPointer(FoundObject,
|
||||||
if (end != NULL)
|
STANDARD_RIGHTS_REQUIRED,
|
||||||
{
|
NULL,
|
||||||
*end = '\\';
|
UserMode);
|
||||||
*Path = end;
|
|
||||||
}
|
if (End != NULL)
|
||||||
else
|
{
|
||||||
{
|
*End = L'\\';
|
||||||
*Path = NULL;
|
*Path = End;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
*NextObject = FoundObject;
|
{
|
||||||
|
*Path = NULL;
|
||||||
return STATUS_SUCCESS;
|
}
|
||||||
|
|
||||||
|
*NextObject = FoundObject;
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
ObpCreateDirectory(PVOID ObjectBody,
|
ObpCreateDirectory(PVOID ObjectBody,
|
||||||
PVOID Parent,
|
PVOID Parent,
|
||||||
|
@ -450,5 +454,4 @@ ObpCreateTypeObject(POBJECT_TYPE ObjectType)
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue