IoSetLinkShareAccess function (wdm.h)

The IoSetLinkShareAccess routine sets the access rights for link sharing the specified file object.

Syntax

void IoSetLinkShareAccess(
  [in]                ACCESS_MASK        DesiredAccess,
  [in]                ULONG              DesiredShareAccess,
  [in, out]           PFILE_OBJECT       FileObject,
  [in, out]           PSHARE_ACCESS      ShareAccess,
  [in, out, optional] PLINK_SHARE_ACCESS LinkShareAccess,
  [in]                ULONG              IoShareAccessFlags
);

Parameters

[in] DesiredAccess

Specifies an ACCESS_MASK value that indicates the desired type of access to the given file object.

[in] DesiredShareAccess

Specifies the desired type of shared access to the file object for the current open request. The value of this parameter is usually the same as the ShareAccess parameter that is passed to the file system or highest-level driver by the I/O manager when the open request was made. This value can be zero, or any combination of the following:

FILE_SHARE_READ

FILE_SHARE_WRITE

FILE_SHARE_DELETE

[in, out] FileObject

A pointer to the file object for which to check access for the current open request.

[in, out] ShareAccess

A pointer to the common share-access data structure that is associated with FileObject. Drivers should treat this structure as opaque.

[in, out, optional] LinkShareAccess

A pointer to the common link share-access data structure (LINK_SHARE_ACCESS) that is associated with FileObject. Drivers should treat this structure as opaque.

[in] IoShareAccessFlags

A bitmask of these flags:

IO_SHARE_ACCESS_NO_WRITE_PERMISSION (0x80000000) specifies that the user has no write permission for the file. This flag is used to prevent opening a file for exclusive read access when the user does not have appropriate permissions.

IO_CHECK_SHARE_ACCESS_UPDATE_SHARE_ACCESS (0x00000001) indicates whether the SHARE_ACCESS structure is updated.

Return value

None

Requirements

Requirement Value
Minimum supported client Windows 10, version 1709
Minimum supported server Windows Server 2016
Target Platform Universal
Header wdm.h
Library Ntoskrnl.lib

See also

IoCheckLinkShareAccess

IoRemoveLinkShareAccess

IoUpdateLinkShareAccess