网站首页  词典首页

请输入您要查询的函数:

 

术语 getexceptioncode
释义 GetExceptionCode
语法:
C++
DWORD GetExceptionCode(void);
GetExceptionCode宏
检索代码标识异常的类型发生。该函数可以调用只能从过滤器内的表达或异常处理程序的异常处理程序块。
注意:微软的C / C + +优化编译器解释作为关键字这项功能,其境外使用适当的异常处理的语法生成一个编译器错误。
参数
此宏没有参数。
返回值
返回值标识异常的类型。下表列出的异常代码,由于可能出现常见的编程错误。这些值定义Winbase.h和WINNT.H中。
返回codeDescription
EXCEPTION_ACCESS_VIOLATIONThe线程试图读取或写入到虚拟地址,它无法访问。
此值被定义为STATUS_ACCESS_VIOLATION。
EXCEPTION_ARRAY_BOUNDS_EXCEEDEDThe线程试图访问数组元素是出界,和底层硬件支持的边界检查。
This value is defined as STATUS_ARRAY_BOUNDS_EXCEEDED.
EXCEPTION_BREAKPOINTA遇到断点。
此值被定义为STATUS_BREAKPOINT。
EXCEPTION_DATATYPE_MISALIGNMENTThe线程试图读取或写入数据的硬件上是不提供对准对齐。例如,16位值必须在2对齐字节边界,32位值的4字节边界,等等。
此值被定义为STATUS_DATATYPE_MISALIGNMENT。
操作数EXCEPTION_FLT_DENORMAL_OPERANDOne在浮点运算,是denormal。阿denormal值是一个太小,代表作为标准浮点值。
此值被定义为STATUS_FLOAT_DENORMAL_OPERAND。
EXCEPTION_FLT_DIVIDE_BY_ZEROThe线程试图除以0浮点除数(零)一个浮点值。
此值被定义为STATUS_FLOAT_DIVIDE_BY_ZERO。
EXCEPTION_FLT_INEXACT_RESULTThe的浮点运算结果不能完全代表一个小数。
此值被定义为STATUS_FLOAT_INEXACT_RESULT。
EXCEPTION_FLT_INVALID_OPERATIONA浮点异常,不包括在此列表中。
此值被定义为STATUS_FLOAT_INVALID_OPERATION。
EXCEPTION_FLT_OVERFLOWThe的浮点运算指数大于相应类型所允许的程度。
此值被定义为STATUS_FLOAT_OVERFLOW。
EXCEPTION_FLT_STACK_CHECKThe栈溢出或underflowed,由于浮点运算。
此值被定义为STATUS_FLOAT_STACK_CHECK。
EXCEPTION_FLT_UNDERFLOWThe的浮点运算指数是不是由相应的类型所允许的程度低。
此值被定义为STATUS_FLOAT_UNDERFLOW。
EXCEPTION_GUARD_PAGEThe线程访问修饰符与PAGE_GUARD分配的内存。
此值被定义为STATUS_GUARD_PAGE_VIOLATION。
EXCEPTION_ILLEGAL_INSTRUCTIONThe线程试图执行无效指令。
此值被定义为STATUS_ILLEGAL_INSTRUCTION。
EXCEPTION_IN_PAGE_ERRORThe线程试图访问的网页不存在,系统无法加载的页面。例如,可能会出现此异常如果网络连接丢失,而在网络上运行的程序。
此值被定义为STATUS_IN_PAGE_ERROR。
EXCEPTION_INT_DIVIDE_BY_ZEROThe线程试图除以一个整数除数为0(零)的整数值。
此值被定义为STATUS_INTEGER_DIVIDE_BY_ZERO。
EXCEPTION_INT_OVERFLOWThe一个整数操作的结果导致携带结果的最重要的一点了。
此值被定义为STATUS_INTEGER_OVERFLOW。
EXCEPTION_INVALID_DISPOSITIONAn异常处理程序返回一个无效的倾向,异常调度。程序员使用,如C高级语言,千万不要遇到这种例外。
此值被定义为STATUS_INVALID_DISPOSITION。
EXCEPTION_INVALID_HANDLEThe线程使用的句柄的内核对象是无效的(可能是因为它已被关闭。)
此值被定义为STATUS_INVALID_HANDLE。
EXCEPTION_NONCONTINUABLE_EXCEPTIONThe线程试图继续执行后,非,可持续例外发生。
此值被定义为STATUS_NONCONTINUABLE_EXCEPTION。
EXCEPTION_PRIV_INSTRUCTIONThe线程试图执行一个不是在目前的计算机操作模式允许指令。
此值被定义为STATUS_PRIVILEGED_INSTRUCTION。
EXCEPTION_SINGLE_STEPA跟踪陷阱或其他单一的指令信号的机制,一个指令执行。
此值被定义为STATUS_SINGLE_STEP。
EXCEPTION_STACK_OVERFLOWThe线程使用了它的堆栈。
此值被定义为STATUS_STACK_OVERFLOW。
STATUS_UNWIND_CONSOLIDATEA框架整合已被处决。
备注
该GetExceptionCode函数可以调用只能从过滤器内的表达或异常处理程序的异常处理程序块。该过滤器表达式求值,如果异常期间__try块的执行时,它确定是否__except块被执行。
该过滤器表达式可以调用一个过滤功能。该过滤函数不能调用GetExceptionCode。然而,GetExceptionCode返回值可以传递给函数的参数过滤器。该GetExceptionInformation函数的返回值也可以通过作为一个过滤函数的参数。 GetExceptionInformation返回一个指针结构,其中包括异常代码信息。
当嵌套处理存在的,每个过滤器表达式求值,直到一个是EXCEPTION_EXECUTE_HANDLER或EXCEPTION_CONTINUE_EXECUTION评估。每个过滤器表达式可以调用GetExceptionCode获取异常代码。
唯一的例外代码返回是由硬件异常,或RaiseException函数中指定一个软件的代码生成的代码生成的异常。
当断点异常处理,重要的是要增加在上下文记录指令指针继续从这一例外。
实例
有关示例,请参阅使用异常处理程序。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
参见
GetExceptionInformation
RaiseException
结构化异常处理函数
结构化异常处理概述
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==GetExceptionCode Macro
Retrieves a code that identifies the type of exception that occurs. The function can be called only from within the filter expression or exception-handler block of an exception handler.
Note The Microsoft C/C++ Optimizing Compiler interprets this function as a keyword, and its use outside the appropriate exception-handling syntax generates a compiler error.
Syntax
C++
DWORD GetExceptionCode(void);
Parameters
This macro has no parameters.
Return Value
The return value identifies the type of exception. The following table identifies the exception codes that can occur due to common programming errors. These values are defined in Winbase.h and Winnt.h.
Return codeDescription
EXCEPTION_ACCESS_VIOLATIONThe thread attempts to read from or write to a virtual address for which it does not have access.
This value is defined as STATUS_ACCESS_VIOLATION.
EXCEPTION_ARRAY_BOUNDS_EXCEEDEDThe thread attempts to access an array element that is out of bounds, and the underlying hardware supports bounds checking.
This value is defined as STATUS_ARRAY_BOUNDS_EXCEEDED.
EXCEPTION_BREAKPOINTA breakpoint is encountered.
This value is defined as STATUS_BREAKPOINT.
EXCEPTION_DATATYPE_MISALIGNMENTThe thread attempts to read or write data that is misaligned on hardware that does not provide alignment. For example, 16-bit values must be aligned on 2-byte boundaries, 32-bit values on 4-byte boundaries, and so on.
This value is defined as STATUS_DATATYPE_MISALIGNMENT.
EXCEPTION_FLT_DENORMAL_OPERANDOne of the operands in a floating point operation is denormal. A denormal value is one that is too small to represent as a standard floating point value.
This value is defined as STATUS_FLOAT_DENORMAL_OPERAND.
EXCEPTION_FLT_DIVIDE_BY_ZEROThe thread attempts to divide a floating point value by a floating point divisor of 0 (zero).
This value is defined as STATUS_FLOAT_DIVIDE_BY_ZERO.
EXCEPTION_FLT_INEXACT_RESULTThe result of a floating point operation cannot be represented exactly as a decimal fraction.
This value is defined as STATUS_FLOAT_INEXACT_RESULT.
EXCEPTION_FLT_INVALID_OPERATIONA floating point exception that is not included in this list.
This value is defined as STATUS_FLOAT_INVALID_OPERATION.
EXCEPTION_FLT_OVERFLOWThe exponent of a floating point operation is greater than the magnitude allowed by the corresponding type.
This value is defined as STATUS_FLOAT_OVERFLOW.
EXCEPTION_FLT_STACK_CHECKThe stack has overflowed or underflowed, because of a floating point operation.
This value is defined as STATUS_FLOAT_STACK_CHECK.
EXCEPTION_FLT_UNDERFLOWThe exponent of a floating point operation is less than the magnitude allowed by the corresponding type.
This value is defined as STATUS_FLOAT_UNDERFLOW.
EXCEPTION_GUARD_PAGEThe thread accessed memory allocated with the PAGE_GUARD modifier.
This value is defined as STATUS_GUARD_PAGE_VIOLATION.
EXCEPTION_ILLEGAL_INSTRUCTIONThe thread tries to execute an invalid instruction.
This value is defined as STATUS_ILLEGAL_INSTRUCTION.
EXCEPTION_IN_PAGE_ERRORThe thread tries to access a page that is not present, and the system is unable to load the page. For example, this exception might occur if a network connection is lost while running a program over a network.
This value is defined as STATUS_IN_PAGE_ERROR.
EXCEPTION_INT_DIVIDE_BY_ZEROThe thread attempts to divide an integer value by an integer divisor of 0 (zero).
This value is defined as STATUS_INTEGER_DIVIDE_BY_ZERO.
EXCEPTION_INT_OVERFLOWThe result of an integer operation causes a carry out of the most significant bit of the result.
This value is defined as STATUS_INTEGER_OVERFLOW.
EXCEPTION_INVALID_DISPOSITIONAn exception handler returns an invalid disposition to the exception dispatcher. Programmers using a high-level language such as C should never encounter this exception.
This value is defined as STATUS_INVALID_DISPOSITION.
EXCEPTION_INVALID_HANDLEThe thread used a handle to a kernel object that was invalid (probably because it had been closed.)
This value is defined as STATUS_INVALID_HANDLE.
EXCEPTION_NONCONTINUABLE_EXCEPTIONThe thread attempts to continue execution after a non-continuable exception occurs.
This value is defined as STATUS_NONCONTINUABLE_EXCEPTION.
EXCEPTION_PRIV_INSTRUCTIONThe thread attempts to execute an instruction with an operation that is not allowed in the current computer mode.
This value is defined as STATUS_PRIVILEGED_INSTRUCTION.
EXCEPTION_SINGLE_STEPA trace trap or other single instruction mechanism signals that one instruction is executed.
This value is defined as STATUS_SINGLE_STEP.
EXCEPTION_STACK_OVERFLOWThe thread uses up its stack.
This value is defined as STATUS_STACK_OVERFLOW.
STATUS_UNWIND_CONSOLIDATEA frame consolidation has been executed.

Remarks
The GetExceptionCode function can be called only from within the filter expression or exception-handler block of an exception handler. The filter expression is evaluated if an exception occurs during execution of the __try block, and it determines whether or not the __except block is executed.
The filter expression can invoke a filter function. The filter function cannot call GetExceptionCode. However, the return value of GetExceptionCode can be passed as a parameter to a filter function. The return value of the GetExceptionInformation function can also be passed as a parameter to a filter function. GetExceptionInformation returns a pointer to a structure that includes the exception code information.
When nested handlers exist, each filter expression is evaluated until one is evaluated as EXCEPTION_EXECUTE_HANDLER or EXCEPTION_CONTINUE_EXECUTION. Each filter expression can invoke GetExceptionCode to get the exception code.
The exception code returned is the code generated by a hardware exception, or the code specified in the RaiseException function for a software generated exception.
When handling the breakpoint exception, it is important to increment the instruction pointer in the context record to continue from this exception.
Examples
For an example, see Using an Exception Handler .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
See Also
GetExceptionInformation
RaiseException
Structured Exception Handling Functions
Structured Exception Handling Overview
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms679356(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:24:06