// wdm.h
LOGICAL IoWithinStackLimits(
[in] ULONG_PTR RegionStart,
[in] SIZE_T RegionSize
);
View the official Windows Driver Kit DDI referenceNo description available.
The IoWithinStackLimits routine determines whether a region of memory is within the stack limit of the current thread.
RegionStart [in]A pointer to the start of the region.
RegionSize [in]The size of the region.
IoWithinStackLimits returns TRUE is the current thread's stack contains the region completely and FALSE otherwise.
The IoWithinStackLimits routine considers all possible stack segments and the DPC stack, if necessary.
For drivers that use KeExpandKernelStackAndCallout, IoWithinStackLimits considers only the current thread.