ZwOpenSymbolicLinkObject routine

The ZwOpenSymbolicLinkObject routine opens an existing symbolic link.

Syntax


NTSTATUS ZwOpenSymbolicLinkObject(
  _Out_ PHANDLE            LinkHandle,
  _In_  ACCESS_MASK        DesiredAccess,
  _In_  POBJECT_ATTRIBUTES ObjectAttributes
);

Parameters

LinkHandle [out]

Pointer to a HANDLE variable that receives a handle to the symbolic link object.

DesiredAccess [in]

Specifies an ACCESS_MASK value that determines the requested access to the object. The caller usually specified GENERIC_READ, so that the handle can be passed to ZwQuerySymbolicLinkObject.

ObjectAttributes [in]

Pointer to an OBJECT_ATTRIBUTES structure that specifies the object name and other attributes. Use InitializeObjectAttributes to initialize this structure. If the caller is not running in a system thread context, it must set the OBJ_KERNEL_HANDLE attribute when it calls InitializeObjectAttributes.

Return value

ZwOpenSymbolicLinkObject returns STATUS_SUCCESS on success or the appropriate error status.

Remarks

Once the handle pointed to by LinkHandle is no longer in use, the driver must call ZwClose to close it.

If the caller is not running in a system thread context, it must ensure that any handles it creates are private handles. Otherwise, the handle can be accessed by the process in whose context the driver is running. For more information, see Object Handles.

Note  If the call to the ZwOpenSymbolicLinkObject function occurs in user mode, you should use the name "NtOpenSymbolicLinkObject" instead of "ZwOpenSymbolicLinkObject".
 

NtOpenSymbolicLinkObject and ZwOpenSymbolicLinkObject are two versions of the same Windows Native System Services routine. The NtOpenSymbolicLinkObject routine in the Windows kernel is not directly accessible to kernel-mode drivers. However, kernel-mode drivers can access this routine indirectly by calling the ZwOpenSymbolicLinkObject routine.

For calls from kernel-mode drivers, the NtXxx and ZwXxx versions of a Windows Native System Services routine can behave differently in the way that they handle and interpret input parameters. For more information about the relationship between the NtXxx and ZwXxx versions of a routine, see Using Nt and Zw Versions of the Native System Services Routines.

Requirements

Target platform

Universal

Version

Available in Windows 2000 and later versions of Windows.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

PASSIVE_LEVEL

DDI compliance rules

PowerIrpDDis, HwStorPortProhibitedDDIs

See also

ACCESS_MASK
InitializeObjectAttributes
Using Nt and Zw Versions of the Native System Services Routines
ZwQuerySymbolicLinkObject

 

 

Send comments about this topic to Microsoft

Show: