Skip to main content

Windows Platform Integration Guidelines

This article is a detailed document introducing the use of the PC SDK, containing a basic integration process and an advanced introduction to the use of the interface. This document applies to version 2.2.1 and above, if you are using a lower version, it is recommended to upgrade as soon as possible. See View dll version number for the method to view the version.

If you want to quickly integrate and verify the platform and SDK functionality, it is recommended to check the "Tutorial" in the project menu. The initialization code for this project has been generated by project specific information (platform, engine, local(China)/international, AppID) in the guide, which can be copied and used directly. The following figure shows:

Project creation: External projects support self-service project creation, but there is a free trial period. For internal projects, contact "CrashSight Assistant" on corporate WeChat to open them.

1 Instructions for use

When integrating to CrashSight SDK PC version, the game client needs to load the exception catching dll by itself and pass in the user id and game version parameters. The following table lists the web addresses and reporting addresses of local(China) and international services. Users can choose qq login or enterprise WeChat login:

Server TypeWebsite URLUpload URL(used in config file)
Local Serverhttps://crashsight.qq.compc.crashsight.qq.com
International Serverhttps://crashsight.wetest.netpc.crashsight.wetest.net

PS: The international version and the local version are exactly the same, you only need to modify the different reporting address to report to the specified region (note that the corresponding appid and key also need to do the corresponding changes, otherwise the server will reject)

2 CrashSight component download

The new version of CrashSight mainly provides 64-bit version, compared with 32-bit version and 64-bit version, except for different file names, the functions and usage are the same.

After successfully creating a project in the platform, you can download the corresponding SDK from the "Tutorial" in the sidebar, as shown in the figure below:

3 CrashSight integration

As this SDK adopts the way of loading dll directly from the client, the specific integration is as follows:

  1. Login to the web side and register the project, select PC as the project type, the appid (e.g. 0620edc732) and app-key (e.g. 3edb3c5f-eca4-4033-ba60-5993452dff397, the key needs to be kept secret) will be generated after successful registration

  2. Put the provided files to the specified location according to the instructions, the client will load the CrashSight64.dll in the same level directory after startup

  3. C++ through HINSTANCE dllDemo = LoadLibraryA("CrashSight64.dll"); load the dll, other languages use the language corresponding to the dll loading method can be.

  4. Declare the export function (6. Reference code) typedef void(*CS_InitContext)(const char* id, const char* version, const char* key). and call this function to pass the user account to TQM with the following parameter descriptions:

parameterstypedescription
userIdconst char*The user's id can be qq or railid,recommended to use const char
versionconst char*The current version of the game, e.g. "3.1.0.13"
keyconst char*The string generated when registering the project, used for encryption, such as: "3edb3c5f-eca4-4033-ba60-59947eb3f397"
  1. Configure CrashSightConfig64.dat

    After the project is packaged, create CrashSightConfig64.dat file in the same level directory as CrashSight64.dll.

    Please copy the contents of the CrashSightConfig64.dat file provided in the Tutorial Page to the file you created.

  2. When the client configuration is finished, start the game normally and find that there is CrashSight64.dll in the game process, which means that CrashSight is loaded and started successfully.

4 CrashSight reporting data fields

After the game client loads the dll and calls the export function:

  1. The dll will read the domain name in the configuration file to report networking data.
  2. It is used to report the minidmp generated by the dll to the server when the dll catches a crash exception.

The current data fields reported by CrashSight are as follows:

FieldDescription
userIduser id
appIdproject's registration id
MacMac address
osNameoperating system name
displayCardDisplay card name
CpuCpu type
phyMemAllMachine memory
osBitmachine bit count
resolutionresolution
pidNameprocess name
bootTimeboot time
IpIp address

5 Interfaces

5.1 Error Reporting

// declare the export function
typedef void(*CS_ReportException)(int type, const char* name, const char* message, const char* stackTrace, const char * extras, bool is_async, const char *error_attach_path);
CS_ReportException theReportException = (CS_ReportException)GetProcAddress(dllDemo, "CS_ReportException");
// call the function
theReportException(1, "name", "message", "stack", "{\"k1\":\"v1111\",\"k2\":\"v2222\",\"k3\":\"v3333\"}", true, "/path/to/your/attach/file");

// declare the export function
typedef void(*CS_ReportExceptionW)(int type, const char* name, const char* message, const char* stackTrace, const char * extras, bool is_async, const wchar_t *error_attach_path);
CS_ReportExceptionW theReportExceptionW = (CS_ReportExceptionW)GetProcAddress(dllDemo, "CS_ReportExceptionW");
// call the function
theReportExceptionW(1, "name", "message", "stack", "{\"k1\":\"v1111\",\"k2\":\"v2222\",\"k3\":\"v3333\"}", true, L"/path/to/your/attach/file");
parameterexplanation
typeDeprecated, fill in with 1 is ok
expNameName of the problem, please limit it to 128 bytes. (In particular, if you use UE engine and transcode it by UTF8, please limit it to 96 characters if possible)
expMessageA brief description of the problem, please limit it to 128 bytes. (In particular, if you use UE engine and transcode it by UTF8, please limit it to 96 characters if possible)
stackTraceThe stack of the current error, limit to 2M only
extrasadditional information, need to pass key-value pairs in json format, such as no additional information can be filled with ""
is_asyncSynchronous/asynchronous reporting, generally fill in true (asynchronous)
error_attach_pathThe absolute path of the attachment, you can specify a 5M attachment

If you need to pass in a path with Unicode characters, please use the wide character version (CS_ReportExceptionW).

5.2 Setting callbacks

// declare the export function
typedef void(*CS_SetCrashCallback)(CrashCallbackFuncPtr callback);
CS_SetCrashCallback theSetCrashCallback = (CS_SetCrashCallback)GetProcAddress(dllDemo, "CS_SetCrashCallback");
// call the function
theSetCrashCallback(myCallback);
parameterexplanation
callbackPointer to callback function

The CrashCallbackFuncPtr callback can be any of the user's own function implementations (see Callback functions), as long as the parameters match, the declaration cycle always exists, and it will not become a null pointer.Note here that the callback function cannot be a non-static function of a class member, because the default first argument of a non-static function of a class member is 'this'

5.3 Callback function

	typedef void(*CrashCallbackFuncPtr)(int type, const char* guid);
parameterexplanation
typeType of callback, currently there are only crash callbacks, always be 1
guidUnique identifier string of length 64, each report has a separate string

Splice https://{website_domain}/crash-reporting/client-report-id/{APP_ID}/{GUID}?pid={platform_ID} to get the relevant report URL.

5.4 Custom Interface Log

// declare the export function
enum LogSeverity {
Log,
LogDebug,
LogInfo,
LogWarning,
LogAssert,
LogError,
LogException
};
typedef void(*CS_PrintLog)(LogSeverity level, const char* tag, const char *format, ...);
CS_PrintLog thePrintLog = (CS_PrintLog)GetProcAddress(dllDemo, "CS_PrintLog");
// call the function
thePrintLog(LogSeverity.LogError, "MyTag", "%s", "myMessage");
parameterexplanation
levelLog level
tagLog tag
formatLog format
argsVariable parameters

This function can be called to write a log to the SDK during the program runtime, and this log will be reported together with the error report and crash report. The log content is a 1M circular queue.

5.5 Custom KV

// declare the export function
typedef void(*CS_SetUserValue)(const char* key, const char* value);
CS_SetUserValue theSetUserValue = (CS_SetUserValue)GetProcAddress(dllDemo, "CS_SetUserValue");
// call the function
theSetUserValue("key", "value");
parameterexplanation
keycustom key
valuecustom value

This function can be called to write custom KV to SDK during program operation to save some key properties, which will be reported together with the error report and crash report. It is recommended that the KV be set according to the specification in the custom data format document.

5.6 Turn on VEH exceptions

// declare the export function
typedef void (*CS_SetVehEnable)(bool enable);
CS_SetVehEnable theSetVehEnable = (CS_SetVehEnable)GetProcAddress(dllDemo, "CS_SetVehEnable");
// call the function
theSetVehEnable(true);

Set VEH exception handling state, default is off. When turned off, only unhandled exceptions are reported. This scheme optimizes the catching of some exceptions, e.g. when turned off, crashes caused by THROW are reported (when turned on, they are not), bad memory accesses that have been handled are not reported by mistake, etc. Note that since UE catches all exceptions at the engine level via __try __except (macro PLATFORM_SEH_EXCEPTIONS_DISABLED related area), there are no 'unhandled exceptions'. Therefore, turn on this option until this catch is turned off by modifying the engine code, as this will result in a large number of exceptions not being reported.

5.7 Enabling additional exception catching

// declare the export function
typedef void (*CS_SetExtraHandler)(bool extra_handle_enable);
CS_SetExtraHandler theSetExtraHandler = (CS_SetExtraHandler)GetProcAddress(dllDemo, "CS_SetExtraHandler");
// call the function
theSetExtraHandler(true);

Set additional exception handling mechanism, default is off. When turned on, it can catch crashes caused by illegal arguments thrown by safety functions like strcpy_s and, crashes caused by false function call purecall errors.

5.8 Custom file data

Crashes/errors carry the contents of a file in the specified directory, usually the file contents are logs, so this feature is also called custom file logging. Unlike the interface log, the file log reads the specified file and does not restrict the content of the written file or the method. This feature does not need to be actively enabled, as long as in the corresponding reporting trigger is, the specified directory has files will be reported.

Specifically:

On crash, the file specified by the CS_SetCustomLogDir interface is reported.

On error, the file specified by the CS_ReportException interface is reported.

5.9 Proactive reporting of crashes

This function can be called in some cases where active dump reporting is expected. It is mainly used to report UE Fatal errors.

// declare the export function
typedef void (*CS_ReportCrash)();
CS_ReportCrash theReportCrash = (CS_ReportCrash)GetProcAddress(dllDemo, "CS_ReportCrash");
// call the function
theReportCrash();

5.10 Specify the log directory

// declare the export function
typedef int (*CS_SetCustomLogDir)(const char* log_path);
CS_SetCustomLogDir theSetCustomLogDir = (CS_SetCustomLogDir)GetProcAddress(dllDemo, "CS_SetCustomLogDir");
// call the function
theSetCustomLogDir("/path/to/your/attach/file");

// declare the export function
typedef int (*CS_SetCustomLogDirW)(const wchar_t* log_path);
CS_SetCustomLogDirW theSetCustomLogDirW = (CS_SetCustomLogDirW)GetProcAddress(dllDemo, "CS_SetCustomLogDirW");
// call the function
theSetCustomLogDirW(L"/path/to/your/attach/file");
parameterexplanation
log_pathabsolute path to the log file

When you need to pass in a path with Unicode characters, use the wide character version (CS_SetCustomLogDirW)
When you need to upload multiple logs, please use "|" to separate the paths, and pass in the absolute paths of up to 3 files at a time, directories are not supported. The maximum support for a single file is 20MB, the file size over 20MB will intercept the last 20MB; the maximum support for compressed package is 10MB, the files will be put into the compressed package in order, if the compressed package size would be more than 10MB when a file is put in, the file will be skipped.

5.11 Add error code

The error code of the specified RaiseException will be considered as a crash and reported (generally, it is not recommended to modify, please make specific inquiries before modifying)

// declare the export function
typedef int (*CS_AddValidExpCode)(const char* log_path);
CS_AddValidExpCode theAddValidExpCode = (CS_AddValidExpCode)GetProcAddress(dllDemo, "CS_AddValidExpCode");
// call the function
theAddValidExpCode(0xC0000005L);
parameterexplanation
exp_codeexception code

5.12 Proactive reporting of dump

This function can be called in some cases where active dump reporting is expected.

// declare the export function
typedef int (*CS_ReportDump)(const char* log_path);
CS_ReportDump theReportDump = (CS_ReportDump)GetProcAddress(dllDemo, "CS_ReportDump");
// call the function
theReportDump("/path/to/your/dump/file");
parameterexplanation
dump_pathabsolute path to the dump file

5.13 Set User Id

After initialization, you can use this interface to modify user ID

// declare the export function
typedef int (*CS_SetUserId)(const char* log_path);
CS_SetUserId theSetUserId = (CS_SetUserId)GetProcAddress(dllDemo, "CS_SetUserId");
// call the function
theSetUserId("userid");
parameterexplanation
user_iduser ID

5.14 Report the dump file under the specified path

// declare the export function
typedef int (*CS_UploadGivenPathDump)(const char* log_path);
CS_UploadGivenPathDump theUploadGivenPathDump = (CS_UploadGivenPathDump)GetProcAddress(dllDemo, "CS_UploadGivenPathDump");
// call the function
theUploadGivenPathDump("/path/to/your/dump/file");
parameterexplanation
dump_pathabsolute path to the dump file

5.15 Setting the device ID

CrashSight Windows uses the mac address as the device ID by default. This interface can modify the device ID, which is normally not required to be called.

// declare the export function
typedef void (*CS_SetDeviceId)(const char* device_id);
CS_SetDeviceId theSetDeviceId = (CS_SetDeviceId)GetProcAddress(dllDemo, "CS_SetDeviceId");
// call the function
theSetDeviceId("deviceId");
parameterexplanation
device_iddevice ID

5.16 Setting the dump mode

This interface allows to change the mode of dump on crash, which is normally not needed. See definition of dump_type in MINIDUMP_TYPE

// declare the export function
typedef void (*CS_SetDumpType)(int dump_type);
CS_SetDumpType theSetDumpType = (CS_SetDumpType)GetProcAddress(dllDemo, "CS_SetDumpType");
// call the function
theSetDumpType(1);
parameterexplanation
dump_typedump mode

5.17 Setting Environment Name

The environment name set by this interface can be filtered in the Overview page.

// declare the export function
typedef void (*CS_SetEnvironmentName)(const char *name);;
CS_SetEnvironmentName theSetEnvironmentName = (CS_SetEnvironmentName)GetProcAddress(dllDemo, "CS_SetEnvironmentName");
// call the function
theSetEnvironmentName("envName");
parameterexplanation
nameenvironment name

5.18 Reporting a crash by GUID

Report an error for the specified GUID.

// declare the export function
typedef void (*CS_UploadCrashWithGuid)(const char *guid).
CS_UploadCrashWithGuid theUploadCrashWithGuid = (CS_UploadCrashWithGuid)GetProcAddress(dllDemo, "CS_UploadCrashWithGuid");
// call the function
theSetEnvironmentheUploadCrashWithGuidtName("GUID");
parameterexplanation
guiduenque ID of a report

This interface can be used after Turning off crash auto-reporting, and get the GUID from Callback Function. Then you can manually determine if it needs to be reported, and call this interface to report it if it needs to be reported.

5.19 Getting the session ID

// declare the export function
typedef void (*CS_GetSessionId)(char *session_id);
CS_GetSessionId theGetSessionId = (CS_GetSessionId)GetProcAddress(dllDemo, "CS_GetSessionId");
// call the function
char* sessionId = new char[64];
theGetSessionId("GUID");
parameterexplanation
session_idsession ID

5.20 Turn off crash auto-reporting

You can turn off crash auto-reporting, but it won't turn off crash capture and handling, it will still generate a dump. Use it with the Reporting a crash by GUID interface.

// declare the export function
typedef void (*CS_SetCrashUploadEnable)(bool enable);
CS_SetCrashUploadEnable theSetCrashUploadEnable = (CS_SetCrashUploadEnable)GetProcAddress(dllDemo, "CS_SetCrashUploadEnable");
// call the function
theSetCrashUploadEnable(false);

5.21 Setting workspace

The default workspace is the directory where the dll is located. This interface allows you to change the workspace, which affects where dump files, record files, databases and logs are generated. The wide character version is required when passing in directories with Unicode characters (CS_SetWorkSpaceW)

// declare the export function
typedef void (*CS_SetWorkSpace)(const char *workspace).
CS_SetWorkSpace theSetWorkSpace = (CS_SetWorkSpace)GetProcAddress(dllDemo, "CS_SetWorkSpace");
// call the function
theSetWorkSpace("/path/to/your/workspace");

// declare the export function
typedef void (*CS_SetWorkSpaceW)(const wchar_t *workspace);
CS_SetWorkSpaceW theSetWorkSpaceW = (CS_SetWorkSpaceW)GetProcAddress(dllDemo, "CS_SetWorkSpaceW");
// call the function
theSetWorkSpaceW(L"/path/to/your/workspace");
parameterexplanation
workspaceabsolute path to your workspace

5.22 Setting the logging level

Sets the log level below which logs of the specified level will not be logged. This affects the Custom Interface Log

// declare the export function
typedef void (*CS_ConfigCrashReporter)(int log_level);;
CS_ConfigCrashReporter theConfigCrashReporter = (CS_ConfigCrashReporter)GetProcAddress(dllDemo, "CS_ConfigCrashReporter");
// call the function
theConfigCrashReporter(1);
parameterexplanation
log_levellog level

5.23 Testing for crashes

Generates a crash after being called.

// declare the export function
typedef void (*CS_TestNativeCrash)();
CS_TestNativeCrash theTestNativeCrash = (CS_TestNativeCrash)GetProcAddress(dllDemo, "CS_TestNativeCrash");
// call the function
theTestNativeCrash();

5.24 Setting up to only report the first crash

Sometimes multiple threads crash at the same time, causing multiple crashes to be reported on a single startup. If you don't want multiple crashes to be reported on a single launch, set this to true.

// declare the export function
typedef void (*CS_OnlyUploadFirstCrash)(bool enable);
CS_OnlyUploadFirstCrash theOnlyUploadFirstCrash = (CS_OnlyUploadFirstCrash)GetProcAddress(dllDemo, "CS_OnlyUploadFirstCrash");
// call the function
theOnlyUploadFirstCrash(true);

5.25 Setting up extra message callbacks

OnCrashExtraMessageNotify needs to be implemented before use, it will be called before each crash and error is reported, and the string it returns is reported with the crash or error, which can be found in Crash/Error Details->Attachment Download->extraMessage.txt (no need to implement OnCrashExtraDataNotify on Windows)

// declare the export function
class UQMInnerCrashRet {
public.
char* data{};
int maxDataLen{};
int* dataLen{}; int
UQMInnerCrashRet() = default;
};

class UQMCrashObserver {
public.
virtual ~UQMCrashObserver(){};

virtual long OnCrashExtraDataNotify(const UQMInnerCrashRet& crashRet) { return 0; };

virtual const char* OnCrashExtraMessageNotify(int crashType) { return nullptr; }; }
};

typedef void (*CS_SetCrashObserver)(UQMCrashObserver *crashObserver);
CS_SetCrashObserver theSetCrashObserver = (CS_SetCrashObserver)GetProcAddress(dllDemo, "CS_SetCrashObserver");
// call the function
class MyCrashObserver : public UQMCrashObserver {
const char* OnCrashExtraMessageNotify(int crashType) {
return "Your extra message!";
};
}
theSetCrashObserver(new MyCrashObserver());
parameterexplanation
crashObserverextra message callback

5.26 Specify the attachment directory

// declare the export function
typedef int (*CS_SetCustomAttachDir)(const char* attach_path);
CS_SetCustomAttachDir theSetCustomAttachDir = (CS_SetCustomAttachDir)GetProcAddress(dllDemo, "CS_SetCustomAttachDir");
// call the function
theSetCustomAttachDir("/path/to/your/attach/file");

// declare the export function
typedef int (*CS_SetCustomAttachDirW)(const wchar_t* attach_path);
CS_SetCustomAttachDirW theSetCustomAttachDirW = (CS_SetCustomAttachDirW)GetProcAddress(dllDemo, "CS_SetCustomAttachDirW");
// call the function
theSetCustomAttachDirW(L"/path/to/your/attach/file");
parameterexplanation
attach_pathabsolute path to the attachment file

When you need to pass in a path with Unicode characters, use the wide character version (CS_SetCustomAttachDirW)
When you need to upload multiple attachments, please use "|" to separate the paths, and pass in the absolute paths of up to 3 files at a time, directories are not supported. The maximum support for a single file is 20MB, the file size over 20MB will be skipped; the maximum support for compressed package is 10MB, the files will be put into the compressed package in order, if the compressed package size would be more than 10MB when a file is put in, the file will be skipped.

6 Reference Code

The C++ reference code is as follows:

typedef void(*CS_InitContext)(const char* id, const char* version, const char* key);
typedef void(*CS_ReportException)(int type, const char* name, const char* message, const char* stackTrace, const char * extras, bool is_async, const char *error_attach_path);
int main()
{
// load dll
HINSTANCE dllDemo = LoadLibraryA("CrashSight64.dll");
// Perform initialization
if (dllDemo)
{
CS_InitContext theInitContext = NULL;
theInitContext = (CS_InitContext)GetProcAddress(dllDemo, "CS_InitContext");
if (theInitContext != NULL)
{
theInitContext("userid", "version", "key");
}
}
// Report a custom error
if (dllDemo)
{
CS_ReportException theReportException = NULL;
theReportException = (CS_ReportException)GetProcAddress(dllDemo, "CS_ReportException");
if (theReportException != NULL)
{
int type = 1;
theReportException(type, "exp name", "exp message", "stack", "extras", true, "");
}
}
return 1;
}

The C# reference code is as follows:

Function Statement:
[DllImport("CrashSight64.dll")]
static extern void CS_InitContext([MarshalAs(UnmanagedType.LPUTF8Str)]string userId, [MarshalAs(UnmanagedType.LPUTF8Str)]string version, [MarshalAs(UnmanagedType.LPUTF8Str)]string key);

[DllImport("CrashSight64.dll")]
static extern void CS_ReportException (int type, [MarshalAs(UnmanagedType.LPUTF8Str)]string name, [MarshalAs(UnmanagedType.LPUTF8Str)]string message, [MarshalAs(UnmanagedType.LPUTF8Str)]string stackTrace, [MarshalAs(UnmanagedType.LPUTF8Str)]string extras, bool is_async, [MarshalAs(UnmanagedType.LPUTF8Str)]string error_attach_path);

Function calls:
CS_InitContext("userId", "version", "key");
CS_ReportException(1, "name", "message","stackTrace", "extras", true, "");

7 Functional test verification

Once integration is complete, be sure to verify that the results of the integration are as expected. This includes the following points.

    1. After initializing CrashSight, verify that the network is reporting properly, as follows:
1. Initialize CrashSight.
2. After 5 minutes, you can see the statistic value is greater than or equal to 1 in Exception Overview --> Crash Trend --> Networked Device Count on the admin page.
2. If the game crashes, whether it can be reported correctly or not, the specific verification method is as follows:
1. Initialize CrashSight. 2.
2. Crash is triggered by the code int *a = NULL; a[0] = 1; inside the game. (Other similar bad memory accesses are possible)
3. Check if a dmp file is generated under the CrashSight64/dump(TQM64/dump for older versions) path. If not, it means the crash cannot be captured successfully, please contact CrashSight development.
4. Check if the corresponding time point is reported in the crash analysis of the management side page. If 3 is there and 4 is not, it means that it is not successfully reported. Please check the APP ID configuration, whether they correspond and are the same as in the application settings. If the configuration is correct and still cannot be reported, please contact CrashSight development.
3. Whether the game error occurs and can be reported correctly (optional), the specific verification method is as follows:
1. Initialize CrashSight.
2. Trigger CS_ReportException() in the game
3. Check whether the error is reported at the corresponding time point in the error analysis on the management page. If not, it means that it is not successfully reported. Please check the APP ID configuration (both configuration files should be correct) and APP KEY configuration, whether they are corresponding and the same as in the application settings. If the configuration is correct and still cannot be reported, please contact CrashSight development.
4. whether the custom logs can be reported correctly if the game has errors; (optional)
5. the version number of the crash reported, whether the user name is the same as the setting;
6. whether the version number, user name reported by the error is consistent with the setting;

8 Testing CrashSight

After successful integration, the game will load the dll after normal startup. crashSight will upload the networking information immediately after startup, and the web side can directly view the reported networking data, which means the CrashSight networking data reporting function. If the game process crashes in some way, the dump information of the project can be viewed in the exception list under the project on the CrashSight website, which means that the exception catching function of CrashSight is normal.

The performance of the client before and after integrating CrashSight is tested, and the impact of CrashSight on the performance of the game is no more than 1%.

When loading the dll, we need to judge whether the dll is loaded successfully or not. Remove the CrashSight64.dll directly after integrating, it will not have any additional impact on the game.

9 Upload symbol table

The above describes the SDK integration, crash reporting and verification, but to see the readable symbolicated stack on the page, you also need to upload the corresponding symbol table. To upload a symbol table for Windows, you need to use a pdb and a corresponding exe or dll file, you can download and use the symbol table tool in the "Tutorial" page at the bottom left corner of the page. When uploading the symbol table, you need to include at least all the modules involved in the crash stack in the dump.

10 View dll version

In some cases, developers may need to check the version of CrashSight64.dll. The dll version can be found in Properties->Details, as shown in the picture below:

11 Appendix

1. CrashSight Support Crash List. [Microsoft crash definition].(https://docs.microsoft.com/en-us/windows/win32/debug/getexceptioncode)
#define STATUS_ACCESS_VIOLATION          ((DWORD   )0xC0000005L)
#define STATUS_IN_PAGE_ERROR ((DWORD )0xC0000006L)
#define STATUS_INVALID_HANDLE ((DWORD )0xC0000008L)
#define STATUS_INVALID_PARAMETER ((DWORD )0xC000000DL)
#define STATUS_NO_MEMORY ((DWORD )0xC0000017L)
#define STATUS_ILLEGAL_INSTRUCTION ((DWORD )0xC000001DL)
#define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD )0xC0000025L)
#define STATUS_INVALID_DISPOSITION ((DWORD )0xC0000026L)
#define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD )0xC000008CL)
#define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD )0xC000008DL)
#define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD )0xC000008EL)
#define STATUS_FLOAT_INEXACT_RESULT ((DWORD )0xC000008FL)
#define STATUS_FLOAT_INVALID_OPERATION ((DWORD )0xC0000090L)
#define STATUS_FLOAT_OVERFLOW ((DWORD )0xC0000091L)
#define STATUS_FLOAT_STACK_CHECK ((DWORD )0xC0000092L)
#define STATUS_FLOAT_UNDERFLOW ((DWORD )0xC0000093L)
#define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD )0xC0000094L)
#define STATUS_INTEGER_OVERFLOW ((DWORD )0xC0000095L)
#define STATUS_PRIVILEGED_INSTRUCTION ((DWORD )0xC0000096L)
#define STATUS_STACK_OVERFLOW ((DWORD )0xC00000FDL)
#define STATUS_DLL_NOT_FOUND ((DWORD )0xC0000135L)
#define STATUS_ORDINAL_NOT_FOUND ((DWORD )0xC0000138L)
#define STATUS_ENTRYPOINT_NOT_FOUND ((DWORD )0xC0000139L)
#define STATUS_CONTROL_C_EXIT ((DWORD )0xC000013AL)
#define STATUS_DLL_INIT_FAILED ((DWORD )0xC0000142L)
#define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD )0xC00002B4L)
#define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD )0xC00002B5L)
#define STATUS_REG_NAT_CONSUMPTION ((DWORD )0xC00002C9L)
#define STATUS_HEAP_CORRUPTION ((DWORD )0xC0000374L)
#define STATUS_STACK_BUFFER_OVERRUN ((DWORD )0xC0000409L)
#define STATUS_INVALID_CRUNTIME_PARAMETER ((DWORD )0xC0000417L)
#define STATUS_ASSERTION_FAILURE ((DWORD )0xC0000420L)
#define STATUS_ENCLAVE_VIOLATION ((DWORD )0xC00004A2L)
#if defined(STATUS_SUCCESS) || (_WIN32_WINNT > 0x0500) || (_WIN32_FUSION >= 0x0100)
#define STATUS_SXS_EARLY_DEACTIVATION ((DWORD )0xC015000FL)
#define STATUS_SXS_INVALID_DEACTIVATION ((DWORD )0xC0150010L)