mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-12-04 17:21:31 +03:00
Merge pull request #510 from dnobori/b3_loadlibrary
Preventing the Win32 API LoadLibrary() current directory DLL injection issue.
This commit is contained in:
@ -154,7 +154,19 @@ static UINT64 probe_start = 0;
|
||||
static UINT64 probe_last = 0;
|
||||
static bool probe_enabled = false;
|
||||
|
||||
// The function which should be called once as soon as possible after the process is started
|
||||
static bool init_proc_once_flag = false;
|
||||
void InitProcessCallOnce()
|
||||
{
|
||||
if (init_proc_once_flag == false)
|
||||
{
|
||||
init_proc_once_flag = true;
|
||||
|
||||
#ifdef OS_WIN32
|
||||
MsInitProcessCallOnce();
|
||||
#endif // OS_WIN32
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the checksum
|
||||
USHORT CalcChecksum16(void *buf, UINT size)
|
||||
@ -490,6 +502,8 @@ void InitMayaqua(bool memcheck, bool debug, int argc, char **argv)
|
||||
return;
|
||||
}
|
||||
|
||||
InitProcessCallOnce();
|
||||
|
||||
g_memcheck = memcheck;
|
||||
g_debug = debug;
|
||||
cmdline = NULL;
|
||||
|
||||
Reference in New Issue
Block a user