OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Stackwalker.cpp File Reference
#include <owl/pch.h>
#include <windows.h>
#include <string>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <crtdbg.h>
#include <tchar.h>
#include <algorithm>
#include "stackwalker.h"
#include <imagehlp.h>

Go to the source code of this file.

Macros

#define HASH_ENTRY_REMOVE_AT_FREE
 
#define ALLOC_HASH_ENTRIES   /*1024*/8192
 
#define MAX_ESP_LEN_BUF   0x500
 
#define IGNORE_CRT_ALLOC
 
#define LOG_FILE_MAX_SIZE   1024*128
 
#define WITH_IMALLOC_SPY
 
#define SYMOPT_LOAD_LINES   0x00000010
 
#define MAX_EIP_LEN_BUF   4
 
#define ALLOC_ENTRY_NOT_FOUND   0xFFFFFFFF
 
#define nNoMansLandSize   4
 
#define pbData(pblock)   ((unsigned char *)((_CrtMemBlockHeader *)pblock + 1))
 
#define pHdr(pbData)   (((_CrtMemBlockHeader *)pbData)-1)
 
#define gle   (GetLastError())
 
#define lenof(a)   (sizeof(a) / sizeof((a)[0]))
 
#define MAXNAMELEN   1024
 
#define IMGSYMLEN   ( sizeof IMAGEHLP_SYMBOL )
 
#define TTBUFLEN   8096
 
#define MAX_MODULE_NAME32   255
 
#define TH32CS_SNAPMODULE   0x00000008
 

Functions

int InitAllocCheckWN (eAllocCheckOutput eOutput, LPCTSTR pszFileName, ULONG ulShowStackAtAlloc)
 
int InitAllocCheck (eAllocCheckOutput eOutput, BOOL bSetUnhandledExeptionFilter, ULONG ulShowStackAtAlloc)
 
ULONG DeInitAllocCheck (void)
 
DWORD StackwalkFilter (EXCEPTION_POINTERS *ep, DWORD status, LPCTSTR pszLogFile)
 

Macro Definition Documentation

◆ ALLOC_ENTRY_NOT_FOUND

#define ALLOC_ENTRY_NOT_FOUND   0xFFFFFFFF

Definition at line 278 of file Stackwalker.cpp.

◆ ALLOC_HASH_ENTRIES

#define ALLOC_HASH_ENTRIES   /*1024*/8192

Definition at line 58 of file Stackwalker.cpp.

◆ gle

#define gle   (GetLastError())

Definition at line 1306 of file Stackwalker.cpp.

◆ HASH_ENTRY_REMOVE_AT_FREE

#define HASH_ENTRY_REMOVE_AT_FREE

Definition at line 44 of file Stackwalker.cpp.

◆ IGNORE_CRT_ALLOC

#define IGNORE_CRT_ALLOC

Definition at line 66 of file Stackwalker.cpp.

◆ IMGSYMLEN

#define IMGSYMLEN   ( sizeof IMAGEHLP_SYMBOL )

Definition at line 1309 of file Stackwalker.cpp.

◆ lenof

#define lenof ( a)    (sizeof(a) / sizeof((a)[0]))

Definition at line 1307 of file Stackwalker.cpp.

◆ LOG_FILE_MAX_SIZE

#define LOG_FILE_MAX_SIZE   1024*128

Definition at line 69 of file Stackwalker.cpp.

◆ MAX_EIP_LEN_BUF

#define MAX_EIP_LEN_BUF   4

Definition at line 276 of file Stackwalker.cpp.

◆ MAX_ESP_LEN_BUF

#define MAX_ESP_LEN_BUF   0x500

Definition at line 62 of file Stackwalker.cpp.

◆ MAX_MODULE_NAME32

#define MAX_MODULE_NAME32   255

Definition at line 1385 of file Stackwalker.cpp.

◆ MAXNAMELEN

#define MAXNAMELEN   1024

Definition at line 1308 of file Stackwalker.cpp.

◆ nNoMansLandSize

#define nNoMansLandSize   4

Definition at line 1061 of file Stackwalker.cpp.

◆ pbData

#define pbData ( pblock)    ((unsigned char *)((_CrtMemBlockHeader *)pblock + 1))

Definition at line 1090 of file Stackwalker.cpp.

◆ pHdr

#define pHdr ( pbData)    (((_CrtMemBlockHeader *)pbData)-1)

Definition at line 1091 of file Stackwalker.cpp.

◆ SYMOPT_LOAD_LINES

#define SYMOPT_LOAD_LINES   0x00000010

Definition at line 220 of file Stackwalker.cpp.

◆ TH32CS_SNAPMODULE

#define TH32CS_SNAPMODULE   0x00000008

Definition at line 1386 of file Stackwalker.cpp.

◆ TTBUFLEN

#define TTBUFLEN   8096

Definition at line 1310 of file Stackwalker.cpp.

◆ WITH_IMALLOC_SPY

#define WITH_IMALLOC_SPY

Definition at line 72 of file Stackwalker.cpp.

Function Documentation

◆ DeInitAllocCheck()

ULONG DeInitAllocCheck ( void )

Definition at line 2231 of file Stackwalker.cpp.

◆ InitAllocCheck()

int InitAllocCheck ( eAllocCheckOutput eOutput,
BOOL bSetUnhandledExeptionFilter,
ULONG ulShowStackAtAlloc )

Definition at line 2192 of file Stackwalker.cpp.

References _MAX_PATH, _T, _tcscat, _tcscpy, ACOutput_XML, and InitAllocCheckWN().

◆ InitAllocCheckWN()

int InitAllocCheckWN ( eAllocCheckOutput eOutput,
LPCTSTR pszFileName,
ULONG ulShowStackAtAlloc )

Definition at line 2151 of file Stackwalker.cpp.

References _T.

◆ StackwalkFilter()

DWORD StackwalkFilter ( EXCEPTION_POINTERS * ep,
DWORD status,
LPCTSTR pszLogFile )

Definition at line 2299 of file Stackwalker.cpp.

References _T, _tcscat, _tcscpy, _tfopen, ACOutput_XML, LOG_FILE_MAX_SIZE, and MAX_PATH.