mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2026-04-20 05:49:26 +03:00
merge with vendor
This commit is contained in:
@@ -205,7 +205,8 @@ void AcWaitForRequest(AZURE_CLIENT *ac, SOCK *s, AZURE_PARAM *param)
|
||||
BinToStr(server_cert_hash_str, sizeof(server_cert_hash_str),
|
||||
server_cert_hash, SHA1_SIZE);
|
||||
|
||||
if (IsEmptyStr(ac->DDnsStatusCopy.AzureCertHash) || StrCmpi(server_cert_hash_str, ac->DDnsStatusCopy.AzureCertHash) == 0)
|
||||
if (IsEmptyStr(ac->DDnsStatusCopy.AzureCertHash) || StrCmpi(server_cert_hash_str, ac->DDnsStatusCopy.AzureCertHash) == 0
|
||||
|| StrCmpi(server_cert_hash_str, ac->DDnsStatus.AzureCertHash) == 0)
|
||||
{
|
||||
if (SendAll(ns, AZURE_PROTOCOL_DATA_SIANGTURE, 24, true))
|
||||
{
|
||||
|
||||
@@ -1894,6 +1894,12 @@ bool IsPcdSupported()
|
||||
UINT type;
|
||||
OS_INFO *info = GetOsInfo();
|
||||
|
||||
if (MsIsWindows10())
|
||||
{
|
||||
// Windows 10 or later never supports PCD driver.
|
||||
return false;
|
||||
}
|
||||
|
||||
type = info->OsType;
|
||||
|
||||
if (OS_IS_WINDOWS_NT(type) == false)
|
||||
@@ -1972,11 +1978,6 @@ HINSTANCE InstallPcdDriverInternal()
|
||||
src_filename = BRIDGE_WIN32_PCD_SYS_X64;
|
||||
}
|
||||
|
||||
if (MsIsIA64())
|
||||
{
|
||||
src_filename = BRIDGE_WIN32_PCD_SYS_IA64;
|
||||
}
|
||||
|
||||
// Copy see.sys
|
||||
if (FileCopy(src_filename, tmp) == false)
|
||||
{
|
||||
@@ -1995,10 +1996,6 @@ HINSTANCE InstallPcdDriverInternal()
|
||||
{
|
||||
dll_filename = BRIDGE_WIN32_PCD_DLL_X64;
|
||||
}
|
||||
else if (MsIsIA64())
|
||||
{
|
||||
dll_filename = BRIDGE_WIN32_PCD_DLL_IA64;
|
||||
}
|
||||
}
|
||||
|
||||
// Try to load see.dll and initialize
|
||||
|
||||
@@ -116,11 +116,9 @@
|
||||
|
||||
#define BRIDGE_WIN32_PACKET_DLL "Packet.dll"
|
||||
#define BRIDGE_WIN32_PCD_DLL "|see.dll"
|
||||
#define BRIDGE_WIN32_PCD_SYS "|see.sys"
|
||||
#define BRIDGE_WIN32_PCD_SYS "|DriverPackages\\See\\x86\\See_x86.sys"
|
||||
#define BRIDGE_WIN32_PCD_DLL_X64 "|see_x64.dll"
|
||||
#define BRIDGE_WIN32_PCD_SYS_X64 "|see_x64.sys"
|
||||
#define BRIDGE_WIN32_PCD_DLL_IA64 "|see_ia64.dll"
|
||||
#define BRIDGE_WIN32_PCD_SYS_IA64 "|see_ia64.sys"
|
||||
#define BRIDGE_WIN32_PCD_SYS_X64 "|DriverPackages\\See\\x64\\See_x64.sys"
|
||||
#define BRIDGE_WIN32_PCD_REGKEY "SYSTEM\\CurrentControlSet\\services\\SEE"
|
||||
#define BRIDGE_WIN32_PCD_BUILDVALUE "CurrentInstalledBuild"
|
||||
|
||||
|
||||
+8
-7
@@ -135,10 +135,10 @@
|
||||
|
||||
|
||||
// Version number
|
||||
#define CEDAR_VER 414
|
||||
#define CEDAR_VER 417
|
||||
|
||||
// Build Number
|
||||
#define CEDAR_BUILD 9529
|
||||
#define CEDAR_BUILD 9562
|
||||
|
||||
// Beta number
|
||||
//#define BETA_NUMBER 3
|
||||
@@ -158,11 +158,11 @@
|
||||
|
||||
// Specifies the build date
|
||||
#define BUILD_DATE_Y 2015
|
||||
#define BUILD_DATE_M 2
|
||||
#define BUILD_DATE_D 2
|
||||
#define BUILD_DATE_M 5
|
||||
#define BUILD_DATE_D 30
|
||||
#define BUILD_DATE_HO 17
|
||||
#define BUILD_DATE_MI 33
|
||||
#define BUILD_DATE_SE 33
|
||||
#define BUILD_DATE_MI 41
|
||||
#define BUILD_DATE_SE 38
|
||||
|
||||
// Tolerable time difference
|
||||
#define ALLOW_TIMESTAMP_DIFF (UINT64)(3 * 24 * 60 * 60 * 1000)
|
||||
@@ -242,7 +242,7 @@
|
||||
#define FIFO_BUDGET VPN_GP(GP_FIFO_BUDGET, 1000000)
|
||||
#endif // USE_STRATEGY_LOW_MEMORY
|
||||
|
||||
#define MAX_PACKET_SIZE 1560 // Maximum packet size
|
||||
#define MAX_PACKET_SIZE 1600 // Maximum packet size
|
||||
#define UDP_BUF_SIZE (32 * 1024) // Aim of the UDP packet size
|
||||
|
||||
#ifndef USE_STRATEGY_LOW_MEMORY
|
||||
@@ -941,6 +941,7 @@
|
||||
#define ERR_VPNGATE_CLIENT 145 // Operation on VPN Gate Client is not available
|
||||
#define ERR_VPNGATE_INCLIENT_CANT_STOP 146 // Can not be stopped if operating within VPN Client mode
|
||||
#define ERR_NOT_SUPPORTED_FUNCTION_ON_OPENSOURCE 147 // It is a feature that is not supported in the open source version
|
||||
#define ERR_SUSPENDING 148 // System is suspending
|
||||
|
||||
|
||||
////////////////////////////
|
||||
|
||||
@@ -10590,6 +10590,13 @@ CLIENT *CiNewClient()
|
||||
ci_num_active_sessions = 0;
|
||||
}
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (MsIsWindows7())
|
||||
{
|
||||
c->MsSuspendHandler = MsNewSuspendHandler();
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
|
||||
c->CmSetting = ZeroMalloc(sizeof(CM_SETTING));
|
||||
|
||||
@@ -10811,6 +10818,13 @@ void CiCleanupClient(CLIENT *c)
|
||||
Free(c->CmSetting);
|
||||
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (c->MsSuspendHandler != NULL)
|
||||
{
|
||||
MsFreeSuspendHandler(c->MsSuspendHandler);
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
Free(c);
|
||||
|
||||
#ifdef OS_WIN32
|
||||
|
||||
@@ -503,6 +503,7 @@ struct CLIENT
|
||||
bool NoSaveLog; // Do not save the log
|
||||
bool NoSaveConfig; // Do not save the settings
|
||||
INTERNET_SETTING CommonProxySetting; // Common proxy settings
|
||||
void *MsSuspendHandler; // MS suspend handler
|
||||
|
||||
};
|
||||
|
||||
|
||||
+10
-1
@@ -23096,7 +23096,7 @@ UINT PsConnect(CONSOLE *c, char *host, UINT port, char *hub, char *adminhub, wch
|
||||
// Failure
|
||||
retcode = err;
|
||||
|
||||
if (err == ERR_ACCESS_DENIED)
|
||||
if (err == ERR_ACCESS_DENIED && c->ProgrammingMode == false)
|
||||
{
|
||||
char *pass;
|
||||
// Password is incorrect
|
||||
@@ -23402,6 +23402,7 @@ UINT VpnCmdProc(CONSOLE *c, char *cmd_name, wchar_t *str, void *param)
|
||||
{"OUT", NULL, NULL, NULL, NULL},
|
||||
{"CMD", NULL, NULL, NULL, NULL},
|
||||
{"CSV", NULL, NULL, NULL, NULL},
|
||||
{"PROGRAMMING", NULL, NULL, NULL, NULL},
|
||||
};
|
||||
|
||||
#ifdef OS_WIN32
|
||||
@@ -23621,6 +23622,7 @@ UINT CommandMain(wchar_t *command_line)
|
||||
wchar_t *infile, *outfile;
|
||||
char *a_infile, *a_outfile;
|
||||
wchar_t *csvmode;
|
||||
wchar_t *programming_mode;
|
||||
CONSOLE *c;
|
||||
|
||||
// Validate arguments
|
||||
@@ -23664,6 +23666,13 @@ UINT CommandMain(wchar_t *command_line)
|
||||
c->ConsoleType = CONSOLE_CSV;
|
||||
}
|
||||
|
||||
programming_mode = ParseCommand(command_line, L"programming");
|
||||
if (programming_mode != NULL)
|
||||
{
|
||||
Free(programming_mode);
|
||||
c->ProgrammingMode = true;
|
||||
}
|
||||
|
||||
if (DispatchNextCmdEx(c, command_line, ">", cmd, sizeof(cmd) / sizeof(cmd[0]), NULL) == false)
|
||||
{
|
||||
ret = ERR_INVALID_PARAMETER;
|
||||
|
||||
+25
-1
@@ -769,6 +769,18 @@ bool DispatchNextCmdEx(CONSOLE *c, wchar_t *exec_command, char *prompt, CMD cmd[
|
||||
// Show the prompt
|
||||
RETRY:
|
||||
tmp = CopyStrToUni(prompt);
|
||||
|
||||
if (c->ProgrammingMode)
|
||||
{
|
||||
wchar_t tmp2[MAX_PATH];
|
||||
|
||||
UniFormat(tmp2, sizeof(tmp2), L"[PROMPT:%u:%s]\r\n", c->RetCode, tmp);
|
||||
|
||||
Free(tmp);
|
||||
|
||||
tmp = CopyUniStr(tmp2);
|
||||
}
|
||||
|
||||
str = c->ReadLine(c, tmp, false);
|
||||
Free(tmp);
|
||||
|
||||
@@ -1430,6 +1442,14 @@ EVAL_VALUE:
|
||||
Free(str);
|
||||
break;
|
||||
}
|
||||
else if (c->ProgrammingMode)
|
||||
{
|
||||
// In the programming mode, return the error immediately.
|
||||
ok = false;
|
||||
Free(name);
|
||||
Free(str);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Request to re-enter
|
||||
@@ -1458,7 +1478,11 @@ EVAL_VALUE:
|
||||
wchar_t *tmp;
|
||||
SHOW_PROMPT:
|
||||
// Prompt because it is a mandatory parameter
|
||||
tmp = p->PromptProc(c, p->PromptProcParam);
|
||||
tmp = NULL;
|
||||
if (c->ProgrammingMode == false)
|
||||
{
|
||||
tmp = p->PromptProc(c, p->PromptProcParam);
|
||||
}
|
||||
if (tmp == NULL)
|
||||
{
|
||||
// User canceled
|
||||
|
||||
@@ -160,6 +160,7 @@ struct CONSOLE
|
||||
char *(*ReadPassword)(CONSOLE *c, wchar_t *prompt); // Function to read the password
|
||||
bool (*Write)(CONSOLE *c, wchar_t *str); // Function to write a string
|
||||
UINT (*GetWidth)(CONSOLE *c); // Get the width of the screen
|
||||
bool ProgrammingMode; // Programming Mode
|
||||
};
|
||||
|
||||
// Local console parameters
|
||||
|
||||
+17
-5
@@ -367,10 +367,19 @@ bool IPsecWin7InitDriverInner()
|
||||
|
||||
if (install_driver)
|
||||
{
|
||||
char *src_filename = IPSEC_WIN7_SRC_SYS_X86;
|
||||
if (MsIsX64())
|
||||
char src_filename[MAX_PATH];
|
||||
|
||||
if (MsIsWindows10() == false)
|
||||
{
|
||||
src_filename = IPSEC_WIN7_SRC_SYS_X64;
|
||||
Format(src_filename, sizeof(src_filename),
|
||||
"|DriverPackages\\Wfp\\%s\\pxwfp_%s.sys",
|
||||
(MsIsX64() ? "x64" : "x86"), (MsIsX64() ? "x64" : "x86"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Format(src_filename, sizeof(src_filename),
|
||||
"|DriverPackages\\Wfp_Win10\\%s\\pxwfp_%s.sys",
|
||||
(MsIsX64() ? "x64" : "x86"), (MsIsX64() ? "x64" : "x86"));
|
||||
}
|
||||
|
||||
// Copy the driver
|
||||
@@ -467,13 +476,16 @@ bool IPsecWin7InitDriverInner()
|
||||
// Write the build number of the current driver
|
||||
void SetCurrentIPsecWin7DriverBuild()
|
||||
{
|
||||
MsRegWriteInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY, IPSEC_WIN7_DRIVER_BUILDNUMBER, CEDAR_BUILD);
|
||||
MsRegWriteInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY,
|
||||
(MsIsWindows10() ? IPSEC_WIN7_DRIVER_BUILDNUMBER_WIN10 : IPSEC_WIN7_DRIVER_BUILDNUMBER),
|
||||
CEDAR_BUILD);
|
||||
}
|
||||
|
||||
// Get the build number of the current driver
|
||||
UINT GetCurrentIPsecWin7DriverBuild()
|
||||
{
|
||||
return MsRegReadInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY, IPSEC_WIN7_DRIVER_BUILDNUMBER);
|
||||
return MsRegReadInt(REG_LOCAL_MACHINE, IPSEC_WIN7_DRIVER_REGKEY,
|
||||
(MsIsWindows10() ? IPSEC_WIN7_DRIVER_BUILDNUMBER_WIN10 : IPSEC_WIN7_DRIVER_BUILDNUMBER));
|
||||
}
|
||||
|
||||
// Initialization of the API
|
||||
|
||||
@@ -127,6 +127,7 @@
|
||||
#define IPSEC_WIN7_FILTER_TITLE_V6 CEDAR_PRODUCT_STR_W L" VPN IPsec Filter for IPv6"
|
||||
#define IPSEC_WIN7_DRIVER_REGKEY "SYSTEM\\CurrentControlSet\\services\\pxwfp"
|
||||
#define IPSEC_WIN7_DRIVER_BUILDNUMBER "CurrentInstalledBuild"
|
||||
#define IPSEC_WIN7_DRIVER_BUILDNUMBER_WIN10 "CurrentInstalledBuild_Win10"
|
||||
|
||||
|
||||
// Function prototype
|
||||
|
||||
+40
-2
@@ -166,6 +166,7 @@ static SW_OLD_MSI old_msi_vpnbridge[] =
|
||||
static char *sfx_vpn_server_bridge_files[] =
|
||||
{
|
||||
"vpnsetup.exe",
|
||||
"vpnsetup_x64.exe",
|
||||
"vpnserver.exe",
|
||||
"vpnserver_x64.exe",
|
||||
"vpnbridge.exe",
|
||||
@@ -179,6 +180,7 @@ static char *sfx_vpn_server_bridge_files[] =
|
||||
static char *sfx_vpn_client_files[] =
|
||||
{
|
||||
"vpnsetup.exe",
|
||||
"vpnsetup_x64.exe",
|
||||
"vpnclient.exe",
|
||||
"vpnclient_x64.exe",
|
||||
"vpncmgr.exe",
|
||||
@@ -2460,6 +2462,7 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c)
|
||||
wchar_t dir_startup[MAX_PATH];
|
||||
wchar_t tmp1[MAX_SIZE], tmp2[MAX_SIZE];
|
||||
SW_TASK_COPY *setup_exe;
|
||||
SW_TASK_COPY *setup_exe_x64;
|
||||
// Validate arguments
|
||||
if (sw == NULL || t == NULL || c == NULL)
|
||||
{
|
||||
@@ -2498,6 +2501,10 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c)
|
||||
Add(t->CopyTasks, (setup_exe = SwNewCopyTask(src_setup_exe_filename,
|
||||
L"vpnsetup.exe", src_setup_exe_dir, sw->InstallDir, true, true)));
|
||||
|
||||
// Add vpnsetup_x64.exe to the copy list
|
||||
Add(t->CopyTasks, (setup_exe_x64 = SwNewCopyTask(L"vpnsetup_x64.exe",
|
||||
L"vpnsetup_x64.exe", src_setup_exe_dir, sw->InstallDir, true, true)));
|
||||
|
||||
// Generate the file processing list for each component
|
||||
if (c->Id == SW_CMP_VPN_SERVER)
|
||||
{
|
||||
@@ -3182,9 +3189,29 @@ bool SwInstallMain(SW *sw, WIZARD_PAGE *wp, SW_COMPONENT *c)
|
||||
|
||||
if (install_su)
|
||||
{
|
||||
SwPerformPrint(wp, _UU("SW_PERFORM_MSG_INSTALL_SELOW"));
|
||||
bool ret;
|
||||
|
||||
SuInstallDriver(false);
|
||||
SwPerformPrint(wp, _UU("SW_PERFORM_MSG_INSTALL_SELOW"));
|
||||
ret = SuInstallDriver(false);
|
||||
|
||||
if (ret == false)
|
||||
{
|
||||
if (MsIs64BitWindows() && MsIsWindows10())
|
||||
{
|
||||
void *proc_handle = NULL;
|
||||
wchar_t exe[MAX_PATH];
|
||||
|
||||
CombinePathW(exe, sizeof(exe), MsGetExeDirNameW(), L"vpnsetup_x64.exe");
|
||||
|
||||
if (MsExecuteEx2W(exe, L"/SUINSTMODE:yes", &proc_handle, true))
|
||||
{
|
||||
if (proc_handle != NULL)
|
||||
{
|
||||
MsWaitProcessExit(proc_handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6493,6 +6520,7 @@ void SwParseCommandLine(SW *sw)
|
||||
{"ISEASYINSTALLER", NULL, NULL, NULL, NULL, },
|
||||
{"DISABLEAUTOIMPORT", NULL, NULL, NULL, NULL, },
|
||||
{"ISWEBINSTALLER", NULL, NULL, NULL, NULL, },
|
||||
{"SUINSTMODE", NULL, NULL, NULL, NULL, },
|
||||
};
|
||||
// Validate arguments
|
||||
if (sw == NULL)
|
||||
@@ -6520,6 +6548,7 @@ void SwParseCommandLine(SW *sw)
|
||||
sw->LangNow = GetParamYes(o, "LANGNOW");
|
||||
sw->SetLangAndReboot = GetParamYes(o, "SETLANGANDREBOOT");
|
||||
sw->HideStartCommand = GetParamYes(o, "HIDESTARTCOMMAND");
|
||||
sw->SuInstMode = GetParamYes(o, "SUINSTMODE");
|
||||
|
||||
// Special mode
|
||||
if (sw->LanguageMode == false)
|
||||
@@ -6590,6 +6619,15 @@ UINT SWExecMain()
|
||||
sw->ExitCode = 0;
|
||||
}
|
||||
}
|
||||
else if (sw->SuInstMode)
|
||||
{
|
||||
// SuInst mode
|
||||
sw->ExitCode = 0;
|
||||
if (SuInstallDriver(false) == false)
|
||||
{
|
||||
sw->ExitCode = SW_EXIT_CODE_INTERNAL_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Normal mode
|
||||
|
||||
@@ -344,6 +344,7 @@ typedef struct SW
|
||||
bool IsEasyInstaller; // Whether the calling SFX was built by the simple installer creation kit
|
||||
bool IsWebInstaller; // Whether Web installer
|
||||
bool DisableAutoImport; // Not to use the automatic import process
|
||||
bool SuInstMode; // SuInst mode
|
||||
UINT CurrentEulaHash; // Hash of the license agreement
|
||||
} SW;
|
||||
|
||||
|
||||
+45
-6
@@ -175,7 +175,9 @@ bool SuInstallDriverInner(bool force)
|
||||
char *path;
|
||||
|
||||
// Read the current version from the registry
|
||||
current_sl_ver = MsRegReadIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, SL_REG_VER_VALUE, false, true);
|
||||
current_sl_ver = MsRegReadIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME,
|
||||
(MsIsWindows10() ? SL_REG_VER_VALUE_WIN10 : SL_REG_VER_VALUE),
|
||||
false, true);
|
||||
|
||||
path = MsRegReadStrEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, "ImagePath", false, true);
|
||||
|
||||
@@ -195,12 +197,33 @@ bool SuInstallDriverInner(bool force)
|
||||
}
|
||||
|
||||
// Copy necessary files to a temporary directory
|
||||
UniFormat(src_sys, sizeof(src_sys), L"|SeLow_%S.sys", cpu_type);
|
||||
UniFormat(src_cat, sizeof(src_cat), L"|inf\\selow_%S\\inf.cat", cpu_type);
|
||||
UniFormat(src_inf, sizeof(src_inf), L"|inf\\selow_%S\\SeLow_%S.inf", cpu_type, cpu_type);
|
||||
UniFormat(src_sys, sizeof(src_sys), L"|DriverPackages\\%S\\%S\\SeLow_%S.sys",
|
||||
(MsIsWindows10() ? "SeLow_Win10" : "SeLow_Win8"),
|
||||
cpu_type, cpu_type);
|
||||
if (MsIsWindows8() == false)
|
||||
{
|
||||
// Windows Vista and Windows 7 uses SHA-1 catalog files
|
||||
UniFormat(src_cat, sizeof(src_cat), L"|DriverPackages\\SeLow_Win8\\%S\\inf.cat", cpu_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Windows 8 or above uses SHA-256 catalog files
|
||||
UniFormat(src_cat, sizeof(src_cat), L"|DriverPackages\\SeLow_Win8\\%S\\inf2.cat", cpu_type);
|
||||
|
||||
if (MsIsWindows10())
|
||||
{
|
||||
// Windows 10 uses WHQL catalog files
|
||||
UniFormat(src_cat, sizeof(src_cat), L"|DriverPackages\\SeLow_Win10\\%S\\SeLow_Win10_%S.cat", cpu_type, cpu_type);
|
||||
}
|
||||
}
|
||||
UniFormat(src_inf, sizeof(src_inf), L"|DriverPackages\\%S\\%S\\SeLow_%S.inf",
|
||||
(MsIsWindows10() ? "SeLow_Win10" : "SeLow_Win8"),
|
||||
cpu_type, cpu_type);
|
||||
|
||||
UniFormat(dst_sys, sizeof(dst_cat), L"%s\\SeLow_%S.sys", tmp_dir, cpu_type);
|
||||
UniFormat(dst_cat, sizeof(dst_cat), L"%s\\inf_selow.cat", tmp_dir);
|
||||
UniFormat(dst_cat, sizeof(dst_cat), L"%s\\SeLow_%S_%S.cat", tmp_dir,
|
||||
(MsIsWindows10() ? "Win10" : "Win8"),
|
||||
cpu_type);
|
||||
UniFormat(dst_inf, sizeof(dst_inf), L"%s\\SeLow_%S.inf", tmp_dir, cpu_type);
|
||||
|
||||
if (FileCopyW(src_sys, dst_sys) &&
|
||||
@@ -226,7 +249,9 @@ bool SuInstallDriverInner(bool force)
|
||||
ret = true;
|
||||
|
||||
// Write the version number into the registry
|
||||
MsRegWriteIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, SL_REG_VER_VALUE, SL_VER, false, true);
|
||||
MsRegWriteIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME,
|
||||
(MsIsWindows10() ? SL_REG_VER_VALUE_WIN10 : SL_REG_VER_VALUE),
|
||||
SL_VER, false, true);
|
||||
|
||||
// Set to automatic startup
|
||||
MsRegWriteIntEx2(REG_LOCAL_MACHINE, SL_REG_KEY_NAME, "Start", SERVICE_SYSTEM_START, false, true);
|
||||
@@ -738,6 +763,7 @@ SU *SuInitEx(UINT wait_for_bind_complete_tick)
|
||||
UINT read_size;
|
||||
bool flag = false;
|
||||
UINT64 giveup_tick = 0;
|
||||
bool flag2 = false;
|
||||
|
||||
if (SuIsSupportedOs(false) == false)
|
||||
{
|
||||
@@ -761,6 +787,19 @@ LABEL_RETRY:
|
||||
if (MsStartService(SL_PROTOCOL_NAME) == false)
|
||||
{
|
||||
Debug("MsStartService(%s) Failed.\n", SL_PROTOCOL_NAME);
|
||||
|
||||
if (MsIsWindows10())
|
||||
{
|
||||
if (flag2 == false)
|
||||
{
|
||||
flag2 = true;
|
||||
|
||||
if (SuInstallDriver(true))
|
||||
{
|
||||
goto LABEL_RETRY;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -144,6 +144,7 @@ void SessionMain(SESSION *s)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Debug("SessionMain: %s\n", s->Name);
|
||||
|
||||
Notify(s, CLIENT_NOTIFY_ACCOUNT_CHANGED);
|
||||
@@ -161,6 +162,19 @@ void SessionMain(SESSION *s)
|
||||
policy = s->Policy;
|
||||
|
||||
// Initialize the packet adapter
|
||||
#ifdef OS_WIN32
|
||||
if (s->IsVPNClientAndVLAN_Win32)
|
||||
{
|
||||
MsBeginVLanCard();
|
||||
|
||||
if (MsIsVLanCardShouldStop())
|
||||
{
|
||||
err = ERR_SUSPENDING;
|
||||
goto CLEANUP;
|
||||
}
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
pa = s->PacketAdapter;
|
||||
if (pa->Init(s) == false)
|
||||
{
|
||||
@@ -358,6 +372,18 @@ void SessionMain(SESSION *s)
|
||||
pa_fail = true;
|
||||
}
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (s->IsVPNClientAndVLAN_Win32)
|
||||
{
|
||||
if (MsIsVLanCardShouldStop())
|
||||
{
|
||||
// System is suspending
|
||||
err = ERR_SUSPENDING;
|
||||
pa_fail = true;
|
||||
}
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
// Pass the received block to the PacketAdapter
|
||||
if (lock_receive_blocks_queue)
|
||||
{
|
||||
@@ -707,6 +733,13 @@ CLEANUP:
|
||||
pa->Free(s);
|
||||
}
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (s->IsVPNClientAndVLAN_Win32)
|
||||
{
|
||||
MsEndVLanCard();
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
if (s->ServerMode == false)
|
||||
{
|
||||
// Cancel to make all additional connection
|
||||
@@ -1972,11 +2005,17 @@ SESSION *NewClientSessionEx(CEDAR *cedar, CLIENT_OPTION *option, CLIENT_AUTH *au
|
||||
|
||||
// Hold whether the virtual LAN card is used in client mode
|
||||
s->ClientModeAndUseVLan = (StrLen(s->ClientOption->DeviceName) == 0) ? false : true;
|
||||
|
||||
if (s->ClientOption->NoRoutingTracking)
|
||||
{
|
||||
s->ClientModeAndUseVLan = false;
|
||||
}
|
||||
|
||||
if (pa->Id == PACKET_ADAPTER_ID_VLAN_WIN32)
|
||||
{
|
||||
s->IsVPNClientAndVLAN_Win32 = true;
|
||||
}
|
||||
|
||||
if (StrLen(option->DeviceName) == 0)
|
||||
{
|
||||
// NAT mode
|
||||
|
||||
@@ -167,8 +167,13 @@ struct PACKET_ADAPTER
|
||||
PA_PUTPACKET *PutPacket;
|
||||
PA_FREE *Free;
|
||||
void *Param;
|
||||
UINT Id;
|
||||
};
|
||||
|
||||
// Packet Adapter IDs
|
||||
#define PACKET_ADAPTER_ID_VLAN_WIN32 1
|
||||
|
||||
|
||||
// Session structure
|
||||
struct SESSION
|
||||
{
|
||||
@@ -262,6 +267,7 @@ struct SESSION
|
||||
UINT64 CurrentConnectionEstablishTime; // Completion time of this connection
|
||||
UINT NumConnectionsEatablished; // Number of connections established so far
|
||||
UINT AdjustMss; // MSS adjustment value
|
||||
bool IsVPNClientAndVLAN_Win32; // Is the VPN Client session with a VLAN card (Win32)
|
||||
|
||||
bool IsRUDPSession; // Whether R-UDP session
|
||||
UINT RUdpMss; // The value of the MSS should be applied while the R-UDP is used
|
||||
|
||||
+17
-10
@@ -1135,19 +1135,24 @@ void VLanPaFree(SESSION *s)
|
||||
{
|
||||
char tmp[MAX_SIZE];
|
||||
MS_ADAPTER *a;
|
||||
UINT64 now = Tick64();
|
||||
UINT64 suspend_tick = MsGetSuspendModeBeginTick();
|
||||
|
||||
Format(tmp, sizeof(tmp), VLAN_ADAPTER_NAME_TAG, v->InstanceName);
|
||||
a = MsGetAdapter(tmp);
|
||||
|
||||
if (a != NULL)
|
||||
if (suspend_tick == 0 || (suspend_tick + (UINT64)(30 * 1000)) < now)
|
||||
{
|
||||
if (a->UseDhcp)
|
||||
{
|
||||
bool ret = Win32ReleaseAddressByGuidEx(a->Guid, 50);
|
||||
Debug("*** Win32ReleaseAddressByGuid = %u\n", ret);
|
||||
}
|
||||
Format(tmp, sizeof(tmp), VLAN_ADAPTER_NAME_TAG, v->InstanceName);
|
||||
a = MsGetAdapter(tmp);
|
||||
|
||||
MsFreeAdapter(a);
|
||||
if (a != NULL)
|
||||
{
|
||||
if (a->UseDhcp)
|
||||
{
|
||||
bool ret = Win32ReleaseAddressByGuidEx(a->Guid, 50);
|
||||
Debug("*** Win32ReleaseAddressByGuid = %u\n", ret);
|
||||
}
|
||||
|
||||
MsFreeAdapter(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1269,6 +1274,8 @@ PACKET_ADAPTER *VLanGetPacketAdapter()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pa->Id = PACKET_ADAPTER_ID_VLAN_WIN32;
|
||||
|
||||
return pa;
|
||||
}
|
||||
|
||||
|
||||
@@ -1004,6 +1004,12 @@ void ShowWizard(HWND hWndParent, WIZARD *w, UINT start_id)
|
||||
w->IsAreoStyle = false;
|
||||
}
|
||||
|
||||
if (MsIsWindows10())
|
||||
{
|
||||
// Windows 10 Icon Bug: Disable Aero Style!
|
||||
w->IsAreoStyle = false;
|
||||
}
|
||||
|
||||
if (w->IsAreoStyle)
|
||||
{
|
||||
// Aero Wizard
|
||||
@@ -2960,12 +2966,14 @@ void AdjustWindowAndControlSize(HWND hWnd, bool *need_resize, double *factor_x,
|
||||
*need_resize = false;
|
||||
*factor_x = 1.0;
|
||||
*factor_y = 1.0;
|
||||
//Debug("// There is no need to adjust\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate the adjustment amount
|
||||
*factor_x = (double)dlgfont_x / (double)WINUI_DEFAULT_DIALOG_UNIT_X;
|
||||
*factor_y = (double)dlgfont_y / (double)WINUI_DEFAULT_DIALOG_UNIT_Y;
|
||||
//Debug("Factors: %f %f\n", *factor_x, *factor_y);
|
||||
|
||||
if (MsIsVista())
|
||||
{
|
||||
@@ -10042,6 +10050,15 @@ UINT DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, bool white_color
|
||||
switch (msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
if (true)
|
||||
{
|
||||
RECT rect1;
|
||||
|
||||
SetRect(&rect1, 0, 0, 100, 100);
|
||||
MapDialogRect(hWnd, &rect1);
|
||||
Debug("%u %u %u %u\n", rect1.left, rect1.right, rect1.top, rect1.bottom);
|
||||
}
|
||||
|
||||
param = (void *)lParam;
|
||||
SetParam(hWnd, param);
|
||||
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@
|
||||
#define WINUI_PASSWORD_NULL_USERNAME "NULL"
|
||||
|
||||
#define WINUI_DEFAULT_DIALOG_UNIT_X 7
|
||||
#define WINUI_DEFAULT_DIALOG_UNIT_Y 12
|
||||
#define WINUI_DEFAULT_DIALOG_UNIT_Y 14
|
||||
|
||||
// Make available the types for Windows even if windows.h is not included
|
||||
#ifndef _WINDEF_
|
||||
|
||||
Reference in New Issue
Block a user