Expand Minimize

FltReleaseContext function

FltReleaseContext decrements the reference count on a context.

Syntax


VOID FltReleaseContext(
  _In_  PFLT_CONTEXT Context
);

Parameters

Context [in]

Pointer to the context. Must be a valid pointer to a context object for a volume, instance, stream, or stream handle. This parameter is required and cannot be NULL.

Return value

None

Remarks

A minifilter driver calls FltReleaseContext to release a context. FltReleaseContext decrements the reference count on the given context. When the reference count reaches zero, the context is freed immediately if the caller is running at IRQL <= APC_LEVEL. If the caller is running at IRQL DISPATCH_LEVEL, a work item is scheduled to free the context.

Note   After FltReleaseContext returns, the caller must not use the context, because the context might have already been freed.

Every successful call to FltAllocateContext, FltGetXxxContext, or FltReferenceContext must eventually be matched by a call to FltReleaseContext.

Note that the OldContext pointer returned by FltSetXxxContext and the Context parameter that is used to call FltDeleteContext must also be released by calling FltReleaseContext when they are no longer needed.

To allocate a new context, call FltAllocateContext.

To increment the reference count on a context, call FltReferenceContext.

For more information about context reference counting, see Referencing Contexts.

Callers of FltReleaseContext must be running at IRQL <= DISPATCH_LEVEL if the context was allocated from nonpaged pool. If the context was allocated from paged pool, callers must be running at IRQL <= APC_LEVEL.

Requirements

Header

Fltkernel.h (include Fltkernel.h)

Library

FltMgr.lib

IRQL

See Remarks section.

See also

FltAllocateContext
FltDeleteContext
FltGetContexts
FltGetFileContext
FltGetInstanceContext
FltGetStreamContext
FltGetStreamHandleContext
FltGetTransactionContext
FltGetVolumeContext
FltReferenceContext
FltReleaseContexts
FltSetFileContext
FltSetInstanceContext
FltSetStreamContext
FltSetStreamHandleContext
FltSetTransactionContext
FltSetVolumeContext

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft