FltAdjustDeviceStackSizeForIoRedirection function (fltkernel.h)
The FltAdjustDeviceStackSizeForIoRedirection routine increases the size of the source device stack to allow a minifilter to redirect I/O from a specified source instance to a specified target instance when the target stack is deeper than the source stack.
Syntax
NTSTATUS FLTAPI FltAdjustDeviceStackSizeForIoRedirection(
[in] PFLT_INSTANCE SourceInstance,
[in] PFLT_INSTANCE TargetInstance,
[out, optional] PBOOLEAN SourceDeviceStackSizeModified
);
Parameters
[in] SourceInstance
The filter instance on the source device stack.
[in] TargetInstance
The filter instance on the target device stack.
[out, optional] SourceDeviceStackSizeModified
This optional parameter has a value of TRUE if the FltAdjustDeviceStackSizeForIoRedirection routine modified the size of the source device stack, FALSE otherwise.
Return value
Return value | Description |
---|---|
|
Success. |
|
The redirection is not supported. |
|
The source device stack would be too large after calling this routine. |
Remarks
Using FltAdjustDeviceStackSizeForIoRedirection does not guarantee that every IRP that the minifilter encounters will be sufficient in size to be redirected to the target stack. IRPs that were allocated and issued before the call to FltAdjustDeviceStackSizeForIoRedirection would still have been allocated based on the old stack size.
A minifilter can adjust the stack size during instance setup if the filter knows which stack the I/O will be redirected to.
The filter can issue its own create operation down the new stack using FltCreateFile. Before completing the create operation, the filter can adjust the stack size to account for the target stack. Doing that adjustment ensures that the stack size will be adjusted before the create action is completed. All IRPs allocated for that file object will have a large enough stack to support redirection.
During instance-setup or during post-create callback for a redirected file object, use FltIsIoRedirectionAllowed to determine if redirection is possible without modifying the source stack. If necessary, use FltAdjustDeviceStackSizeForIoRedirection to adjust the source stack.
In the pre-operation callback for every operation that needs redirection, use FltIsIoRedirectionAllowedForOperation to determine if redirection is possible without modifying the source stack. If necessary, use FltAdjustDeviceStackSizeForIoRedirection to adjust the source stack.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Available in Windows 7 and later versions of the Windows operating system. |
Target Platform | Universal |
Header | fltkernel.h (include FltKernel.h) |
Library | FltMgr.lib |
IRQL | <=DISPATCH_LEVEL |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for