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:
@ -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;
|
||||
|
Reference in New Issue
Block a user