IoUpdateShareAccess function

The IoUpdateShareAccess routine updates the share access for the given file object, usually when the file is being opened.

Syntax

void IoUpdateShareAccess(
  PFILE_OBJECT  FileObject,
  PSHARE_ACCESS ShareAccess
);

Parameters

FileObject

Pointer to a referenced file object representing the file or associated device object for which to update the share access.

ShareAccess

Pointer to the common SHARE_ACCESS structure associated with the FileObject. Drivers should treat this structure as opaque.

Return Value

None

Remarks

IoUpdateShareAccess is not an atomic operation. Therefore, drivers calling this routine must protect the shared file object passed to IoUpdateShareAccess 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 IoUpdateShareAccess, the caller must successfully call IoCheckShareAccess with Update set to False. Such a call to IoCheckShareAccess 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. IoUpdateShareAccess actually updates the SHARE_ACCESS structure associated with the file object.

Requirements

   
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL
DDI compliance rules IrqlIoPassive5, PowerIrpDDis, HwStorPortProhibitedDDIs

See Also

IoCheckShareAccess

IoRemoveShareAccess

IoSetShareAccess