crashrpt
CrashRptProbe.h
Go to the documentation of this file.
1 /*************************************************************************************
2 This file is a part of CrashRpt library.
3 Copyright (c) 2003-2013 The CrashRpt project authors. All Rights Reserved.
4 
5 Use of this source code is governed by a BSD-style license
6 that can be found in the License.txt file in the root of the source
7 tree. All contributing project authors may
8 be found in the Authors.txt file in the root of the source tree.
9 ***************************************************************************************/
10 
17 #ifndef __CRASHRPT_PROBE_H__
18 #define __CRASHRPT_PROBE_H__
19 
20 #ifdef __cplusplus
21 #define CRASHRPTPROBE_EXTERNC extern "C"
22 #else
23 #define CRASHRPTPROBE_EXTERNC
24 #endif
25 
26 // Define SAL macros to be empty if some old Visual Studio used
27 #ifndef __reserved
28 #define __reserved
29 #endif
30 #ifndef __in
31 #define __in
32 #endif
33 #ifndef __in_opt
34 #define __in_opt
35 #endif
36 #ifndef __out
37 #define __out
38 #endif
39 #ifndef __out_ecount
40 #define __out_ecount(x)
41 #endif
42 #ifndef __out_ecount_z
43 #define __out_ecount_z(x)
44 #endif
45 
46 #define CRASHRPTPROBE_API(rettype) CRASHRPTPROBE_EXTERNC rettype WINAPI
47 
49 typedef int CrpHandle;
50 
116 CRASHRPTPROBE_API(int)
118  __in LPCWSTR pszFileName,
119  __in_opt LPCWSTR pszMd5Hash,
120  __in_opt LPCWSTR pszSymSearchPath,
121  __reserved DWORD dwFlags,
122  __out CrpHandle* phReport
123  );
124 
130 CRASHRPTPROBE_API(int)
132  __in LPCSTR pszFileName,
133  __in_opt LPCSTR pszMd5Hash,
134  __in_opt LPCSTR pszSymSearchPath,
135  __reserved DWORD dwFlags,
136  __out CrpHandle* phReport
137  );
138 
143 #ifdef UNICODE
144 #define crpOpenErrorReport crpOpenErrorReportW
145 #else
146 #define crpOpenErrorReport crpOpenErrorReportA
147 #endif //UNICODE
148 
165 CRASHRPTPROBE_API(int)
167  CrpHandle hReport
168  );
169 
170 /* Table names passed to crpGetProperty() function. */
171 
172 #define CRP_TBL_XMLDESC_MISC _T("XmlDescMisc")
173 #define CRP_TBL_XMLDESC_FILE_ITEMS _T("XmlDescFileItems")
174 #define CRP_TBL_XMLDESC_CUSTOM_PROPS _T("XmlDescCustomProps")
175 #define CRP_TBL_MDMP_MISC _T("MdmpMisc")
176 #define CRP_TBL_MDMP_MODULES _T("MdmpModules")
177 #define CRP_TBL_MDMP_THREADS _T("MdmpThreads")
178 #define CRP_TBL_MDMP_LOAD_LOG _T("MdmpLoadLog")
179 
180 /* Meta information */
181 
182 #define CRP_META_ROW_COUNT _T("RowCount")
183 
184 /* Column names passed to crpGetProperty() function. */
185 
186 // Columns IDs of the CRP_XMLDESC_MISC table
187 #define CRP_COL_CRASHRPT_VERSION _T("CrashRptVersion")
188 #define CRP_COL_CRASH_GUID _T("CrashGUID")
189 #define CRP_COL_APP_NAME _T("AppName")
190 #define CRP_COL_APP_VERSION _T("AppVersion")
191 #define CRP_COL_IMAGE_NAME _T("ImageName")
192 #define CRP_COL_OPERATING_SYSTEM _T("OperatingSystem")
193 #define CRP_COL_SYSTEM_TIME_UTC _T("SystemTimeUTC")
194 #define CRP_COL_EXCEPTION_TYPE _T("ExceptionType")
195 #define CRP_COL_EXCEPTION_CODE _T("ExceptionCode")
196 #define CRP_COL_INVPARAM_FUNCTION _T("InvParamFunction")
197 #define CRP_COL_INVPARAM_EXPRESSION _T("InvParamExpression")
198 #define CRP_COL_INVPARAM_FILE _T("InvParamFile")
199 #define CRP_COL_INVPARAM_LINE _T("InvParamLine")
200 #define CRP_COL_FPE_SUBCODE _T("FPESubcode")
201 #define CRP_COL_USER_EMAIL _T("UserEmail")
202 #define CRP_COL_PROBLEM_DESCRIPTION _T("ProblemDescription")
203 #define CRP_COL_MEMORY_USAGE_KBYTES _T("MemoryUsageKbytes")
204 #define CRP_COL_GUI_RESOURCE_COUNT _T("GUIResourceCount")
205 #define CRP_COL_OPEN_HANDLE_COUNT _T("OpenHandleCount")
206 #define CRP_COL_OS_IS_64BIT _T("OSIs64Bit")
207 #define CRP_COL_GEO_LOCATION _T("GeoLocation")
208 
209 // Column IDs of the CRP_XMLDESC_FILE_ITEMS table
210 #define CRP_COL_FILE_ITEM_NAME _T("FileItemName")
211 #define CRP_COL_FILE_ITEM_DESCRIPTION _T("FileItemDescription")
212 
213 // Column IDs of the CRP_XMLDESC_CUSTOM_PROPS table
214 #define CRP_COL_PROPERTY_NAME _T("PropertyName")
215 #define CRP_COL_PROPERTY_VALUE _T("PropertyValue")
216 
217 // Column IDs of the CRP_MDMP_MISC table
218 #define CRP_COL_CPU_ARCHITECTURE _T("CPUArchitecture")
219 #define CRP_COL_CPU_COUNT _T("CPUCount")
220 #define CRP_COL_PRODUCT_TYPE _T("ProductType")
221 #define CRP_COL_OS_VER_MAJOR _T("OSVerMajor")
222 #define CRP_COL_OS_VER_MINOR _T("OSVerMinor")
223 #define CRP_COL_OS_VER_BUILD _T("OSVerBuild")
224 #define CRP_COL_OS_VER_CSD _T("OSVerCSD")
225 #define CRP_COL_EXCPTRS_EXCEPTION_CODE _T("ExptrsExceptionCode")
226 #define CRP_COL_EXCEPTION_ADDRESS _T("ExceptionAddress")
227 #define CRP_COL_EXCEPTION_THREAD_ROWID _T("ExceptionThreadROWID")
228 #define CRP_COL_EXCEPTION_THREAD_STACK_MD5 _T("ExceptionThreadStackMD5")
229 #define CRP_COL_EXCEPTION_MODULE_ROWID _T("ExceptionModuleROWID")
230 
231 // Column IDs of the CRP_MDMP_MODULES table
232 #define CRP_COL_MODULE_NAME _T("ModuleName")
233 #define CRP_COL_MODULE_IMAGE_NAME _T("ModuleImageName")
234 #define CRP_COL_MODULE_BASE_ADDRESS _T("ModuleBaseAddress")
235 #define CRP_COL_MODULE_SIZE _T("ModuleSize")
236 #define CRP_COL_MODULE_LOADED_PDB_NAME _T("LoadedPDBName")
237 #define CRP_COL_MODULE_LOADED_IMAGE_NAME _T("LoadedImageName")
238 #define CRP_COL_MODULE_SYM_LOAD_STATUS _T("ModuleSymLoadStatus")
239 
240 // Column IDs of the CRP_MDMP_THREADS table
241 #define CRP_COL_THREAD_ID _T("ThdeadID")
242 #define CRP_COL_THREAD_STACK_TABLEID _T("ThreadStackTABLEID")
243 
244 // Column IDs of a stack trace table
245 #define CRP_COL_STACK_MODULE_ROWID _T("StackModuleROWID")
246 #define CRP_COL_STACK_SYMBOL_NAME _T("StackSymbolName")
247 #define CRP_COL_STACK_OFFSET_IN_SYMBOL _T("StackOffsetInSymbol")
248 #define CRP_COL_STACK_SOURCE_FILE _T("StackSourceFile")
249 #define CRP_COL_STACK_SOURCE_LINE _T("StackSourceLine")
250 #define CRP_COL_STACK_ADDR_PC_OFFSET _T("StackAddrPCOffset")
251 
252 // Column IDs of the CRP_MDMP_LOAD_LOG table
253 #define CRP_COL_LOAD_LOG_ENTRY _T("LoadLogEntry")
254 
255 
312 CRASHRPTPROBE_API(int)
314  CrpHandle hReport,
315  LPCWSTR lpszTableId,
316  LPCWSTR lpszColumnId,
317  INT nRowIndex,
318  __out_ecount_z(pcchBuffSize) LPWSTR lpszBuffer,
319  ULONG cchBuffSize,
320  __out PULONG pcchCount
321  );
322 
328 CRASHRPTPROBE_API(int)
330  CrpHandle hReport,
331  LPCSTR lpszTableId,
332  LPCSTR lpszColumnId,
333  INT nRowIndex,
334  __out_ecount_z(pcchBuffSize) LPSTR lpszBuffer,
335  ULONG cchBuffSize,
336  __out PULONG pcchCount
337  );
338 
343 #ifdef UNICODE
344 #define crpGetProperty crpGetPropertyW
345 #else
346 #define crpGetProperty crpGetPropertyA
347 #endif //UNICODE
348 
380 CRASHRPTPROBE_API(int)
382  CrpHandle hReport,
383  LPCWSTR lpszFileName,
384  LPCWSTR lpszFileSaveAs,
385  BOOL bOverwriteExisting
386  );
387 
392 CRASHRPTPROBE_API(int)
394  CrpHandle hReport,
395  LPCSTR lpszFileName,
396  LPCSTR lpszFileSaveAs,
397  BOOL bOverwriteExisting
398  );
399 
404 #ifdef UNICODE
405 #define crpExtractFile crpExtractFileW
406 #else
407 #define crpExtractFile crpExtractFileA
408 #endif //UNICODE
409 
443 CRASHRPTPROBE_API(int)
445  __out_ecount(cchBuffSize) LPWSTR pszBuffer,
446  __in UINT cchBuffSize);
447 
453 CRASHRPTPROBE_API(int)
455  __out_ecount(cchBuffSize) LPSTR pszBuffer,
456  __in UINT cchBuffSize);
457 
462 #ifdef UNICODE
463 #define crpGetLastErrorMsg crpGetLastErrorMsgW
464 #else
465 #define crpGetLastErrorMsg crpGetLastErrorMsgA
466 #endif //UNICODE
467 
468 
469 #endif __CRASHRPT_PROBE_H__
470 
crpExtractFileW(CrpHandle hReport, LPCWSTR lpszFileName, LPCWSTR lpszFileSaveAs, BOOL bOverwriteExisting)
Extracts a file from the opened error report.
Definition: CrashRptProbe.cpp:1254
crpGetPropertyA(CrpHandle hReport, LPCSTR lpszTableId, LPCSTR lpszColumnId, INT nRowIndex, __out_ecount_z(pcchBuffSize) LPSTR lpszBuffer, ULONG cchBuffSize, __out PULONG pcchCount)
Retrieves a string property from crash report.
crpOpenErrorReportW(__in LPCWSTR pszFileName, __in_opt LPCWSTR pszMd5Hash, __in_opt LPCWSTR pszSymSearchPath, __reserved DWORD dwFlags, __out CrpHandle *phReport)
Opens a zipped crash report file.
crpCloseErrorReport(CrpHandle hReport)
Closes the crash report.
Definition: CrashRptProbe.cpp:451
int CrpHandle
Handle to an opened error report.
Definition: CrashRptProbe.h:49
crpGetLastErrorMsgW(__out_ecount(cchBuffSize) LPWSTR pszBuffer, __in UINT cchBuffSize)
Gets the last CrashRptProbe error message.
crpOpenErrorReportA(__in LPCSTR pszFileName, __in_opt LPCSTR pszMd5Hash, __in_opt LPCSTR pszSymSearchPath, __reserved DWORD dwFlags, __out CrpHandle *phReport)
Opens a zipped crash report file.
crpExtractFileA(CrpHandle hReport, LPCSTR lpszFileName, LPCSTR lpszFileSaveAs, BOOL bOverwriteExisting)
Extracts a file from the opened error report.
Definition: CrashRptProbe.cpp:1306
crpGetLastErrorMsgA(__out_ecount(cchBuffSize) LPSTR pszBuffer, __in UINT cchBuffSize)
Gets the last CrashRptProbe error message.
crpGetPropertyW(CrpHandle hReport, LPCWSTR lpszTableId, LPCWSTR lpszColumnId, INT nRowIndex, __out_ecount_z(pcchBuffSize) LPWSTR lpszBuffer, ULONG cchBuffSize, __out PULONG pcchCount)
Retrieves a string property from crash report.