IoUpdateLinkShareAccess function (wdm.h)
The IoUpdateLinkShareAccess routine updates the share access for the given file object, usually when the file is being opened.
Syntax
void IoUpdateLinkShareAccess(
[in] PFILE_OBJECT FileObject,
[in, out] PSHARE_ACCESS ShareAccess,
[in, out, optional] PLINK_SHARE_ACCESS LinkShareAccess
);
Parameters
[in] FileObject
Pointer to the file object, which usually is being closed by the current thread.
[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.
Return value
None
Remarks
IoUpdateLinkShareAccess is not an atomic operation. Therefore, drivers calling this routine must protect the shared file object passed to IoUpdateLinkShareAccess by means of some kind of lock, such as a mutex or a resource lock, in order to prevent corruption of the shared access counts.
Before calling IoUpdateLinkShareAccess, the caller must successfully call IoCheckLinkShareAccess with Update set to False. Such a call to IoCheckLinkShareAccess determines whether the requested shared access is compatible with the way the file object is currently being accessed by other opens, but it does not update the SHARE_ACCESS structure. IoUpdateLinkShareAccess actually updates the SHARE_ACCESS structure associated with the file object.
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 |
DLL | NtosKrnl.exe |
IRQL | PASSIVE_LEVEL |