Export (0) Print
Expand All
Expand Minimize

FsRtlExitFileSystem function

The FsRtlExitFileSystem macro re-enables the delivery of normal kernel-mode APCs that were disabled by a preceding call to FsRtlEnterFileSystem.

Syntax


VOID FsRtlExitFileSystem(
   VOID 
);

Parameters

None

Return value

This function does not return a value.

Remarks

Every file system driver entry point routine must call FsRtlEnterFileSystem immediately before acquiring a resource required in performing a file I/O request and call FsRtlExitFileSystem immediately afterward. This ensures that the routine cannot be suspended while running and thus block other file I/O requests.

Every successful call to FsRtlEnterFileSystem must be matched by a subsequent call to FsRtlExitFileSystem.

Note that, unlike local file systems and network redirectors, file system filter drivers should never disable delivery of normal kernel APCs (by calling FsRtlEnterFileSystem or KeEnterCriticalRegion or by raising to IRQL APC_LEVEL) across a call to IoCallDriver.

The only time when a file system filter driver should disable normal kernel APCs is immediately before calling ExAcquireResourceExclusive, ExAcquireResourceExclusiveLite, ExAcquireResourceShared, ExAcquireResourceSharedLite, or ExAcquireSharedStarveExclusive. After calling ExReleaseResource or ExReleaseResourceLite, the filter driver should immediately re-enable delivery of normal kernel APCs. As an alternative to FsRtlEnterFileSystem, minifilter drivers can use the FltAcquireResourceExclusive, FltAcquireResourceShared, and FltReleaseResource routines which properly handles APCs when acquiring and releasing a resource.

It is not necessary to disable normal kernel APCs before calling ExAcquireSharedWaitForExclusive because this routine calls KeRaiseIrqlToDpcLevel, which disables both normal and special kernel APCs. It is also not necessary to do so before calling ExAcquireFastMutex or ExAcquireResourceExclusive, because these routines disable normal kernel APCs.

Requirements

Target platform

Desktop

Header

Ntifs.h (include Ntifs.h)

IRQL

<= APC_LEVEL

See also

ExAcquireFastMutex
ExAcquireResourceExclusive
ExAcquireResourceExclusiveLite
ExAcquireResourceShared
ExAcquireResourceSharedLite
ExAcquireSharedWaitForExclusive
ExAcquireSharedStarveExclusive
ExReleaseResource
ExReleaseResourceLite
ExTryToAcquireFastMutex
FltAcquireResourceExclusive
FltAcquireResourceShared
FltReleaseResource
FsRtlEnterFileSystem
IoCallDriver
KeLeaveCriticalRegion
KeRaiseIrqlToDpcLevel

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft