1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-17 21:24:57 +03:00

v4.10-9505-beta

This commit is contained in:
dnobori
2014-10-04 00:09:23 +09:00
parent 16b713b98d
commit 10d4b2c43d
349 changed files with 2640 additions and 898 deletions

View File

@ -154,18 +154,12 @@ bool SuInstallDriverInner(bool force)
wchar_t tmp_dir[MAX_PATH];
char *cpu_type = MsIsX64() ? "x64" : "x86";
if (SuIsSupportedOs() == false)
if (SuIsSupportedOs(true) == false)
{
// Unsupported OS
return false;
}
if (MsIsServiceRunning("RemoteAccess"))
{
// Remote Access service is running
return false;
}
CombinePathW(tmp_dir, sizeof(tmp_dir), MsGetWindowsDirW(), L"Temp");
MakeDirExW(tmp_dir);
@ -255,14 +249,36 @@ bool SuInstallDriverInner(bool force)
}
// Get whether the current OS is supported by SeLow
bool SuIsSupportedOs()
bool SuIsSupportedOs(bool on_install)
{
if (MsRegReadIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, "EnableSeLow", false, true) != 0)
{
// Force enable
return true;
}
if (MsRegReadIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, "DisableSeLow", false, true) != 0)
{
// Force disable
return false;
}
if (MsIsWindows10())
{
// Windows 10 or later are always supported.
return true;
}
if (on_install)
{
// If Microsoft Routing and Remote Access service is running,
// then return false.
if (MsIsServiceRunning("RemoteAccess"))
{
return false;
}
}
// If the Su driver is currently running,
// then return true.
if (MsIsServiceRunning(SL_PROTOCOL_NAME))
@ -276,11 +292,14 @@ bool SuIsSupportedOs()
return false;
}
// If Microsoft Routing and Remote Access service is running,
// then return false.
if (MsIsServiceRunning("RemoteAccess"))
if (on_install == false)
{
return false;
// If Microsoft Routing and Remote Access service is running,
// then return false.
if (MsIsServiceRunning("RemoteAccess"))
{
return false;
}
}
return true;
@ -720,7 +739,7 @@ SU *SuInitEx(UINT wait_for_bind_complete_tick)
bool flag = false;
UINT64 giveup_tick = 0;
if (SuIsSupportedOs() == false)
if (SuIsSupportedOs(false) == false)
{
// Unsupported OS
return NULL;