]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoardTest/Stackwalker.h
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / DataBoardTest / Stackwalker.h
1 /*////////////////////////////////////////////////////////////////////////////\r
2  *  Project:\r
3  *    Memory_and_Exception_Trace\r
4  *\r
5  * ///////////////////////////////////////////////////////////////////////////\r
6  *  File:\r
7  *    Stackwalker.h\r
8  *\r
9  *  Remarks:\r
10  *\r
11  *\r
12  *  Note:\r
13  *\r
14  *\r
15  *  Author:\r
16  *    Jochen Kalmbach\r
17  *\r
18  *////////////////////////////////////////////////////////////////////////////\r
19 \r
20 #ifndef __STACKWALKER_H__\r
21 #define __STACKWALKER_H__\r
22 \r
23 // Only valid in the following environment: Intel platform, MS VC++ 5/6/7/7.1/8\r
24 #ifndef _X86_\r
25 #error Only INTEL envirnoments are supported!\r
26 #endif\r
27 \r
28 // Only MS VC++ 5 to 7\r
29 //#if (_MSC_VER < 1100) || (_MSC_VER > 1400)\r
30 //#error Only MS VC++ 5/6/7/7.1/8 supported. Check if the '_CrtMemBlockHeader' has not changed with this compiler!\r
31 //#endif\r
32 \r
33 typedef enum eAllocCheckOutput\r
34 {\r
35   ACOutput_Simple,\r
36   ACOutput_Advanced,\r
37   ACOutput_XML\r
38 };\r
39 \r
40 // Make extern "C", so it will also work with normal C-Programs\r
41 #ifdef __cplusplus\r
42 extern "C" {\r
43 #endif\r
44 extern int InitAllocCheckWN(eAllocCheckOutput eOutput, LPCTSTR pszFilename, ULONG ulShowStackAtAlloc = 0);\r
45 extern int InitAllocCheck(eAllocCheckOutput eOutput = ACOutput_Simple, BOOL bSetUnhandledExeptionFilter = TRUE, ULONG ulShowStackAtAlloc = 0);  // will create the filename by itself\r
46 \r
47 extern ULONG DeInitAllocCheck();\r
48 \r
49 extern DWORD StackwalkFilter( EXCEPTION_POINTERS *ep, DWORD status, LPCTSTR pszLogFile);\r
50 \r
51 extern void OnlyInstallUnhandeldExceptionFilter(eAllocCheckOutput eOutput = ACOutput_Simple);\r
52 \r
53 #ifdef __cplusplus\r
54 }\r
55 #endif\r
56 \r
57 #endif  // __STACKWALKER_H__\r