IoSetShareAccessEx routine

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

Syntax


VOID IoSetShareAccessEx(
  _In_     ACCESS_MASK   DesiredAccess,
  _In_     ULONG         DesiredShareAccess,
  _Inout_  PFILE_OBJECT  FileObject,
  _Out_    PSHARE_ACCESS ShareAccess,
  _In_opt_ PBOOLEAN      WritePermission 
);

Parameters

DesiredAccess [in]

Specifies an ACCESS_MASK value that represents the type of access requested for the file object. See IoCreateFile for a complete list of system-defined DesiredAccess flags.

DesiredShareAccess [in]

Specifies the type of share access to be set for the file object. This value can be zero, or any combination of the following flags:

FILE_SHARE_READ

FILE_SHARE_WRITE

FILE_SHARE_DELETE

FileObject [in, out]

A pointer to the file object whose share access is being set or reset.

ShareAccess [out]

A pointer to the SHARE_ACCESS structure that is associated with FileObject. Drivers should treat this structure as opaque.

WritePermission [in, optional]

A pointer to the value that specifies whether the file object has write permission. This value is TRUE if the share has write permission; otherwise, it is FALSE. If the value is FALSE and the caller attempts to take exclusive read access, the write permission is downgraded to FILE_SHARE_READ.

Return value

None.

Requirements

Target platform

Universal

Version

Available in Windows 7 and later versions of Windows.

Header

Wdm.h

Library

Ntoskrnl.lib

See also

ACCESS_MASK
IoCreateFile

 

 

Send comments about this topic to Microsoft

Show: