FsRtlPostStackOverflow function (ntifs.h)

The FsRtlPostStackOverflow routine posts a stack overflow item to the stack overflow thread.

Syntax

void FsRtlPostStackOverflow(
  [in] PVOID                         Context,
  [in] PKEVENT                       Event,
  [in] PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine
);

Parameters

[in] Context

A context pointer to be passed to the stack overflow callback routine.

[in] Event

A pointer to a caller-allocated notification event to pass to the stack overflow callback routine. Must have been initialized as nonsignaled by calling KeInitializeEvent.

[in] StackOverflowRoutine

A pointer to a callback routine to be invoked when processing the request in the overflow thread.

Return value

None

Remarks

A file system typically calls FsRtlPostStackOverflow during a file I/O operation when the amount of remaining stack space returned by IoGetRemainingStackSize is below the file system's stack overflow threshold for the operation. FsRtlPostStackOverflow posts the I/O request to a special stack overflow work queue. When the I/O operation has been completed, the caller's Event is set to a signaled state.

File system filter drivers should use IoQueueWorkItem instead of FsRtlPostStackOverflow, because IoQueueWorkItem ensures that the device object that is associated with the specified work item is available for the processing of the work item.

If a pool allocation failure occurs, FsRtlPostStackOverflow raises a STATUS_INSUFFICIENT_RESOURCES exception. To gain control if this pool allocation failure occurs, the driver should wrap the call to FsRtlPostStackOverflow in a try-except or try-finally statement.

Requirements

Requirement Value
Minimum supported client Windows 2000
Target Platform Universal
Header ntifs.h (include FltKernel.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= DISPATCH_LEVEL

See also

FsRtlPostPagingFileStackOverflow

IoGetRemainingStackSize

IoQueueWorkItem

KeInitializeEvent