Download EaseFilter Filter Driver SDK Setup File Download EaseFilter Filter Driver SDK Zip File
FltSetVolumeContext sets a context for a volume.
NTSTATUS FLTAPI FltSetVolumeContext( PFLT_VOLUME Volume, FLT_SET_CONTEXT_OPERATION Operation, PFLT_CONTEXT NewContext, PFLT_CONTEXT *OldContext );
Opaque volume pointer for the volume.
Flag specifying details of the operation to be performed. This parameter must be one of the following:
If a context is already set, replace it with NewContext. Otherwise, insert NewContext into the list of contexts for the volume.
If a context is already set, return STATUS_FLT_CONTEXT_ALREADY_DEFINED. Otherwise, insert NewContext into the list of contexts for the volume.
Pointer to the new context to be set for the volume. This parameter is required and cannot be NULL.
Pointer to a caller-allocated variable that receives the address of the existing volume context for Instance. This parameter is optional and can be NULL. (For more information about this parameter, see the following Remarks section.)
FltSetVolumeContext returns STATUS_SUCCESS or an appropriate NTSTATUS value such as one of the following:
||IF FLT_SET_CONTEXT_KEEP_IF_EXISTS was specified for Operation, this error code indicates that a context is already attached to the volume.|
||The context pointed to by the NewContext parameter is already linked to an object. In other words, this error code indicates that NewContext is already in use due to a successful prior call of an FltSetXxxContext routine.|
||The specified Volume is being torn down. This is an error code.|
||One of the following:
A minifilter driver calls FltSetVolumeContext to attach a context to a volume, or to remove or replace an existing volume context. A minifilter driver can attach only one context to a volume.
A successful call to FltSetVolumeContext increments the reference count on NewContext. If FltSetVolumeContext fails, the reference count remains unchanged. In either case, the filter calling FltSetVolumeContext must call FltReleaseContext to decrement the NewContext object. If FltSetVolumeContext fails and if the OldContext parameter is not NULL and does not point to NULL_CONTEXT then OldContext is a referenced pointer to the context currently associated with the transaction. The filter calling FltSetVolumeContext must call FltReleaseContext for OldContext as well.
Note that the OldContext pointer returned by FltSetVolumeContext must also be released by calling FltReleaseContext when it is no longer needed. For more information, see Setting Contexts and Releasing Contexts.
To allocate a new context, call FltAllocateContext.
To get a volume context, call FltGetVolumeContext.
For more information about context reference counting, see Referencing Contexts.
|Minimum supported client||Available and supported in Microsoft Windows 2000 Update Rollup 1 for SP4, Windows XP SP2, Windows Server 2003 SP1, and later operating systems. Not available nor supported in Windows 2000 SP4 and earlier operating systems.|
|Header||fltkernel.h (include Fltkernel.h)|