Export (0) Print
Expand All
Expand Minimize

IoUpdateShareAccess routine

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

Syntax


VOID IoUpdateShareAccess(
  _In_     PFILE_OBJECT FileObject,
  _Inout_  PSHARE_ACCESS ShareAccess
);

Parameters

FileObject [in]

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

ShareAccess [in, out]

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

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

IrqlIoPassive5, PowerIrpDDis, HwStorPortProhibitedDDIs

See also

IoCheckShareAccess
IoRemoveShareAccess
IoSetShareAccess

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft