ISIS Logo
PIXELMAN
EPICS plugin for Pixelman
Win32Exceptions.cpp
1 #include <windows.h>
2 #include <stdexcept>
3 #include "Win32Exceptions.h"
4 
5 std::string Win32StructuredException::win32_message(unsigned int code, EXCEPTION_POINTERS * pExp)
6 {
7  char buffer[256];
8  _snprintf(buffer, sizeof(buffer), "Win32StructuredException code 0x%x pExpCode 0x%x pExpAddress %p", code, pExp->ExceptionRecord->ExceptionCode, pExp->ExceptionRecord->ExceptionAddress);
9  buffer[sizeof(buffer)-1] = '\0';
10  return std::string(buffer);
11 }
12 
13 void seTransFunction(unsigned int u, EXCEPTION_POINTERS* pExp)
14 {
15  throw Win32StructuredException(u, pExp);
16 }
17 
18 void registerStructuredExceptionHandler()
19 {
20  _set_se_translator(seTransFunction);
21 }
An STL exception describing a Win32 Structured Exception.
Copyright © 2013 Science and Technology Facilities Council | Generated by   doxygen 1.8.8