Bewerken

Delen via


IoRemoveLinkShareAccess function (wdm.h)

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

Syntax

void IoRemoveLinkShareAccess(
  [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

This routine is a reciprocal to IoUpdateLinkShareAccess.

IoRemoveLinkShareAccess is not an atomic operation. Therefore, drivers calling this routine must protect the shared file object passed to IoRemoveLinkShareAccess 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 IoRemoveLinkShareAccess must be running at IRQL = PASSIVE_LEVEL and in the context of the thread that requested that the FileObject be closed.

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

See also

IoCheckLinkShareAccess

IoSetLinkShareAccess

IoUpdateLinkShareAccess