Skip to content

Commit d82e9be

Browse files
author
Mohab Hassan
committed
Wine support
Call HTTPServer & Client shutdowns early pass PID to CrashReporter
1 parent c8ba546 commit d82e9be

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dgamexwrapper/src/dgamex86.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,14 @@ void shutdownScriptHooks()
563563
{
564564
SV_Commands_Shutdown();
565565

566+
HTTPServer::Shutdown();
567+
HTTPClient::Shutdown();
568+
566569
EntityNF::Shutdown();
567570
PlayerNF::Shutdown();
568571
ScriptThread::Shutdown();
569572
ScriptedEvent::Shutdown();
570573

571-
HTTPServer::Shutdown();
572-
HTTPClient::Shutdown();
573574

574575
LONG ret = DetourTransactionBegin();
575576
ret = DetourUpdateThread(GetCurrentThread());
@@ -614,6 +615,7 @@ void startCrashReporter()
614615
CustomCvar sv_crashrpt_poll_delay("sv_crashrpt_poll_delay", "5", CVAR_ARCHIVE);//in seconds
615616
CustomCvar sv_crashrpt_hang_wait("sv_crashrpt_hang_wait", "30", CVAR_ARCHIVE);//in seconds
616617

618+
/*
617619
HANDLE hLocalProc = GetCurrentProcess();
618620
HANDLE hGlobalProc;
619621
@@ -628,7 +630,8 @@ void startCrashReporter()
628630
gi->Printf("Start crash reporter error 1: %u\n", GetLastError());
629631
return;
630632
}
631-
633+
*/
634+
DWORD PID = GetCurrentProcessId();
632635
STARTUPINFOW si;
633636
PROCESS_INFORMATION pi;
634637

@@ -639,7 +642,7 @@ void startCrashReporter()
639642
auto crashRptPath = mainPath / "CrashReporter.exe";
640643
WCHAR cmdline[2048];
641644
DWORD pollDelay = sv_crashrpt_poll_delay.GetIntValue() * 1000, hungDelay = sv_crashrpt_hang_wait.GetIntValue() * 1000;
642-
wsprintfW(cmdline, L"%s %p %u %u", crashRptPath.c_str(), hGlobalProc, pollDelay, hungDelay);
645+
wsprintfW(cmdline, L"%s %p %u %u", crashRptPath.c_str(), PID, pollDelay, hungDelay);
643646
if (!CreateProcessW(NULL, // No module name (use command line)
644647
cmdline, // Command line
645648
NULL, // Process handle not inheritable

0 commit comments

Comments
 (0)