Expand Minimize

FltGetFileContext routine

The FltGetFileContext routine retrieves a context that was set for a file by a given minifilter driver instance.

Syntax


NTSTATUS FltGetFileContext(
  _In_  PFLT_INSTANCE Instance,
  _In_  PFILE_OBJECT  FileObject,
  _Out_ PFLT_CONTEXT  *Context
);

Parameters

Instance [in]

Opaque instance pointer for the caller. This parameter is required and cannot be NULL.

FileObject [in]

File object pointer for the file. This parameter is required and cannot be NULL.

Context [out]

Pointer to a caller-allocated variable that receives the address of the context. This parameter is required and cannot be NULL.

Return value

FltGetFileContext returns STATUS_SUCCESS or an appropriate NTSTATUS value such as one of the following:

Return codeDescription
STATUS_NOT_FOUND

No matching context was found. This is an error code.

STATUS_NOT_SUPPORTED

File contexts are not supported for this file. This is an error code.

 

Remarks

A minifilter driver calls FltGetFileContext to retrieve the file context that it has set for a given file.

To decrement the reference count on a context, call FltReleaseContext.

FltGetFileContext increments the reference count on the context that the Context parameter points to. 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.

To delete a file context, call FltDeleteFileContext or FltDeleteContext.

To determine whether file contexts are supported for a given file, call FltSupportsFileContexts or FltSupportsFileContextsEx.

Requirements

Target platform

Universal

Version

This routine is available on Windows Vista and later.

Header

Fltkernel.h (include Fltkernel.h)

Library

FltMgr.lib

IRQL

<= APC_LEVEL

See also

FLT_CONTEXT_REGISTRATION
FltAllocateContext
FltDeleteContext
FltDeleteFileContext
FltReleaseContext
FltSetFileContext
FltSupportsFileContexts
FltSupportsFileContextsEx

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft