FltGetInstanceContext function (fltkernel.h)

The FltGetInstanceContext routine retrieves a context that was set for an instance by a given minifilter driver.

Syntax

NTSTATUS FLTAPI FltGetInstanceContext(
  [in]  PFLT_INSTANCE Instance,
  [out] PFLT_CONTEXT  *Context
);

Parameters

[in] Instance

Opaque instance pointer for the instance.

[out] Context

Pointer to a caller-allocated variable that receives the address of the instance context. This parameter is required and can't be set to NULL.

Return value

FltGetInstanceContext returns STATUS_SUCCESS when it successfully returns the requested instance context. Otherwise, it returns an appropriate NTSTATUS value, such as the following:

Return code Description
STATUS_NOT_FOUND No matching context was found on this instance at this time. FltMgr sets Context to NULL_CONTEXT. This is an error code.

Remarks

For more information about contexts, see About minifilter contexts.

FltGetInstanceContext retrieves a context that was set for an instance by a given minifilter driver.

FltGetInstanceContext 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 FltGetInstanceContext must be matched by a subsequent call to FltReleaseContext.

To set a context for an instance, call FltSetInstanceContext.

To allocate a new context, call FltAllocateContext.

To delete a file context, call FltDeleteInstanceContext or FltDeleteContext.

Requirements

Requirement Value
Target Platform Universal
Header fltkernel.h (include Fltkernel.h)
Library FltMgr.lib
DLL Fltmgr.sys
IRQL <= APC_LEVEL

See also

FltAllocateContext

FltDeleteContext

FltDeleteInstanceContext

FltReleaseContext

FltSetInstanceContext