ReactOS  0.4.14-dev-323-g6fe6a88
symlink.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Kernel
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: ntoskrnl/io/iomgr/symlink.c
5  * PURPOSE: I/O Wrappers for Symbolic Links
6  * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7  * Eric Kohl
8  */
9 
10 /* INCLUDES *****************************************************************/
11 
12 #include <ntoskrnl.h>
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* FUNCTIONS ****************************************************************/
17 
18 /*
19  * @implemented
20  */
22 NTAPI
25 {
27  HANDLE Handle;
29  PAGED_CODE();
30 
31  /* Initialize the object attributes and create the link */
33  SymbolicLinkName,
35  NULL,
40  DeviceName);
42 
43  /* Return status */
44  return Status;
45 }
46 
47 /*
48  * @implemented
49  */
51 NTAPI
54 {
57  HANDLE Handle;
59  PAGED_CODE();
60 
61  /* Create an SD */
64  if (!NT_SUCCESS(Status)) return Status;
65 
66  /* Set the DACL */
68  TRUE,
69  NULL,
70  TRUE);
71  if (!NT_SUCCESS(Status)) return Status;
72 
73  /* Initialize the object attributes and create the link */
75  SymbolicLinkName,
77  NULL,
82  DeviceName);
84 
85  /* Return status */
86  return Status;
87 }
88 
89 /*
90  * @implemented
91  */
93 NTAPI
95 {
97  HANDLE Handle;
99  PAGED_CODE();
100 
101  /* Initialize the object attributes and open the link */
103  SymbolicLinkName,
105  NULL,
106  NULL);
108  if (!NT_SUCCESS(Status)) return Status;
109 
110  /* Make the link temporary and close its handle */
113 
114  /* Return status */
115  return Status;
116 }
117 
118 /* EOF */
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
#define OBJ_PERMANENT
Definition: winternl.h:226
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define SYMBOLIC_LINK_ALL_ACCESS
Definition: nt_native.h:1267
#define PAGED_CODE()
Definition: video.h:57
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
PSECURITY_DESCRIPTOR SePublicDefaultSd
Definition: sd.c:22
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
smooth NULL
Definition: ftsmooth.c:416
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
_In_ HANDLE Handle
Definition: extypes.h:390
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSYSAPI NTSTATUS NTAPI ZwCreateSymbolicLinkObject(_Out_ PHANDLE SymbolicLinkHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ PUNICODE_STRING Name)
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
Status
Definition: gdiplustypes.h:24
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSYSAPI NTSTATUS NTAPI ZwMakeTemporaryObject(_In_ HANDLE Handle)
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
NTSYSAPI NTSTATUS NTAPI ZwOpenSymbolicLinkObject(_Out_ PHANDLE SymbolicLinkHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
#define DELETE
Definition: nt_native.h:57