// ntifs.h
VOID FsRtlTeardownPerFileContexts(
[in] PVOID *PerFileContextPointer
);
View the official Windows Driver Kit DDI referenceNo description available.
File systems call theFsRtlTeardownPerFileContexts routine to free FSRTL_PER_FILE_CONTEXT objects that are associated with a file control block (FCB) structure.
PerFileContextPointer [in]A pointer to an opaque pointer that identifies the per file context structure. To retrieve this pointer from a file object, use the FsRtlGetPerFileContextPointer macro.
This routine calls the FreeCallback routine specified in the FSRTL_PER_FILE_CONTEXT object. The FreeCallback routine has to deallocate the FSRTL_PER_FILE_CONTEXT structure and the associated context.
To avoid conflicts in synchronization, the FsRtlTeardownPerFileContexts routine releases the lock for the per file context objects before calling FreeCallback. This avoids blocking access to the to the per file context objects by the filter for its own list operations, such as removal with FsRtlRemovePerFileContext.
Tracking Per-File Context in a Legacy File System Filter Driver