fallout2-ce/src/autorun.cc

31 lines
570 B
C++
Raw Normal View History

2022-05-19 01:51:26 -07:00
#include "autorun.h"
2022-05-29 12:08:13 -07:00
#ifdef _WIN32
2022-05-19 01:51:26 -07:00
// 0x530010
HANDLE gInterplayGenericAutorunMutex;
2022-05-29 12:08:13 -07:00
#endif
2022-05-19 01:51:26 -07:00
// 0x4139C0
bool autorunMutexCreate()
{
2022-05-29 12:08:13 -07:00
#ifdef _WIN32
2022-05-19 01:51:26 -07:00
gInterplayGenericAutorunMutex = CreateMutexA(NULL, FALSE, "InterplayGenericAutorunMutex");
if (GetLastError() == ERROR_ALREADY_EXISTS) {
CloseHandle(gInterplayGenericAutorunMutex);
return false;
}
2022-05-29 12:08:13 -07:00
#endif
2022-05-19 01:51:26 -07:00
return true;
}
// 0x413A00
void autorunMutexClose()
{
2022-05-29 12:08:13 -07:00
#ifdef _WIN32
2022-05-19 01:51:26 -07:00
if (gInterplayGenericAutorunMutex != NULL) {
CloseHandle(gInterplayGenericAutorunMutex);
}
2022-05-29 12:08:13 -07:00
#endif
2022-05-19 01:51:26 -07:00
}