Hardware Dev Center

Expand Minimize

FltGetSectionContext routine

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

Syntax


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

Parameters

Instance [in]

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

FileObject [in]

A pointer to a file object for the stream.

Context [out]

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 codeDescription
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

Target platform

Universal

Version

The FltGetSectionContext routine is available starting with Windows 8.

Header

Fltkernel.h (include Fltkernel.h)

Library

FltMgr.lib

IRQL

<= APC_LEVEL

See also

FltAllocateContext
FltCloseSectionForDataScan
FltCreateSectionForDataScan
FltReleaseContext

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft