2019-03-27 15:03:08 -04:00
|
|
|
// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
|
|
|
|
|
|
|
|
|
|
#include "LC_EntryPoint.h"
|
|
|
|
|
#include "LC_ClientStartupThread.h"
|
2019-07-24 15:05:52 -04:00
|
|
|
#include "LC_API.h"
|
2019-03-27 15:03:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
|
{
|
2019-07-24 15:05:52 -04:00
|
|
|
// startup thread
|
|
|
|
|
static ClientStartupThread* g_mainStartupThread = nullptr;
|
2019-03-27 15:03:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// BEGIN EPIC MOD - Manually trigger startup/shutdown code
|
|
|
|
|
void Startup(HINSTANCE instance)
|
|
|
|
|
{
|
2019-07-24 15:05:52 -04:00
|
|
|
g_mainStartupThread = new ClientStartupThread(instance);
|
|
|
|
|
api::Startup(g_mainStartupThread);
|
2019-03-27 15:03:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Shutdown(void)
|
|
|
|
|
{
|
2019-07-24 15:05:52 -04:00
|
|
|
api::Shutdown();
|
|
|
|
|
|
2019-03-27 15:03:08 -04:00
|
|
|
// wait for the startup thread to finish its work and clean up
|
2019-07-24 15:05:52 -04:00
|
|
|
g_mainStartupThread->Join();
|
|
|
|
|
delete g_mainStartupThread;
|
2019-03-27 15:03:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
BOOL WINAPI DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD dwReason, _In_ LPVOID /* lpvReserved */)
|
|
|
|
|
{
|
|
|
|
|
switch (dwReason)
|
|
|
|
|
{
|
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
|
Startup(hinstDLL);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
|
Shutdown();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DLL_THREAD_ATTACH:
|
|
|
|
|
case DLL_THREAD_DETACH:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-24 15:05:52 -04:00
|
|
|
return TRUE;
|
2019-03-27 15:03:08 -04:00
|
|
|
}
|
|
|
|
|
#endif
|