mirror of
https://github.com/reactos/reactos.git
synced 2024-09-11 05:12:43 +00:00
Implemented IoDeleteSymbolicLink() and NtCreateSymbolicLinkObject().
svn path=/trunk/; revision=1181
This commit is contained in:
parent
19e66992de
commit
fb6c04efbd
|
@ -1,6 +1,6 @@
|
|||
#ifndef _INCLUDE_DDK_IOFUNCS_H
|
||||
#define _INCLUDE_DDK_IOFUNCS_H
|
||||
/* $Id: iofuncs.h,v 1.13 2000/06/12 14:51:26 ekohl Exp $ */
|
||||
/* $Id: iofuncs.h,v 1.14 2000/06/13 15:50:51 ekohl Exp $ */
|
||||
|
||||
/* --- EXPORTED BY NTOSKRNL --- */
|
||||
|
||||
|
@ -527,7 +527,7 @@ IoCreateUnprotectedSymbolicLink (
|
|||
* );
|
||||
*/
|
||||
#define IoDeassignArcName(ArcName) \
|
||||
IoDeleteSymbolicLink((ArcName))
|
||||
(IoDeleteSymbolicLink((ArcName)))
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: symlink.c,v 1.12 2000/03/26 22:00:08 dwelch Exp $
|
||||
/* $Id: symlink.c,v 1.13 2000/06/13 15:51:13 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -374,10 +374,34 @@ IoCreateSymbolicLink (
|
|||
NTSTATUS
|
||||
STDCALL
|
||||
IoDeleteSymbolicLink (
|
||||
PUNICODE_STRING DeviceName
|
||||
PUNICODE_STRING SymbolicLinkName
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
HANDLE Handle;
|
||||
NTSTATUS Status;
|
||||
|
||||
assert_irql(PASSIVE_LEVEL);
|
||||
|
||||
DPRINT("IoDeleteSymbolicLink (SymbolicLinkName %S)\n",
|
||||
SymbolicLinkName->Buffer);
|
||||
|
||||
InitializeObjectAttributes (&ObjectAttributes,
|
||||
SymbolicLinkName,
|
||||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
Status = NtOpenSymbolicLinkObject (&Handle,
|
||||
SYMBOLIC_LINK_ALL_ACCESS,
|
||||
&ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
Status = NtMakeTemporaryObject (Handle);
|
||||
NtClose (Handle);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
@ -400,11 +424,58 @@ NtCreateSymbolicLinkObject (
|
|||
OUT PHANDLE SymbolicLinkHandle,
|
||||
IN ACCESS_MASK DesiredAccess,
|
||||
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
IN PUNICODE_STRING Name
|
||||
IN PUNICODE_STRING DeviceName
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
PSYMLNK_OBJECT SymbolicLink;
|
||||
|
||||
assert_irql(PASSIVE_LEVEL);
|
||||
|
||||
DPRINT(
|
||||
"NtCreateSymbolicLinkObject(SymbolicLinkHandle %p, DesiredAccess %ul, ObjectAttributes %p, DeviceName %S)\n",
|
||||
SymbolicLinkHandle,
|
||||
DesiredAccess,
|
||||
ObjectAttributes,
|
||||
DeviceName->Buffer
|
||||
);
|
||||
|
||||
SymbolicLink = ObCreateObject(
|
||||
SymbolicLinkHandle,
|
||||
DesiredAccess,
|
||||
ObjectAttributes,
|
||||
IoSymbolicLinkType
|
||||
);
|
||||
if (SymbolicLink == NULL)
|
||||
{
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
SymbolicLink->TargetName.Length = 0;
|
||||
SymbolicLink->TargetName.MaximumLength =
|
||||
((wcslen(DeviceName->Buffer) + 1) * sizeof(WCHAR));
|
||||
SymbolicLink->TargetName.Buffer =
|
||||
ExAllocatePool(
|
||||
NonPagedPool,
|
||||
SymbolicLink->TargetName.MaximumLength
|
||||
);
|
||||
RtlCopyUnicodeString(
|
||||
& (SymbolicLink->TargetName),
|
||||
DeviceName
|
||||
);
|
||||
|
||||
DPRINT("DeviceName %S\n", SymbolicLink->TargetName.Buffer);
|
||||
|
||||
InitializeObjectAttributes(
|
||||
& (SymbolicLink->Target),
|
||||
& (SymbolicLink->TargetName),
|
||||
0,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
|
||||
DPRINT("%s() = STATUS_SUCCESS\n",__FUNCTION__);
|
||||
ObDereferenceObject( SymbolicLink );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue