| crashrpt |
A crash reporting system for Windows applications

# CrashRpt.h File Reference

Defines the interface for the CrashRpt.DLL. More...

## Data Structures

struct | PCR_INSTALL_INFOW
| This structure defines the general information used by crInstall(). More...
struct | PCR_INSTALL_INFOA
struct | PCR_EXCEPTION_INFO
class | CrAutoInstallHelper
| Installs exception handlers in constructor and uninstalls in destructor. More...
class | CrThreadAutoInstallHelper
| Installs (uninstalls) exception handlers for the caller thread in class' constructor (destructor). More...

## Defines

#define | CRASHRPT_VER 1300
| Current CrashRpt version.
#define | CR_HTTP 0
| Send error report via HTTP (or HTTPS) connection.
#define | CR_SMTP 1
| Send error report via SMTP connection.
#define | CR_SMAPI 2
| Send error report via simple MAPI (using default mail client).
#define | CR_NEGATIVE_PRIORITY ((UINT)-1)
| Special priority constant that allows to skip certain delivery method.
#define | CR_INST_STRUCTURED_EXCEPTION_HANDLER 0x1
| Install SEH handler (deprecated name, use CR_INST_SEH_EXCEPTION_HANDLER instead).
#define | CR_INST_SEH_EXCEPTION_HANDLER 0x1
| Install SEH handler.
#define | CR_INST_TERMINATE_HANDLER 0x2
| Install terminate handler.
#define | CR_INST_UNEXPECTED_HANDLER 0x4
| Install unexpected handler.
#define | CR_INST_PURE_CALL_HANDLER 0x8
| Install pure call handler (VS .NET and later).
#define | CR_INST_NEW_OPERATOR_ERROR_HANDLER 0x10
| Install new operator error handler (VS .NET and later).
#define | CR_INST_SECURITY_ERROR_HANDLER 0x20
| Install security error handler (VS .NET and later).
#define | CR_INST_INVALID_PARAMETER_HANDLER 0x40
| Install invalid parameter handler (VS 2005 and later).
#define | CR_INST_SIGABRT_HANDLER 0x80
| Install SIGABRT signal handler.
#define | CR_INST_SIGFPE_HANDLER 0x100
| Install SIGFPE signal handler.
#define | CR_INST_SIGILL_HANDLER 0x200
| Install SIGILL signal handler.
#define | CR_INST_SIGINT_HANDLER 0x400
| Install SIGINT signal handler.
#define | CR_INST_SIGSEGV_HANDLER 0x800
| Install SIGSEGV signal handler.
#define | CR_INST_SIGTERM_HANDLER 0x1000
| Install SIGTERM signal handler.
#define | CR_INST_ALL_POSSIBLE_HANDLERS 0x1FFF
| Install all possible exception handlers.
#define | CR_INST_ALL_EXCEPTION_HANDLERS 0
| Deprecated, not recommended to use. Use CR_INST_ALL_POSSIBLE_HANDLERS instead.
#define | CR_INST_CRT_EXCEPTION_HANDLERS 0x1FFE
| Install exception handlers for the linked CRT module.
#define | CR_INST_NO_GUI 0x2000
| Do not show GUI, send report silently (use for non-GUI apps only).
#define | CR_INST_HTTP_BINARY_ENCODING 0x4000
| Use multi-part HTTP uploads with binary attachment encoding.
#define | CR_INST_DONT_SEND_REPORT 0x8000
| Don't send error report immediately, just save it locally.
#define | CR_INST_APP_RESTART 0x10000
| Restart the application on crash.
#define | CR_INST_NO_MINIDUMP 0x20000
| Do not include minidump file to crash report.
#define | CR_INST_SEND_QUEUED_REPORTS 0x40000
| CrashRpt should send error reports that are waiting to be delivered.
#define | CR_INST_STORE_ZIP_ARCHIVES 0x80000
| CrashRpt should store both uncompressed error report files and ZIP archives.
#define | crInstall crInstallA
| Character set-independent mapping of crInstallW() and crInstallA() functions.
#define | crAddFile crAddFileA
| Character set-independent mapping of crAddFileW() and crAddFileA() functions.
#define | CR_AF_TAKE_ORIGINAL_FILE 0
| Take the original file (do not copy it to the error report folder).
#define | CR_AF_MAKE_FILE_COPY 1
| Copy the file to the error report folder.
#define | CR_AF_FILE_MUST_EXIST 0
| Function will fail if file doesn't exist at the moment of function call.
#define | CR_AF_MISSING_FILE_OK 2
| Do not fail if file is missing (assume it will be created later).
#define | crAddFile2 crAddFile2A
| Character set-independent mapping of crAddFile2W() and crAddFile2A() functions.
#define | CR_AS_VIRTUAL_SCREEN 0
| Take a screenshot of the virtual screen.
#define | CR_AS_MAIN_WINDOW 1
| Take a screenshot of application's main window.
#define | CR_AS_PROCESS_WINDOWS 2
| Take a screenshot of all visible process windows.
#define | CR_AS_GRAYSCALE_IMAGE 4
| Make a grayscale image instead of a full-color one.
#define | CR_AS_USE_JPEG_FORMAT 8
| Store screenshots as JPG files.
#define | crAddProperty crAddPropertyA
| Character set-independent mapping of crAddPropertyW() and crAddPropertyA() functions.
#define | crAddRegKey crAddRegKeyA
| Character set-independent mapping of crAddRegKeyW() and crAddRegKeyA() functions.
#define | CR_WIN32_STRUCTURED_EXCEPTION 0
| SEH exception (deprecated name, use CR_SEH_EXCEPTION instead).
#define | CR_SEH_EXCEPTION 0
| SEH exception.
#define | CR_CPP_TERMINATE_CALL 1
| C++ terminate() call.
#define | CR_CPP_UNEXPECTED_CALL 2
| C++ unexpected() call.
#define | CR_CPP_PURE_CALL 3
| C++ pure virtual function call (VS .NET and later).
#define | CR_CPP_NEW_OPERATOR_ERROR 4
| C++ new operator fault (VS .NET and later).
#define | CR_CPP_SECURITY_ERROR 5
| Buffer overrun error (VS .NET only).
#define | CR_CPP_INVALID_PARAMETER 6
| Invalid parameter exception (VS 2005 and later).
#define | CR_CPP_SIGABRT 7
| C++ SIGABRT signal (abort).
#define | CR_CPP_SIGFPE 8
| C++ SIGFPE signal (flotating point exception).
#define | CR_CPP_SIGILL 9
| C++ SIGILL signal (illegal instruction).
#define | CR_CPP_SIGINT 10
| C++ SIGINT signal (CTRL+C).
#define | CR_CPP_SIGSEGV 11
| C++ SIGSEGV signal (invalid storage access).
#define | CR_CPP_SIGTERM 12
| C++ SIGTERM signal (termination request).
#define | CR_NONCONTINUABLE_EXCEPTION 32
| Non continuable sofware exception.
#define | CR_THROW 33
| Throw C++ typed exception.
#define | crGetLastErrorMsg crGetLastErrorMsgA
| Defines character set-independent mapping for crGetLastErrorMsgW() and crGetLastErrorMsgA().

## Typedefs

typedef BOOL(* | LPGETLOGFILE )(LPVOID lpvState)
| Client crash callback function prototype.
typedef CR_INSTALL_INFOA | CR_INSTALL_INFO
| Character set-independent mapping of CR_INSTALL_INFOW and CR_INSTALL_INFOA structures.

## Functions

int | crInstallW (PCR_INSTALL_INFOW pInfo)
| Installs exception handlers for the caller process.
int | crInstallA (PCR_INSTALL_INFOA pInfo)
int | crUninstall ()
| Unsinstalls exception handlers previously installed with crInstall().
int | crInstallToCurrentThread ()
| Installs exception handlers to the current thread.
int | crInstallToCurrentThread2 (DWORD dwFlags)
| Installs exception handlers to the caller thread.
int | crUninstallFromCurrentThread ()
| Uninstalls C++ exception handlers from the current thread.
int | crAddFileW (LPCWSTR pszFile, LPCWSTR pszDesc)
| Adds a file to crash report.
int | crAddFileA (LPCSTR pszFile, LPCSTR pszDesc)
int | crAddFile2W (LPCWSTR pszFile, LPCWSTR pszDestFile, LPCWSTR pszDesc, DWORD dwFlags)
| Adds a file to crash report.
int | crAddFile2A (LPCSTR pszFile, LPCSTR pszDestFile, LPCSTR pszDesc, DWORD dwFlags)
int | crAddScreenshot (DWORD dwFlags)
| Adds a screenshot to the crash report.
int | crAddScreenshot2 (DWORD dwFlags, int nJpegQuality)
| Adds a screenshot to the crash report.
int | crAddPropertyW (LPCWSTR pszPropName, LPCWSTR pszPropValue)
| Adds a string property to the crash report.
int | crAddPropertyA (LPCSTR pszPropName, LPCSTR pszPropValue)
int | crAddRegKeyW (LPCWSTR pszRegKey, LPCWSTR pszDstFileName, DWORD dwFlags)
| Adds a registry key dump to the crash report.
int | crAddRegKeyA (LPCSTR pszRegKey, LPCSTR pszDstFileName, DWORD dwFlags)
int | crGenerateErrorReport (CR_EXCEPTION_INFO *pExceptionInfo)
| Manually generates an errror report.
int | crExceptionFilter (unsigned int code, struct _EXCEPTION_POINTERS *ep)
| Can be used as a SEH exception filter.
int | crEmulateCrash (unsigned ExceptionType) throw (...)
| Emulates a predefined crash situation.
int | crGetLastErrorMsgW (LPWSTR pszBuffer, UINT uBuffSize)
| Gets the last CrashRpt error message.
int | crGetLastErrorMsgA (LPSTR pszBuffer, UINT uBuffSize)

## Detailed Description

Defines the interface for the CrashRpt.DLL.

Date:
  2003-2011

Author:
  Michael Carruth

  zeXspectrum