网站首页  词典首页

请输入您要查询的函数:

 

术语 setthreadstackguarantee
释义 SetThreadStackGuarantee
语法:
C++
BOOL WINAPI SetThreadStackGuarantee(
__inout PULONG StackSizeInBytes
);
SetThreadStackGuarantee功能
设置堆栈的最小大小与调用线程或光纤将在任何可堆栈溢出异常。这对于处理堆栈溢出异常,应用程序可以安全地使用异常处理的过程中指定的字节数。
参数
StackSizeInBytes [ in , out ]
堆栈的字节大小。回港后,此值设置为以前的堆栈大小,以字节为单位。
如果此参数为0(零),函数成功和参数包含当前堆栈大小。
如果指定的大小比目前的规模较少,函数成功,但忽略了这一请求。因此,您不能使用此功能,减少堆栈的大小。
该值不能大于保留的堆栈大小。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值为0(零)。为了获得更多错误信息,调用GetLastError。
备注
如果函数成功,应用程序可以处理可能出现的异常EXCEPTION_STACK_OVERFLOW使用结构化异常处理。要恢复在处理堆栈溢出的执行,您必须执行某些恢复步骤。如果您使用的是微软的C / C + +编译器,调用_resetstkoflw函数。如果您使用其他的编译器,看到恢复从堆栈溢出的编译器文档资料。
若要设置堆栈光纤保证,必须先调用SwitchToFiber函数来执行该纤维。在设置此纤维的保障,所用光纤无论哪个线程执行的纤维。
要求:
最低支持clientWindows Vista中,Windows XP Professional x64版本
最低支持serverWindows Server 2008中时,Windows Server 2003 SP1的
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
进程和线程函数
线程堆栈大小
主题
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SetThreadStackGuarantee Function
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.
Syntax
C++
BOOL WINAPI SetThreadStackGuarantee(
__inout PULONG StackSizeInBytes
);
Parameters
StackSizeInBytes [in, out]
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.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError .
Remarks
If the function is successful, the application can handle possible EXCEPTION_STACK_OVERFLOW exceptions using structured exception handling . To resume execution after handling a stack overflow, you must perform certain recovery steps. If you are using the Microsoft C/C++ compiler, call the _resetstkoflw function. If you are using another compiler, see the documentation for the compiler for information on recovering from stack overflows.
To set the stack guarantee for a fiber, you must first call the SwitchToFiber function to execute the fiber. After you set the guarantee for this fiber, it is used by the fiber no matter which thread executes the fiber.
Requirements
Minimum supported clientWindows Vista, Windows XP Professional x64 Edition
Minimum supported serverWindows Server 2008, Windows Server 2003 with SP1
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Process and Thread Functions
Thread Stack Size
Threads
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686283(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:25:15