X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoardTest%2FStackwalker.h;fp=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoardTest%2FStackwalker.h;h=c48bb47e807d823aa91ed563de86fa17fc7be95f;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoardTest/Stackwalker.h b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoardTest/Stackwalker.h new file mode 100644 index 000000000..c48bb47e8 --- /dev/null +++ b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoardTest/Stackwalker.h @@ -0,0 +1,57 @@ +/*//////////////////////////////////////////////////////////////////////////// + * Project: + * Memory_and_Exception_Trace + * + * /////////////////////////////////////////////////////////////////////////// + * File: + * Stackwalker.h + * + * Remarks: + * + * + * Note: + * + * + * Author: + * Jochen Kalmbach + * + *//////////////////////////////////////////////////////////////////////////// + +#ifndef __STACKWALKER_H__ +#define __STACKWALKER_H__ + +// Only valid in the following environment: Intel platform, MS VC++ 5/6/7/7.1/8 +#ifndef _X86_ +#error Only INTEL envirnoments are supported! +#endif + +// Only MS VC++ 5 to 7 +//#if (_MSC_VER < 1100) || (_MSC_VER > 1400) +//#error Only MS VC++ 5/6/7/7.1/8 supported. Check if the '_CrtMemBlockHeader' has not changed with this compiler! +//#endif + +typedef enum eAllocCheckOutput +{ + ACOutput_Simple, + ACOutput_Advanced, + ACOutput_XML +}; + +// Make extern "C", so it will also work with normal C-Programs +#ifdef __cplusplus +extern "C" { +#endif +extern int InitAllocCheckWN(eAllocCheckOutput eOutput, LPCTSTR pszFilename, ULONG ulShowStackAtAlloc = 0); +extern int InitAllocCheck(eAllocCheckOutput eOutput = ACOutput_Simple, BOOL bSetUnhandledExeptionFilter = TRUE, ULONG ulShowStackAtAlloc = 0); // will create the filename by itself + +extern ULONG DeInitAllocCheck(); + +extern DWORD StackwalkFilter( EXCEPTION_POINTERS *ep, DWORD status, LPCTSTR pszLogFile); + +extern void OnlyInstallUnhandeldExceptionFilter(eAllocCheckOutput eOutput = ACOutput_Simple); + +#ifdef __cplusplus +} +#endif + +#endif // __STACKWALKER_H__