mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 20:29:57 +00:00
1bdcb5d6d9
This means the shared memory struct is just 255 bytes longer than a few commits ago instead of 32K. Also introduce a function for putting path strings in the shared memory as there was too much copied and pasted code and it was error-prone. Also free some handles once we're done with them so they don't leak.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#ifndef WINDOWS_CRASHSHM_HPP
|
|
#define WINDOWS_CRASHSHM_HPP
|
|
|
|
#include <components/windows.hpp>
|
|
|
|
namespace Crash
|
|
{
|
|
|
|
// Used to communicate between the app and the monitor, fields are is overwritten with each event.
|
|
static constexpr const int MAX_LONG_PATH = 0x7fff;
|
|
static constexpr const int MAX_FILENAME = 0xff;
|
|
|
|
struct CrashSHM
|
|
{
|
|
enum class Event
|
|
{
|
|
None,
|
|
Startup,
|
|
Crashed,
|
|
Shutdown
|
|
};
|
|
|
|
Event mEvent;
|
|
|
|
struct Startup
|
|
{
|
|
HANDLE mAppProcessHandle;
|
|
DWORD mAppMainThreadId;
|
|
HANDLE mSignalApp;
|
|
HANDLE mSignalMonitor;
|
|
HANDLE mShmMutex;
|
|
char mDumpDirectoryPath[MAX_LONG_PATH];
|
|
char mCrashDumpFileName[MAX_FILENAME];
|
|
char mFreezeDumpFileName[MAX_FILENAME];
|
|
} mStartup;
|
|
|
|
struct Crashed
|
|
{
|
|
DWORD mThreadId;
|
|
CONTEXT mContext;
|
|
EXCEPTION_RECORD mExceptionRecord;
|
|
} mCrashed;
|
|
};
|
|
|
|
} // namespace Crash
|
|
|
|
#endif // WINDOWS_CRASHSHM_HPP
|