int setjmp(jmp_buf qEnvironment);
#include <iostream> #include <csetjmp> int main() { using namespace std; jmp_buf qEnv; // Get the stack environment in qEnv int iRet = setjmp(qEnv); // Cast to a _JUMP_BUFFER for easier access - Microsoft specific _JUMP_BUFFER* qpStackEnv = (_JUMP_BUFFER*)(&qEnv); cout << "Return value = " << iRet << endl; cout << "Cookie = " << qpStackEnv->Cookie << endl; cout << "Ebp = " << qpStackEnv->Ebp << endl; cout << "Ebx = " << qpStackEnv->Ebx << endl; cout << "Edi = " << qpStackEnv->Edi << endl; cout << "Eip = " << qpStackEnv->Eip << endl; cout << "Esi = " << qpStackEnv->Esi << endl; cout << "Esp = " << qpStackEnv->Esp << endl; cout << "Registration = " << qpStackEnv->Registration << endl; cout << "TryLevel = " << qpStackEnv->TryLevel << endl; for (unsigned int uiIndex = 0; uiIndex < 6; ++uiIndex) { cout << "UnwindData[" << uiIndex << "] = " << qpStackEnv->UnwindData[uiIndex] << endl; } cout << "UnwindFunc = " << qpStackEnv->UnwindFunc << endl; return 0; }
© 20072023 XoaX.net LLC. All rights reserved.