FltGetContexts routine

The FltGetContexts routine retrieves a minifilter driver's contexts for the objects related to the current operation.

Syntax


VOID FltGetContexts(
  _In_  PCFLT_RELATED_OBJECTS FltObjects,
  _In_  FLT_CONTEXT_TYPE      DesiredContexts,
  _Out_ PFLT_RELATED_CONTEXTS Contexts
);

Parameters

FltObjects [in]

Pointer to an FLT_RELATED_OBJECTS structure containing opaque pointers for the objects related to the current operation. (For more information about this parameter, see the Remarks section.)

DesiredContexts [in]

Type of contexts to retrieve. This parameter can have one or more of the following values:

FLT_ALL_CONTEXTS

FLT_FILE_CONTEXT (Windows Vista and later only.)

FLT_INSTANCE_CONTEXT

FLT_STREAM_CONTEXT

FLT_STREAMHANDLE_CONTEXT

FLT_TRANSACTION_CONTEXT (Windows Vista and later only.)

FLT_VOLUME_CONTEXT

Contexts [out]

Pointer to a caller-allocated FLT_RELATED_CONTEXTS structure that receives the requested contexts. Contexts that are not requested, or requested but not found, are set to zero.

Return value

None

Remarks

A minifilter driver calls FltGetContexts to retrieve pointers to the minifilter driver's contexts for the objects in an FLT_RELATED_OBJECTS structure.

The following minifilter driver callback routine types receive a pointer to an FLT_RELATED_OBJECTS structure as the FltObjects input parameter:

PFLT_PRE_OPERATION_CALLBACK

PFLT_POST_OPERATION_CALLBACK

PFLT_INSTANCE_SETUP_CALLBACK

PFLT_INSTANCE_QUERY_TEARDOWN_CALLBACK

PFLT_INSTANCE_TEARDOWN_CALLBACK

FltGetContexts increments the reference count on each of the contexts returned in the FLT_RELATED_CONTEXTS structure that the Contexts parameter points to. Thus for every successful call to FltGetContexts, the caller must either:

  • Call FltReleaseContexts for the entire structure that the Contexts parameter points to.

  • Call FltReleaseContext for each of the contexts returned in the structure and set each context field returned in the structure to zero.

Requirements

Target platform

Universal

Header

Fltkernel.h (include Fltkernel.h)

Library

FltMgr.lib

DLL

Fltmgr.sys

IRQL

<= APC_LEVEL

See also

FLT_RELATED_CONTEXTS
FLT_RELATED_OBJECTS
FltRegisterFilter
FltReleaseContext
FltReleaseContexts
PFLT_INSTANCE_QUERY_TEARDOWN_CALLBACK
PFLT_INSTANCE_SETUP_CALLBACK
PFLT_INSTANCE_TEARDOWN_CALLBACK
PFLT_POST_OPERATION_CALLBACK
PFLT_PRE_OPERATION_CALLBACK

 

 

Send comments about this topic to Microsoft

Show: