Skip to content

Commit e40c967

Browse files
author
Mark Final
committed
The crash server must be a windows app with an idling loop to work properly
1 parent 8b6cab7 commit e40c967

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Test/dev/Test.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void OverrideOptions(Opus.Core.BaseOptionCollection optionCollection, Opu
1515
}
1616
}
1717

18-
class CrashServer : C.Application
18+
class CrashServer : C.WindowsApplication
1919
{
2020
public CrashServer()
2121
{
@@ -55,6 +55,11 @@ void Source_UpdateOptions(Opus.Core.IModule module, Opus.Core.Target target)
5555
typeof(Breakpad.BreakpadServerStaticLibrary),
5656
typeof(WindowsSDK.WindowsSDK)
5757
);
58+
59+
[C.RequiredLibraries]
60+
Opus.Core.StringArray libraries = new Opus.Core.StringArray(
61+
"User32.lib" // for DispatchMessage, etc.
62+
);
5863
}
5964

6065
class ConsoleTest : C.Application

Test/dev/src/crashservermain_win.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// define this to use a Windows application (linker SUBSYSTEM:Windows) rather than a Console application
1010
// note that there are some issues killing the process when it is a Console application
11-
//#define WINDOWS_APP
11+
#define WINDOWS_APP
1212

1313
namespace
1414
{
@@ -64,10 +64,10 @@ namespace
6464
} // anonymous namespace
6565

6666
#ifdef WINDOWS_APP
67-
int APIENTRY WinMain(::HINSTANCE mFnUnused(instance),
68-
::HINSTANCE mFnUnused(previous_instance),
69-
::LPTSTR mFnUnused(command_line),
70-
int mFnUnused(command_show))
67+
int APIENTRY WinMain(::HINSTANCE /*instance*/,
68+
::HINSTANCE /*previous_instance*/,
69+
::LPTSTR /*command_line*/,
70+
int /*command_show*/)
7171
#else
7272
int main()
7373
#endif

Test/dev/src/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ int main(int argc, char* argv[])
77
params._oopExecutable = "CrashServer.exe";
88
CrashHandler crashHandler(params);
99

10-
::Sleep(1000);
11-
1210
*((int*)(0)) = 3;
1311

1412
return 0;

0 commit comments

Comments
 (0)