Bewerken

Delen via


FltGetContexts function (fltkernel.h)

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

Syntax

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

Parameters

FltObjects

[in] Pointer to a 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] Identifies the types of contexts to retrieve. This parameter can be a bitwise OR of the following values.

Constant Value
FLT_VOLUME_CONTEXT 0x0001
FLT_INSTANCE_CONTEXT 0x0002
FLT_FILE_CONTEXT 0x0004
FLT_STREAM_CONTEXT 0x0008
FLT_STREAMHANDLE_CONTEXT 0x0010
FLT_TRANSACTION_CONTEXT 0x0020
FLT_SECTION_CONTEXT (starting in Windows 8) 020040
FLT_ALL_CONTEXTS Bitwise OR of all of the context values

Contexts

[out] Pointer to a caller-allocated FLT_RELATED_CONTEXTS structure that receives the requested contexts. This parameter is required and cannot be set to NULL. FltMgr sets a structure member to zero for:

  • Contexts that the caller did not request.
  • Contexts that the caller requested but FltMgr couldn't find.

Return value

None.

Remarks

For more information about contexts, see About minifilter contexts.

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

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

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

Requirement Value
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

FltGetContextsEx

FltRegisterFilter

FltReleaseContext

FltReleaseContexts

PFLT_INSTANCE_QUERY_TEARDOWN_CALLBACK

PFLT_INSTANCE_SETUP_CALLBACK

PFLT_INSTANCE_TEARDOWN_CALLBACK

PFLT_POST_OPERATION_CALLBACK

PFLT_PRE_OPERATION_CALLBACK