Kernel32SetThreadStackGuarantee Method
Sets the minimum size of the stack associated with the calling thread or
fiber that will be available during any stack overflow exceptions.
This is useful for handling stack overflow exceptions;
the application can safely use the specified number of bytes during exception handling.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", ExactSpelling = true, SetLastError = true)]
public static bool SetThreadStackGuarantee(
ref uint refStackSizeInBytes
)
<DllImportAttribute("Kernel32.dll", ExactSpelling := true, SetLastError := true>]
Public Shared Function SetThreadStackGuarantee (
ByRef refStackSizeInBytes As UInteger
) As Boolean
Dim refStackSizeInBytes As UInteger
Dim returnValue As Boolean
returnValue = Kernel32.SetThreadStackGuarantee(refStackSizeInBytes)
public:
[DllImportAttribute(L"Kernel32.dll", ExactSpelling = true, SetLastError = true)]
static bool SetThreadStackGuarantee(
unsigned int% refStackSizeInBytes
)
[<DllImportAttribute("Kernel32.dll", ExactSpelling = true, SetLastError = true)>]
static member SetThreadStackGuarantee :
refStackSizeInBytes : uint32 byref -> bool
No code example is currently available or this language may not be supported.
- refStackSizeInBytes UInt32
-
The size of the stack, in bytes. On return, this value is set to the size of the previous stack, in bytes.
If this parameter is 0 (zero), the function succeeds and the parameter contains the size of the current stack.
If the specified size is less than the current size, the function succeeds but ignores this request.
Therefore, you cannot use this function to reduce the size of the stack.
This value cannot be larger than the reserved stack size.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.