// wdm.h
VOID IoSetShareAccessEx(
[in] ACCESS_MASK DesiredAccess,
[in] ULONG DesiredShareAccess,
[in, out] PFILE_OBJECT FileObject,
[out] PSHARE_ACCESS ShareAccess,
[in, optional] PBOOLEAN WritePermission
);
View the official Windows Driver Kit DDI referenceNo description available.
The IoSetShareAccessEx routine sets the access rights for sharing the specified file object.
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:
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.