IoRemoveShareAccess function

The IoRemoveShareAccess routine removes the access and share-access information for a given open instance of a file object.

Syntax

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

Parameters

FileObject

Pointer to the file object, which usually is being closed by the current thread.

ShareAccess

Pointer to the share-access structure that describes how the open file object is currently being accessed.

Return Value

None

Remarks

This routine is a reciprocal to IoUpdateShareAccess.

IoRemoveShareAccess is not an atomic operation. Therefore, drivers calling this routine must protect the shared file object passed to IoRemoveShareAccess 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.

Callers of IoRemoveShareAccess must be running at IRQL = PASSIVE_LEVEL and in the context of the thread that requested that the FileObject be closed.

Requirements

   
Windows version Available starting with Windows 2000. 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 (see Remarks section)
DDI compliance rules IrqlIoPassive5, PowerIrpDDis, HwStorPortProhibitedDDIs

See Also

IoUpdateShareAccess

IoSetShareAccess

IoCheckShareAccess

Send comments about this topic to Microsoft