BugSplat Native DLL  Version 3.3.1.0
BugSplat integration code for native Windows applications
 All Classes Files Functions Variables Macros
BugSplatImp.cpp File Reference
#include "stdafx.h"
#include "TlHelp32.h"
#include "BugSplatImp.h"
#include "resBugSplatRc.h"
#include "resSbSender.h"

Macros

#define SNAPPROLOG(Cntx)
 
#define SNAPEPILOG(eRetVal)
 
#define COPYKEYCONTEXTREGISTERS(stFinalCtx, stInitialCtx)
 
#define k_CALLNEARBACK   5
 
#define k_CALLFARBACK   6
 

Functions

void * _ReturnAddress (void)
 
BOOL CalculateBeginningOfCallInstruction (UINT_PTR &dwRetAddr)
 
BOOL CreateMiniDumpFromSnap (HANDLE hProcess, DWORD dwProcId, DWORD dwThreadId, MINIDUMPWRITEDUMP pMDWD, HANDLE hFile, PCONTEXT pCtx)
 
BOOL __declspec (naked) SnapCurrentProcessMinidump(HANDLE hProcess
 
 SNAPPROLOG (stInitialCtx)
 
ZeroMemory & stFinalCtx (CONTEXT)
 
 if (hThread)
 
 if (bRetVal)
 
 SNAPEPILOG (bRetVal)
 
UINT TCHARtoUINT (TCHAR chVal)
 
TCHAR UINTtoTCHAR (UINT uiVal)
 
UINT combine4_1 (UINT uiLeft, UINT uiRight)
 
UINT combine3_2 (UINT uiLeft, UINT uiRight)
 
UINT combine2_3 (UINT uiLeft, UINT uiRight)
 
UINT combine1_4 (UINT uiLeft, UINT uiRight)
 
UINT combineLast3 (UINT uiVal)
 

Variables

BOOL DWORD dwProcId
 
BOOL DWORD DWORD dwThreadId
 
BOOL DWORD DWORD MINIDUMPWRITEDUMP pMDWD
 
BOOL DWORD DWORD
MINIDUMPWRITEDUMP HANDLE hFile
BOOL 
bRetVal = FALSE
 
HANDLE hThread = OpenThread(THREAD_GET_CONTEXT|THREAD_QUERY_INFORMATION, FALSE, dwThreadId)
 
CONTEXT stInitialCtx
 
CONTEXT stFinalCtx
 
stFinalCtx ContextFlags
 

Macro Definition Documentation

#define COPYKEYCONTEXTREGISTERS (   stFinalCtx,
  stInitialCtx 
)
Value:
stFinalCtx.Eax = stInitialCtx.Eax ; \
stFinalCtx.Ebx = stInitialCtx.Ebx ; \
stFinalCtx.Ecx = stInitialCtx.Ecx ; \
stFinalCtx.Edx = stInitialCtx.Edx ; \
stFinalCtx.Edi = stInitialCtx.Edi ; \
stFinalCtx.Esi = stInitialCtx.Esi ; \
stFinalCtx.SegGs = stInitialCtx.SegGs ; \
stFinalCtx.SegFs = stInitialCtx.SegFs ; \
stFinalCtx.SegEs = stInitialCtx.SegEs ; \
stFinalCtx.SegDs = stInitialCtx.SegDs ; \
stFinalCtx.SegCs = stInitialCtx.SegCs ; \
stFinalCtx.SegSs = stInitialCtx.SegSs ; \
stFinalCtx.Ebp = stInitialCtx.Ebp
#define k_CALLFARBACK   6
#define k_CALLNEARBACK   5
#define SNAPEPILOG (   eRetVal)
Value:
__asm POP EDX /* Restore saved registers. */ \
__asm POP ECX \
__asm POP EBX \
__asm POP EDI \
__asm POP ESI \
__asm MOV EAX , eRetVal /* Set the return value. */ \
__asm MOV ESP , EBP /* Restore the stack pointer. */ \
__asm POP EBP /* Restore the frame pointer. */ \
__asm RET /* Return to caller. */
#define SNAPPROLOG (   Cntx)

Function Documentation

BOOL __declspec ( naked  )
void* _ReturnAddress ( void  )
BOOL CalculateBeginningOfCallInstruction ( UINT_PTR &  dwRetAddr)
UINT combine1_4 ( UINT  uiLeft,
UINT  uiRight 
)
UINT combine2_3 ( UINT  uiLeft,
UINT  uiRight 
)
UINT combine3_2 ( UINT  uiLeft,
UINT  uiRight 
)
UINT combine4_1 ( UINT  uiLeft,
UINT  uiRight 
)
UINT combineLast3 ( UINT  uiVal)
BOOL CreateMiniDumpFromSnap ( HANDLE  hProcess,
DWORD  dwProcId,
DWORD  dwThreadId,
MINIDUMPWRITEDUMP  pMDWD,
HANDLE  hFile,
PCONTEXT  pCtx 
)
if ( hThread  )
if ( bRetVal  )
SNAPEPILOG ( bRetVal  )
SNAPPROLOG ( stInitialCtx  )
ZeroMemory& stFinalCtx ( CONTEXT  )
UINT TCHARtoUINT ( TCHAR  chVal)
TCHAR UINTtoTCHAR ( UINT  uiVal)

Variable Documentation

bRetVal = FALSE
stFinalCtx ContextFlags
Initial value:
= CONTEXT_FULL
|CONTEXT_CONTROL
|CONTEXT_DEBUG_REGISTERS
|CONTEXT_EXTENDED_REGISTERS
|CONTEXT_FLOATING_POINT
BOOL DWORD dwProcId
BOOL DWORD DWORD dwThreadId
hThread = OpenThread(THREAD_GET_CONTEXT|THREAD_QUERY_INFORMATION, FALSE, dwThreadId)
BOOL DWORD DWORD MINIDUMPWRITEDUMP pMDWD
CONTEXT stFinalCtx
CONTEXT stInitialCtx