GME  13
Defines | Functions
Obsolete Functions

Defines

#define Install   InstallA
 Character set-independent mapping of InstallW() and InstallA() functions.
#define AddFile   AddFileA
 Character set-independent mapping of AddFileW() and AddFileA() functions.
#define crAddFile   crAddFileA
 Character set-independent mapping of crAddFileW() and crAddFileA() functions.

Functions

LPVOID WINAPI InstallW (LPGETLOGFILE pfnCallback, LPCWSTR pszEmailTo, LPCWSTR pszEmailSubject)
 Installs exception handlers for the current process.
LPVOID WINAPI InstallA (LPGETLOGFILE pfnCallback, LPCSTR pszEmailTo, LPCSTR pszEmailSubject)
void WINAPI Uninstall (LPVOID lpState)
 Uninstalls the exception filters set up by Install().
void WINAPI AddFileW (LPVOID lpState, LPCWSTR pszFile, LPCWSTR pszDesc)
 Adds a file to the crash report.
void WINAPI AddFileA (LPVOID lpState, LPCSTR pszFile, LPCSTR pszDesc)
void WINAPI GenerateErrorReport (LPVOID lpState, PEXCEPTION_POINTERS pExInfo)
 Generates the crash report.
int WINAPI crInstallToCurrentThread ()
 Installs exception handlers to the current thread.
int WINAPI crAddFileW (LPCWSTR pszFile, LPCWSTR pszDesc)
 Adds a file to crash report.
int WINAPI crAddFileA (LPCSTR pszFile, LPCSTR pszDesc)
int WINAPI crExceptionFilter (unsigned int code, struct _EXCEPTION_POINTERS *ep)
 Can be used as a SEH exception filter.

Define Documentation

#define AddFile   AddFileA

Character set-independent mapping of AddFileW() and AddFileA() functions.

Definition at line 254 of file CrashRpt.h.

#define crAddFile   crAddFileA

Character set-independent mapping of crAddFileW() and crAddFileA() functions.

Definition at line 864 of file CrashRpt.h.

#define Install   InstallA

Character set-independent mapping of InstallW() and InstallA() functions.

Definition at line 175 of file CrashRpt.h.


Function Documentation

void WINAPI AddFileA ( LPVOID  lpState,
LPCSTR  pszFile,
LPCSTR  pszDesc 
)

Adds a file to the crash report.

Parameters:
[in]lpStateState information returned from Install(), ignored and should be NULL.
[in]pszFileFully qualified file name.
[in]pszDescDescription of the file, used by the Error Report Details dialog.
Deprecated:
This function is deprecated. It is still supported for compatiblity with older versions of CrashRpt, however consider using crAddFile2() function instead. This function is implemented as a wrapper for crAddFile2().
Remarks:

This function can be called anytime after Install() to add one or more files to the generated crash report.

pszFile should be a valid absolute path of a file to add to crash report.

pszDesc is a description of a file. It can be NULL.

Function fails if pszFile doesn't exist at the moment of function call.

AddFileW() and AddFileA() are wide-character and multibyte-character versions of AddFile(). The AddFile() macro defines character set independent mapping for these functions.

void WINAPI AddFileW ( LPVOID  lpState,
LPCWSTR  pszFile,
LPCWSTR  pszDesc 
)

Adds a file to the crash report.

Parameters:
[in]lpStateState information returned from Install(), ignored and should be NULL.
[in]pszFileFully qualified file name.
[in]pszDescDescription of the file, used by the Error Report Details dialog.
Deprecated:
This function is deprecated. It is still supported for compatiblity with older versions of CrashRpt, however consider using crAddFile2() function instead. This function is implemented as a wrapper for crAddFile2().
Remarks:

This function can be called anytime after Install() to add one or more files to the generated crash report.

pszFile should be a valid absolute path of a file to add to crash report.

pszDesc is a description of a file. It can be NULL.

Function fails if pszFile doesn't exist at the moment of function call.

AddFileW() and AddFileA() are wide-character and multibyte-character versions of AddFile(). The AddFile() macro defines character set independent mapping for these functions.

int WINAPI crAddFileA ( LPCSTR  pszFile,
LPCSTR  pszDesc 
)

Adds a file to crash report.

Returns:
This function returns zero if succeeded.
Parameters:
[in]pszFileAbsolute path to the file to add.
[in]pszDescFile description (used in Error Report Details dialog).
Note:
This function is deprecated and will be removed in one of the future releases. It is recommended to use crAddFile2() function instead.

This function can be called anytime after crInstall() to add one or more files to the generated crash report.

When this function is called, the file is marked to be added to the error report, then the function returns control to the caller. When crash occurs, all marked files are added to the report by the CrashSender.exe process. If a file is locked by someone for exclusive access, the file won't be included. Inside of LPGETLOGFILE crash callback, ensure files to be included are acessible for reading.

pszFile should be a valid absolute path of a file to add to crash report.

pszDesc is a description of a file. It can be NULL.

This function fails if pszFile doesn't exist at the moment of function call.

The crAddFileW() and crAddFileA() are wide-character and multibyte-character versions of crAddFile() function. The crAddFile() macro defines character set independent mapping.

See also:
crAddFileW(), crAddFileA(), crAddFile()
int WINAPI crAddFileW ( LPCWSTR  pszFile,
LPCWSTR  pszDesc 
)

Adds a file to crash report.

Returns:
This function returns zero if succeeded.
Parameters:
[in]pszFileAbsolute path to the file to add.
[in]pszDescFile description (used in Error Report Details dialog).
Note:
This function is deprecated and will be removed in one of the future releases. It is recommended to use crAddFile2() function instead.

This function can be called anytime after crInstall() to add one or more files to the generated crash report.

When this function is called, the file is marked to be added to the error report, then the function returns control to the caller. When crash occurs, all marked files are added to the report by the CrashSender.exe process. If a file is locked by someone for exclusive access, the file won't be included. Inside of LPGETLOGFILE crash callback, ensure files to be included are acessible for reading.

pszFile should be a valid absolute path of a file to add to crash report.

pszDesc is a description of a file. It can be NULL.

This function fails if pszFile doesn't exist at the moment of function call.

The crAddFileW() and crAddFileA() are wide-character and multibyte-character versions of crAddFile() function. The crAddFile() macro defines character set independent mapping.

See also:
crAddFileW(), crAddFileA(), crAddFile()
int WINAPI crExceptionFilter ( unsigned int  code,
struct _EXCEPTION_POINTERS *  ep 
)

Can be used as a SEH exception filter.

Returns:
This function returns EXCEPTION_EXECUTE_HANDLER if succeeds, else EXCEPTION_CONTINUE_SEARCH.
Parameters:
[in]codeException code.
[in]epException pointers.
Remarks:

As of v.1.2.8, this function is declared deprecated. It may be removed in one of the future releases.

This function can be called instead of a SEH exception filter inside of __try{}__except(Expression){} statement. The function generates a error report and returns control to the exception handler block.

The exception code is usually retrieved with GetExceptionCode() intrinsic function and the exception pointers are retrieved with GetExceptionInformation() intrinsic function.

If an error occurs, this function returns EXCEPTION_CONTINUE_SEARCH. Use crGetLastErrorMsg() to retrieve the error message on fail.

The following example shows how to use crExceptionFilter().

     int* p = NULL;   // pointer to NULL
     __try
     {
        *p = 13; // causes an access violation exception;
     }
     __except(crExceptionFilter(GetExceptionCode(), GetExceptionInformation()))
     {   
       // Terminate program
       ExitProcess(1);
     }

Installs exception handlers to the current thread.

Returns:
This function returns zero if succeeded.
Remarks:

This function sets exception handlers for the caller thread. If you have several execution threads, you ought to call the function for each thread, except the main one.

The list of C++ exception/error handlers installed with this function:

  • terminate handler [ set_terminate() ]
  • unexpected handler [ set_unexpected() ]
  • floating point error handler [ signal(SIGFPE) ]
  • illegal instruction handler [ signal(SIGILL) ]
  • illegal storage access handler [ signal(SIGSEGV) ]

The crInstall() function automatically installs C++ exception handlers for the main thread, so no need to call crInstallToCurrentThread() for the main thread.

This function fails if calling it twice for the same thread. When this function fails, use crGetLastErrorMsg() to retrieve the error message.

Call crUninstallFromCurrentThread() to uninstall C++ exception handlers from current thread.

This function is deprecatd. The crInstallToCurrentThread2() function gives better control of what exception handlers to install.

See also:
crInstallToCurrentThread2(), crUninstallFromCurrentThread(), CrThreadAutoInstallHelper
void WINAPI GenerateErrorReport ( LPVOID  lpState,
PEXCEPTION_POINTERS  pExInfo 
)

Generates the crash report.

Parameters:
[in]lpStateState information returned from Install(), ignored and should be NULL.
[in]pExInfoPointer to an EXCEPTION_POINTERS structure, can be NULL.
Deprecated:
This function is deprecated. It is still supported for compatiblity with older versions of CrashRpt, however consider using crGenerateErrorReport() function instead. This function is implemented as a wrapper for crGenerateErrorReport().
Remarks:

Call this function to manually generate a crash report.

The crash report contains the crash minidump, crash description in XML format and (optionally) additional files.

pExInfo defines the exception pointers for generating crash minidump file. If pExInfo is NULL, current CPU state is used to create exception pointers.

This function generates the error report and returns control to the caller. It doesn't terminate the caller process.

LPVOID WINAPI InstallA ( LPGETLOGFILE  pfnCallback,
LPCSTR  pszEmailTo,
LPCSTR  pszEmailSubject 
)

Installs exception handlers for the current process.

Parameters:
[in]pfnCallbackClient crash callback.
[in]pszEmailToEmail address to send crash report to.
[in]pszEmailSubjectSubject of the E-mail message.
Returns:
Always returns NULL.
Deprecated:
This function is deprecated. It is still supported for compatiblity with older versions of CrashRpt, however consider using crInstall() function instead. This function is currently implemented as a wrapper for crInstall().
Remarks:

This function installs SEH exception filter for the caller process. It also installs various C++ exception/error handlers. For the list of handlers, please see crInstall().

pfnCallback defines the callback function that is called on crash. This parameter can be NULL.

pszEmailTo should be the valid email address of recipient.

pszEmailSubject is the email subject. If this parameter is NULL, the default subject is generated.

This function assumes that CrashSender.exe is located in the same directory as CrashRpt.dll loaded by the caller process. To specify different directory, use crInstall().

On crash, the error report is sent as E-mail message using address and subject passed to the function as pszEmailTo and pszEmailSubject parameters, respectively.

InstallW() and InstallA() are wide-character and multibyte-character versions of Install(). The Install() macro defines character set independent mapping for these functions.

LPVOID WINAPI InstallW ( LPGETLOGFILE  pfnCallback,
LPCWSTR  pszEmailTo,
LPCWSTR  pszEmailSubject 
)

Installs exception handlers for the current process.

Parameters:
[in]pfnCallbackClient crash callback.
[in]pszEmailToEmail address to send crash report to.
[in]pszEmailSubjectSubject of the E-mail message.
Returns:
Always returns NULL.
Deprecated:
This function is deprecated. It is still supported for compatiblity with older versions of CrashRpt, however consider using crInstall() function instead. This function is currently implemented as a wrapper for crInstall().
Remarks:

This function installs SEH exception filter for the caller process. It also installs various C++ exception/error handlers. For the list of handlers, please see crInstall().

pfnCallback defines the callback function that is called on crash. This parameter can be NULL.

pszEmailTo should be the valid email address of recipient.

pszEmailSubject is the email subject. If this parameter is NULL, the default subject is generated.

This function assumes that CrashSender.exe is located in the same directory as CrashRpt.dll loaded by the caller process. To specify different directory, use crInstall().

On crash, the error report is sent as E-mail message using address and subject passed to the function as pszEmailTo and pszEmailSubject parameters, respectively.

InstallW() and InstallA() are wide-character and multibyte-character versions of Install(). The Install() macro defines character set independent mapping for these functions.

void WINAPI Uninstall ( LPVOID  lpState)

Uninstalls the exception filters set up by Install().

Parameters:
[in]lpStateState information returned from Install(), ignored and should be NULL.
Deprecated:
This function is deprecated. It is still supported for compatiblity with older versions of CrashRpt, however consider using crUninstall() function instead. This function is implemented as a wrapper for crUninstall().
Remarks:

Call this function on application exit to uninstall all previously installed exception handlers.