From 8c9205dfd57296db390283bda5a4e4f1b8b19d07 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Mon, 8 Jan 2007 19:52:49 +0000 Subject: [PATCH] - Implement ObpCreateSymbolicLinkName and enable call to the function. It shouldn't do any work currently because we don't have DOS Device Maps. - Also stub ObpDeleteSymbolicLinkName since it'll probably be needed later. svn path=/trunk/; revision=25385 --- reactos/ntoskrnl/include/internal/ob.h | 12 ++++++++++ reactos/ntoskrnl/ob/obdir.c | 4 ---- reactos/ntoskrnl/ob/obhandle.c | 3 +-- reactos/ntoskrnl/ob/obname.c | 1 - reactos/ntoskrnl/ob/symlink.c | 33 ++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 7 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/ob.h b/reactos/ntoskrnl/include/internal/ob.h index a0ae504476d..211a05bb6b7 100644 --- a/reactos/ntoskrnl/include/internal/ob.h +++ b/reactos/ntoskrnl/include/internal/ob.h @@ -149,6 +149,18 @@ ObpParseSymbolicLink( OUT PVOID *NextObject ); +VOID +NTAPI +ObpCreateSymbolicLinkName( + IN POBJECT_SYMBOLIC_LINK SymbolicLink +); + +VOID +NTAPI +ObpDeleteSymbolicLinkName( + IN POBJECT_SYMBOLIC_LINK SymbolicLink +); + // // Process/Handle Table Init/Rundown // diff --git a/reactos/ntoskrnl/ob/obdir.c b/reactos/ntoskrnl/ob/obdir.c index 5cb37be6df5..b5b4929dca9 100644 --- a/reactos/ntoskrnl/ob/obdir.c +++ b/reactos/ntoskrnl/ob/obdir.c @@ -719,10 +719,6 @@ NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, NTSTATUS Status = STATUS_SUCCESS; PAGED_CODE(); - DPRINT("NtCreateDirectoryObject(DirectoryHandle %x, " - "DesiredAccess %x, ObjectAttributes %x\n", - DirectoryHandle, DesiredAccess, ObjectAttributes); - /* Check if we need to do any probing */ if(PreviousMode != KernelMode) { diff --git a/reactos/ntoskrnl/ob/obhandle.c b/reactos/ntoskrnl/ob/obhandle.c index c88c59451b1..4adfe5a9a8e 100644 --- a/reactos/ntoskrnl/ob/obhandle.c +++ b/reactos/ntoskrnl/ob/obhandle.c @@ -2506,8 +2506,7 @@ ObInsertObject(IN PVOID Object, if (ObjectType == ObSymbolicLinkType) { /* Create the internal name */ - DPRINT("FIXME: Created link!\n"); - //ObpCreateSymbolicLinkName(FoundObject); + ObpCreateSymbolicLinkName(Object); } } } diff --git a/reactos/ntoskrnl/ob/obname.c b/reactos/ntoskrnl/ob/obname.c index ecbbbe72c21..c72bfe6a0fc 100644 --- a/reactos/ntoskrnl/ob/obname.c +++ b/reactos/ntoskrnl/ob/obname.c @@ -828,7 +828,6 @@ ObQueryNameString(IN PVOID Object, else { /* Directory without a name, we add "..." */ - DPRINT("Nameless Directory\n"); ObjectName -= sizeof(L"..."); ObjectName = L"..."; break; diff --git a/reactos/ntoskrnl/ob/symlink.c b/reactos/ntoskrnl/ob/symlink.c index 1f710720b20..4107998a8f8 100644 --- a/reactos/ntoskrnl/ob/symlink.c +++ b/reactos/ntoskrnl/ob/symlink.c @@ -19,6 +19,39 @@ POBJECT_TYPE ObSymbolicLinkType = NULL; /* PRIVATE FUNCTIONS *********************************************************/ +VOID +NTAPI +ObpDeleteSymbolicLinkName(IN POBJECT_SYMBOLIC_LINK SymbolicLink) +{ + /* FIXME: Device maps not supported yet */ + +} + +VOID +NTAPI +ObpCreateSymbolicLinkName(IN POBJECT_SYMBOLIC_LINK SymbolicLink) +{ + POBJECT_HEADER ObjectHeader; + POBJECT_HEADER_NAME_INFO ObjectNameInfo; + + /* Get header data */ + ObjectHeader = OBJECT_TO_OBJECT_HEADER(SymbolicLink); + ObjectNameInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader); + + /* Check if we are not actually in a directory with a device map */ + if (!(ObjectNameInfo) || + !(ObjectNameInfo->Directory) || + !(ObjectNameInfo->Directory->DeviceMap)) + { + /* There's nothing to do, return */ + return; + } + + /* FIXME: We don't support device maps yet */ + DPRINT1("Unhandled path!\n"); + KEBUGCHECK(0); +} + /*++ * @name ObpDeleteSymbolicLink *