GetCurrentThreadStackLimits

Retrieves the boundaries of the stack that was allocated by the system for the current thread.

Syntax

void GetCurrentThreadStackLimits(
         PULONG_PTR LowLimit,
         PULONG_PTR HighLimit
)  

Parameters

LowLimit
Type: PULONG_PTRĀ 

[out] A pointer variable that receives the lower boundary of the current thread stack.

HighLimit
Type: PULONG_PTRĀ 

[out] A pointer variable that receives the upper boundary of the current thread stack.

Return value

None.

Remarks

It is possible for user-mode code to execute in stack memory that is outside the region allocated by the system when the thread was created. Callers can use GetCurrentThreadStackLimits to verify that the current stack pointer is within the returned limits.

Requirements

Header: Declared in processthreadsapi.h.

Library: Use kernelx.lib.