ReactOS  0.4.14-dev-583-g2a1ba2c
symlink.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for symlink.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI IoCreateSymbolicLink (IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
 
NTSTATUS NTAPI IoCreateUnprotectedSymbolicLink (IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
 
NTSTATUS NTAPI IoDeleteSymbolicLink (IN PUNICODE_STRING SymbolicLinkName)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file symlink.c.

Function Documentation

◆ IoCreateSymbolicLink()

NTSTATUS NTAPI IoCreateSymbolicLink ( IN PUNICODE_STRING  SymbolicLinkName,
IN PUNICODE_STRING  DeviceName 
)

Definition at line 23 of file symlink.c.

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 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
#define OBJ_PERMANENT
Definition: winternl.h:226
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define SYMBOLIC_LINK_ALL_ACCESS
Definition: nt_native.h:1267
#define PAGED_CODE()
Definition: video.h:57
PSECURITY_DESCRIPTOR SePublicDefaultSd
Definition: sd.c:22
smooth NULL
Definition: ftsmooth.c:416
_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
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231

Referenced by _Function_class_(), CdRomCreateWellKnownName(), change_symlink(), CompBattAddDevice(), ConDrvCreateController(), CreateSoundDevice(), DiskCreateSymbolicLinks(), DriverEntry(), Ex2ProcessMountPoint(), FdoCreateRawParallelPdo(), FltpSetupCommunicationObjects(), FreeBT_AddDevice(), FsRtlpSetSymbolicLink(), GlobalCreateSymbolicLink(), HalpNextDriveLetter(), InitDevice(), InitializeGlobalData(), InitializeSoundBlaster(), IntVideoPortFindAdapter(), IopStartRamdisk(), IoRegisterDeviceInterface(), NdisMRegisterDevice(), RamdiskCreateDiskDevice(), ScsiPortInitialize(), SerialPnpStartDevice(), CHCDController::SetSymbolicLink(), SysAudio_AddDevice(), USBPORT_CreateLegacySymbolicLink(), VfdCreateDevice(), VfdSetLink(), ViCreateDriveLetter(), and xHalIoAssignDriveLetters().

◆ IoCreateUnprotectedSymbolicLink()

NTSTATUS NTAPI IoCreateUnprotectedSymbolicLink ( IN PUNICODE_STRING  SymbolicLinkName,
IN PUNICODE_STRING  DeviceName 
)

Definition at line 52 of file symlink.c.

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 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#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
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
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231

◆ IoDeleteSymbolicLink()

NTSTATUS NTAPI IoDeleteSymbolicLink ( IN PUNICODE_STRING  SymbolicLinkName)

Definition at line 94 of file symlink.c.

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 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
#define PAGED_CODE()
Definition: video.h:57
smooth NULL
Definition: ftsmooth.c:416
_In_ HANDLE Handle
Definition: extypes.h:390
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#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

Referenced by _Function_class_(), CdRomCreateWellKnownName(), CdRomDeleteWellKnownName(), change_symlink(), ConDrvDeleteController(), DestroySoundDevice(), DiskDeleteSymbolicLinks(), DriverEntry(), Ex2ProcessMountPoint(), FreeBT_AddDevice(), FreeGlobalData(), FsRtlpSetSymbolicLink(), GlobalDeleteSymbolicLink(), InitializeGlobalData(), IoRegisterDeviceInterface(), MountMgrMountedDeviceArrival(), NdisMDeregisterDevice(), NdisMRegisterDevice(), nfs41_driver_unload(), RamdiskCreateDiskDevice(), ReleaseMemory(), SerialPnpStartDevice(), CHCDController::SetSymbolicLink(), SysAudio_AddDevice(), SysAudio_Pnp(), Unload(), VfdCreateDevice(), VfdDeleteDevice(), VfdSetLink(), and ViDeleteDevice().