FltGetSectionContext function

The FltGetSectionContext routine retrieves a section context that was created for a file stream by a specified minifilter driver instance.

Syntax

NTSTATUS FLTAPI FltGetSectionContext(
  PFLT_INSTANCE Instance,
  PFILE_OBJECT  FileObject,
  PFLT_CONTEXT  *Context
);

Parameters

Instance

An opaque instance pointer for the minifilter driver instance whose context is to be retrieved.

FileObject

A pointer to a file object for the stream.

Context

A pointer to a caller-allocated variable that receives the address of the context.

Return Value

FltGetSectionContext returns STATUS_SUCCESS or an appropriate NTSTATUS value, such as one of the following.

Return code Description
STATUS_NOT_FOUND
No matching context was found. This is an error code.
STATUS_NOT_SUPPORTED
The volume attached to this instance does not support section contexts. This is an error code.

Remarks

FltGetSectionContext retrieves a section context that was created for a file stream by a specified minifilter driver instance. A section context is created by calling FltCreateSectionForDataScan.

FltGetSectionContext increments the reference count on the context that the Context parameter points to. When this context pointer is no longer needed, the caller must decrement its reference count by calling FltReleaseContext. Thus every successful call to FltGetSectionContext must be matched by a subsequent call to FltReleaseContext.

To allocate a new context, call FltAllocateContext.

Important

Minifilters must not explicitly delete a section context passed to FltCreateSectionForDataScan. A section context is deallocated and removed from a stream by calling FltCloseSectionForDataScan in this case.

Requirements

   
Windows version The FltGetSectionContext routine is available starting with Windows 8.
Target Platform Universal
Header fltkernel.h (include Fltkernel.h)
Library FltMgr.lib
DLL Fltmgr.sys
IRQL "<= APC_LEVEL"

See Also

FltAllocateContext

FltCloseSectionForDataScan

FltCreateSectionForDataScan

FltReleaseContext