FsRtlRemovePerFileObjectContext function (ntifs.h)
For a "legacy" file system filter driver, the FsRtlRemovePerFileObjectContext function unlinks a per-file-object context information structure from the list of per-file-object contexts previously associated with a file object.
Syntax
PFSRTL_PER_FILEOBJECT_CONTEXT FsRtlRemovePerFileObjectContext(
[in] PFILE_OBJECT FileObject,
[in, optional] PVOID OwnerId,
[in, optional] PVOID InstanceId
);
Parameters
[in] FileObject
A pointer to a file object for which to remove context information.
[in, optional] OwnerId
A pointer to a caller-allocated variable that uniquely identifies the owning filter of the per-file-object context structure. The format of this variable is filter-driver-specific.
[in, optional] InstanceId
A pointer to a caller-allocated variable that can be used to distinguish among per-file-object context structures created by the same filter driver. The format of this variable is filter-driver-specific. This parameter is optional and can be NULL.
Return value
FsRtlRemovePerFileObjectContext unlinks and returns a pointer to the first matching per-file-object context that is found. If no match is found, FsRtlRemovePerFileObjectContext returns NULL.
Remarks
A "legacy" file system filter driver calls FsRtlRemovePerFileObjectContext to unlink its own per-file-object context structure from the list of per-file-object contexts associated with the file object. All such context structures must have previously been associated with the file object by calling FsRtlInsertPerFileObjectContext.
If the call to FsRtlRemovePerFileObjectContext is successful, the first per-file-object context structure matching OwnerId (and InstanceId, if present) is unlinked and a pointer to it returned. This pointer can be used by the filter driver to free the unlinked context structure.
To associate an initialized per-file-object context structure with a file object, use the FsRtlInsertPerFileObjectContext function.
To retrieve a per-file-object context structure that is associated with a file object, use the FsRtlLookupPerFileObjectContext function.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Target Platform | Universal |
Header | ntifs.h (include Fltkernel.h, Ntifs.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | <= APC_LEVEL |