Skip to content

Latest commit

 

History

History
105 lines (75 loc) · 4.58 KB

nf-fltkernel-fltdeletefilecontext.md

File metadata and controls

105 lines (75 loc) · 4.58 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:fltkernel.FltDeleteFileContext
FltDeleteFileContext function (fltkernel.h)
The FltDeleteFileContext routine retrieves and deletes a file context that a given minifilter driver has set for a given file.
ifsk\fltdeletefilecontext.htm
ifsk
01/22/2021
FltDeleteFileContext function
FltApiRef_a_to_d_53ae4cfc-b70a-405d-b947-cb0f04d4663b.xml, FltDeleteFileContext, FltDeleteFileContext routine [Installable File System Drivers], fltkernel/FltDeleteFileContext, ifsk.fltdeletefilecontext
fltkernel.h
Fltkernel.h
Universal
Windows Vista and later
FltMgr.lib
<= APC_LEVEL
Windows
FltDeleteFileContext
fltkernel/FltDeleteFileContext
APIRef
kbSyntax
LibDef
FltMgr.lib
FltMgr.dll
FltDeleteFileContext

FltDeleteFileContext function

-description

The FltDeleteFileContext routine retrieves and deletes a file context that a given minifilter driver has set for a given file.

-parameters

-param Instance [in]

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

-param FileObject [in]

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

-param OldContext [out]

Pointer to a caller-allocated variable that receives the address of the deleted context. If no matching context is found, this variable receives NULL_CONTEXT. This parameter is optional and can be NULL. For more information about this parameter, see the following Remarks section.

-returns

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

Return code Description
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

For more information about contexts, see About minifilter contexts.

Because contexts are reference-counted, it is not usually necessary for a minifilter driver to call a routine such as FltDeleteFileContext or FltDeleteContext to explicitly delete a context.

A minifilter driver calls FltDeleteFileContext to retrieve and delete a file context that it previously set for a file by calling FltSetFileContext.

If the OldContext parameter is NULL on input and a matching file context is found, FltDeleteFileContext releases the reference that was added by the minifilter driver's previous call to FltSetFileContext. The deleted context is usually freed immediately unless there is an outstanding reference on it (for example, because the context is still being used by another thread).

If the OldContext parameter is not NULL and a matching file context is found and returned, the caller is responsible for releasing the reference that was added by FltSetFileContext. To release this reference, the minifilter driver must call FltReleaseContext on the deleted file context as soon as possible after performing any necessary cleanup.

To allocate a new context, call FltAllocateContext.

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

-see-also

FLT_CONTEXT_REGISTRATION

FltAllocateContext

FltDeleteContext

FltGetFileContext

FltReleaseContext

FltSetFileContext

FltSupportsFileContexts

FltSupportsFileContextsEx