FltGetFileContext function (fltkernel.h)
The FltGetFileContext routine retrieves a context that was set for a file by a given minifilter driver instance.
NTSTATUS FLTAPI FltGetFileContext( [in] PFLT_INSTANCE Instance, [in] PFILE_OBJECT FileObject, [out] PFLT_CONTEXT *Context );
Opaque instance pointer for the caller. This parameter is required and cannot be NULL.
File object pointer for the file. This parameter is required and cannot be NULL.
Pointer to a caller-allocated variable that receives the address of the context. This parameter is required and cannot be set to NULL.
FltGetFileContext returns STATUS_SUCCESS when it successfully returns the requested file context. Otherwise, it returns an appropriate NTSTATUS value such as one of the following:
|STATUS_NOT_FOUND||No matching context was found on this file at this time, so FltMgr set Context to NULL_CONTEXT. This is an error code.|
|STATUS_NOT_SUPPORTED||File contexts are not supported for this file. This is an error code.|
For more information about contexts, see About minifilter contexts.
A minifilter driver calls FltGetFileContext to retrieve the file context that it has set for a given file.
FltGetFileContext 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 FltGetFileContext must be matched by a subsequent call to FltReleaseContext.
To set a file context, call FltSetFileContext.
To allocate a new context, call FltAllocateContext.
|Minimum supported client||Windows Vista|
|Header||fltkernel.h (include Fltkernel.h)|