的文档_EXCEPTION_RECORD
说它的一个成员,struct _EXCEPTION_RECORD *ExceptionRecord
指向关联的 EXCEPTION_RECORD 结构的指针。异常记录可以链接在一起,以便在发生嵌套异常时提供附加信息。
但是,我还没有能够引发嵌套结构化异常的这种情况。这是我到目前为止所尝试的:
#include <iostream>
#include <windows.h>
void Handle0(LPEXCEPTION_POINTERS pex) {
std::cout << "chain0 = " << pex->ExceptionRecord->ExceptionRecord << std::endl;
}
void Handle1(LPEXCEPTION_POINTERS pex) {
std::cout << "chain1 = " << pex->ExceptionRecord->ExceptionRecord << std::endl;
__try {
throw 3;
} __except( Handle0(GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER ) {}
}
int main() {
__try {
throw 3;
} __except( Handle1(GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER ) {}
return 0;
}
pex->ExceptionRecord->ExceptionRecord
总是nullptr
。_ 在什么情况下我会得到一个嵌套_EXCEPTION_RECORD
在那里的链接?