From 78e0a1cee76faaf83acb70e23d02662c6dfd1ea9 Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Fri, 23 Sep 2022 17:53:00 +0800 Subject: [PATCH] =?UTF-8?q?websdk=E5=A2=9E=E5=8A=A0dmp=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/webservice/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sdk/webservice/main.cpp b/sdk/webservice/main.cpp index a957dace..446580cb 100644 --- a/sdk/webservice/main.cpp +++ b/sdk/webservice/main.cpp @@ -1,5 +1,6 @@ #include "base/HGDef.h" #include "base/HGInc.h" +#include "base/HGCrash.h" #include "base/HGThread.h" #include "base/HGUtility.h" #include "base/HGIni.h" @@ -12,6 +13,14 @@ #include "MsgPumpCallback.h" #include "curl/curl.h" +static void CrashFunc(HGPointer crashAddr, HGPointer param) +{ + HGChar logPath[256]; + HGBase_GetLogFilePath(logPath, 256); + strcat(logPath, "crash.dmp"); + HGBase_MakeCrashFile(logPath); +} + static void ThreadFunc(HGThread thread, HGPointer param) { (void)thread; @@ -63,6 +72,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE iPrevInstance, LPWSTR lpCmdLi int main() #endif { + HGBase_RegisterCrashFunc(CrashFunc, NULL); + #if defined(HG_CMP_MSC) WSADATA ws = { 0 }; int ret = WSAStartup(MAKEWORD(2, 2), &ws);