GME
13
|
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. |
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.
Character set-independent mapping of InstallW() and InstallA() functions.
Definition at line 175 of file CrashRpt.h.
void WINAPI AddFileA | ( | LPVOID | lpState, |
LPCSTR | pszFile, | ||
LPCSTR | pszDesc | ||
) |
Adds a file to the crash report.
[in] | lpState | State information returned from Install(), ignored and should be NULL. |
[in] | pszFile | Fully qualified file name. |
[in] | pszDesc | Description of the file, used by the Error Report Details dialog. |
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.
[in] | lpState | State information returned from Install(), ignored and should be NULL. |
[in] | pszFile | Fully qualified file name. |
[in] | pszDesc | Description of the file, used by the Error Report Details dialog. |
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.
[in] | pszFile | Absolute path to the file to add. |
[in] | pszDesc | File description (used in Error Report Details dialog). |
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.
int WINAPI crAddFileW | ( | LPCWSTR | pszFile, |
LPCWSTR | pszDesc | ||
) |
Adds a file to crash report.
[in] | pszFile | Absolute path to the file to add. |
[in] | pszDesc | File description (used in Error Report Details dialog). |
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.
int WINAPI crExceptionFilter | ( | unsigned int | code, |
struct _EXCEPTION_POINTERS * | ep | ||
) |
Can be used as a SEH exception filter.
EXCEPTION_EXECUTE_HANDLER
if succeeds, else EXCEPTION_CONTINUE_SEARCH
.[in] | code | Exception code. |
[in] | ep | Exception pointers. |
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); }
int WINAPI crInstallToCurrentThread | ( | ) |
Installs exception handlers to the current thread.
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:
set_terminate()
]set_unexpected()
]signal(SIGFPE)
]signal(SIGILL)
]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.
void WINAPI GenerateErrorReport | ( | LPVOID | lpState, |
PEXCEPTION_POINTERS | pExInfo | ||
) |
Generates the crash report.
[in] | lpState | State information returned from Install(), ignored and should be NULL. |
[in] | pExInfo | Pointer to an EXCEPTION_POINTERS structure, can be NULL. |
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.
[in] | pfnCallback | Client crash callback. |
[in] | pszEmailTo | Email address to send crash report to. |
[in] | pszEmailSubject | Subject of the E-mail message. |
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.
[in] | pfnCallback | Client crash callback. |
[in] | pszEmailTo | Email address to send crash report to. |
[in] | pszEmailSubject | Subject of the E-mail message. |
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().
[in] | lpState | State information returned from Install(), ignored and should be NULL. |
Call this function on application exit to uninstall all previously installed exception handlers.