Index: /branches/rel_ag_9_4_5/windows/ArrayApi/ArrayApi.cpp
===================================================================
--- /branches/rel_ag_9_4_5/windows/ArrayApi/ArrayApi.cpp	(revision 20637)
+++ /branches/rel_ag_9_4_5/windows/ArrayApi/ArrayApi.cpp	(working copy)
@@ -104,6 +104,9 @@
 			strcpy_s(pAuthenInfor->chUserName, MAX_PATH - 1, NamePwd.chName);
 			strcpy_s(pAuthenInfor->chPassword, MAX_PATH - 1, NamePwd.chPassword);
 		}
+		else if (strlen(NamePwd.chName) > 0) {
+			strcpy_s(pAuthenInfor->chUserName, MAX_PATH - 1, NamePwd.chName);
+		}
 		return Ret;
 	}
 
@@ -125,6 +128,13 @@
 		return USE_INTERFACE_CUSTOM;
 	}
 
+	if(g_csUsername.GetLength() > 0)
+	{
+		NAME_PASSWORD* pNamePass = (NAME_PASSWORD*)pStruct;
+		strncpy(pNamePass->chName, (LPCSTR)CW2A(g_csUsername.GetBuffer(0)), MAX_PATH-1);
+		return USE_INTERFACE_DEFAULT;
+	}
+
 	return USE_INTERFACE_DEFAULT;
 }
 
@@ -4307,9 +4317,9 @@
 	return tunnelInfo.m_ErrorID;
 }
 
-ULONG SetAdapterType(int iType)
-{
-	DWORD dwValue = (DWORD)iType;
+ULONG SetAdapterType(int iType)
+{
+	DWORD dwValue = (DWORD)iType;
 	CComQIPtr<IInstallManager> pIInstallManager;
 	HRESULT hr = pIInstallManager.CoCreateInstance(__uuidof(InstallManager));
 	if (hr != S_OK)
@@ -4348,17 +4358,17 @@
 	{
 		Log(LOG_WARNING, (L"SetAdapterType: Create instance failed with VPNServer. Error = 0x%x, try again\n", hr));
 		return ERROR_COM_VPNSERVICE;
-	}
-}
-
-void SetWGTypeService(BOOL bservice)
-{
-	DWORD dwValue = 0;
-	if(bservice)
-	{
-		dwValue = 1;
-	}
-
+	}
+}
+
+void SetWGTypeService(BOOL bservice)
+{
+	DWORD dwValue = 0;
+	if(bservice)
+	{
+		dwValue = 1;
+	}
+
 	CComQIPtr<IInstallManager> pIInstallManager;
 	HRESULT hr = pIInstallManager.CoCreateInstance(__uuidof(InstallManager));
 	if (hr != S_OK)
@@ -4373,7 +4383,7 @@
 	{
 		hr = pIInstallManager->WriteRegValue(TRUE, REG_DWORD, (CComBSTR)"SOFTWARE\\VPN\\AWG", (CComBSTR)"service", (CComBSTR)L"", dwValue);
 		hr = pIInstallManager->WriteRegValue(TRUE, REG_DWORD, (CComBSTR)"SOFTWARE\\WOW6432Node\\VPN\\AWG", (CComBSTR)"service", (CComBSTR)L"", dwValue);
-	}
+	}
 }
 
 int ArrayGetWireGuardList(LPCSTR session, WIREGUARD_LIST *pList)
Index: /branches/rel_ag_9_4_5/windows/ArrayApi/stdafx.cpp
===================================================================
--- /branches/rel_ag_9_4_5/windows/ArrayApi/stdafx.cpp	(revision 20637)
+++ /branches/rel_ag_9_4_5/windows/ArrayApi/stdafx.cpp	(working copy)
@@ -3,3 +3,16 @@
 // stdafx.obj will contain the pre-compiled type information
 
 #include "stdafx.h"
+
+// libeay32.lib was compiled with VS2013 CRT; provide __iob_func/__vsnprintf/vfprintf
+// compatibility stubs required when linking with VS2015+ toolset.
+#pragma comment(lib, "legacy_stdio_definitions.lib")
+
+// Stub for __iob_func: libeay32 was compiled with VS2013 CRT which exported
+// __iob_func; VS2015+ CRT removed it, so provide a compatibility wrapper here.
+#if _MSC_VER >= 1900
+extern "C" {
+    FILE __iob_compat[] = { *stdin, *stdout, *stderr };
+    FILE* __cdecl __iob_func(void) { return __iob_compat; }
+}
+#endif
\ No newline at end of file
Index: /branches/rel_ag_9_4_5/windows/Bin/Language/1028/SecurityGateway.ini
===================================================================
--- /branches/rel_ag_9_4_5/windows/Bin/Language/1028/SecurityGateway.ini	(revision 20637)
+++ /branches/rel_ag_9_4_5/windows/Bin/Language/1028/SecurityGateway.ini	(working copy)
@@ -13,7 +13,7 @@
 CURPWD=舊密碼
 COMPWD=確認新密碼
 NEXT=下一步
-RSA_AUTOMATION=启用RSA令牌自动化
+RSA_AUTOMATION=啟用RSA Token自動化
 
 [SG_DIALOG_SITESHARE]
 TITLE=請選擇登入站點
@@ -189,12 +189,12 @@
 SMS_RESENDSTRING=新的验证码已成功发送
 
 [UI_CHANGEPWD]
-KEY_CPWD_TITLE=修改密码
-KEY_CPWD_REMIND=请输入您的新密码:
-KEY_CPWD_NEWPWD=请输入新密码:
-KEY_CPWD_CONFIRMPWD=请再次输入新密码:
-KEY_CPWD_OK=修改密码
+KEY_CPWD_TITLE=修改密碼
+KEY_CPWD_REMIND=請輸入您的新密碼:
+KEY_CPWD_NEWPWD=請輸入新密碼:
+KEY_CPWD_CONFIRMPWD=請再次輸入新密碼:
+KEY_CPWD_OK=修改密碼
 KEY_CPWD_CANCEL=取消
-KEY_CPWD_NEWPWD_EMPTY=输入新密码
-KEY_CPWD_NEWPWD_ERROR=请输入相同的密码
-KEY_CPWD_NEWPWD_INVALID=新密码不符合要求（密码长度不能超过32个字符）。
\ No newline at end of file
+KEY_CPWD_NEWPWD_EMPTY=輸入新密碼
+KEY_CPWD_NEWPWD_ERROR=請輸入相同的密碼
+KEY_CPWD_NEWPWD_INVALID=新密碼不符合要求（密碼長度不能超過32個字）。
\ No newline at end of file
Index: /branches/rel_ag_9_4_5/windows/Include/ArrayApi.h
===================================================================
--- /branches/rel_ag_9_4_5/windows/Include/ArrayApi.h	(revision 20637)
+++ /branches/rel_ag_9_4_5/windows/Include/ArrayApi.h	(working copy)
@@ -149,24 +149,24 @@
 	};
 }
 
-namespace VpnFlag {
-	enum T {
-		HTTP_PROXY              = 0x0001,
-		SOCK_PROXY              = 0x0002,
-		PROXY_SCOPE_PROCESS     = 0x0004,
-		PROXY_SCOPE_LOCALHOST   = 0x0008,
-		PROXY_SCOPE_ALL         = 0x0010,
-		DEVID_LOGIN             = 0x0020,
-		MOTIONPRO_V2            = 0x0040,
-		LOGOUT_DEV_SESSION      = 0x0080,
-		MOTIONPRO_V1            = 0x0100,
-		NATIVE_L3VPN            = 0x0200,
-		DESKTOP_DIRECT          = 0x0400,
-		CHANGEPASS_ONLY         = 0x0800,
-		LOGIN_ONLY              = 0x1000,
-		TUNEMU                  = 0x2000,
-		SKIP_LOGOUT             = 0x4000,
-	};
+namespace VpnFlag {
+	enum T {
+		HTTP_PROXY              = 0x0001,
+		SOCK_PROXY              = 0x0002,
+		PROXY_SCOPE_PROCESS     = 0x0004,
+		PROXY_SCOPE_LOCALHOST   = 0x0008,
+		PROXY_SCOPE_ALL         = 0x0010,
+		DEVID_LOGIN             = 0x0020,
+		MOTIONPRO_V2            = 0x0040,
+		LOGOUT_DEV_SESSION      = 0x0080,
+		MOTIONPRO_V1            = 0x0100,
+		NATIVE_L3VPN            = 0x0200,
+		DESKTOP_DIRECT          = 0x0400,
+		CHANGEPASS_ONLY         = 0x0800,
+		LOGIN_ONLY              = 0x1000,
+		TUNEMU                  = 0x2000,
+		SKIP_LOGOUT             = 0x4000,
+	};
 }
 
 typedef enum {
@@ -527,14 +527,14 @@
 ERROR_SUCCESS : success
 ERROR_COM_VPNSERVICE:  restart process vpnservice.exe manually
 */
-ULONG ArrayVPNStatusForceResume();
+void ArrayVPNStatusForceResume();
 
 /*
 ULONG ArrayStopProcessByNameW
 ERROR_SUCCESS : success
 ERROR_COM_VPNSERVICE:  restart process vpninstallmanager.exe manually
 */
-ULONG ArrayStopProcessByNameW(LPCWSTR lpProcessName);
+void ArrayStopProcessByNameW(LPCWSTR lpProcessName);
 
 BOOL ArrayEnableRSAAutomation(BOOL bEnabled);
 BOOL ArrayGetRSAAutomationStatus();
Index: /branches/rel_ag_9_4_5/windows/SecurityGateway/DialogAuthenInfor.h
===================================================================
--- /branches/rel_ag_9_4_5/windows/SecurityGateway/DialogAuthenInfor.h	(revision 20637)
+++ /branches/rel_ag_9_4_5/windows/SecurityGateway/DialogAuthenInfor.h	(working copy)
@@ -10,12 +10,12 @@
 	enum {IDD = IDD_DIALOG_AUTHENINFOR};
 
 protected:
-	virtual BOOL OnInitDialog();	
+	virtual BOOL OnInitDialog();
     afx_msg void OnCommandRange(UINT uID);
     afx_msg void OnSelectMethod(NMHDR *pNMHDR, LRESULT *pResult);
 
 public:
-	void FillData(AUTHENTICATE_INFORMATION* pAuthenInfor);
+	void FillData(AUTHENTICATE_INFORMATION* pAuthenInfor, const char* preSetUsername = NULL);
 protected:
 	void InitControlHandle();
 	void InitLanguage();
Index: /branches/rel_ag_9_4_5/windows/SecurityGateway/DialogAuthenInfor.cpp
===================================================================
--- /branches/rel_ag_9_4_5/windows/SecurityGateway/DialogAuthenInfor.cpp	(revision 20637)
+++ /branches/rel_ag_9_4_5/windows/SecurityGateway/DialogAuthenInfor.cpp	(working copy)
@@ -36,7 +36,8 @@
 
 bool g_bshowid = false;
 
-CDialogAuthenInfor::CDialogAuthenInfor(const AUTHENTICATE_STRUCT* pAuthenStruct): CDialog(CDialogAuthenInfor::IDD, &g_AppMainWindows),
+CDialogAuthenInfor::CDialogAuthenInfor(const AUTHENTICATE_STRUCT* pAuthenStruct const char* preSetUsername):
+    CDialog(CDialogAuthenInfor::IDD, &g_AppMainWindows),
     m_pAuthenStruct(pAuthenStruct),m_bSMXauth(false),m_iSMXauthIndx(-1)
 {
 	m_hStaticLogin = NULL;
@@ -57,6 +58,9 @@
 
 	memset(m_chAuthenName, 0, MAX_PATH);
 	memset(m_chUserName, 0, MAX_PATH);
+	if (preSetUsername && strlen(preSetUsername) > 0) {
+		strncpy_s(m_chUserName, preSetUsername, MAX_PATH - 1);
+	}
 	memset(m_chPwd, 0, MAX_PATH);
 	memset(m_chPwd1, 0, MAX_PATH);
 	memset(m_chPwd2, 0, MAX_PATH);
@@ -351,10 +355,13 @@
 				::ShowWindow(m_hEditPwd, SW_HIDE);
 			}
 		}
-		
+
 		::ShowWindow(m_hStaticName, SW_SHOW);
 		::ShowWindow(m_hEditName, SW_SHOW);
 		::SetWindowText(m_hStaticName, chStaticUsername);
+		if (strlen(m_chUserName) > 0) {
+			::SetWindowTextA(m_hEditName, m_chUserName);
+		}
 
 		if(iMultipleAuthNum == 0 || (Iterator->iAuthenType != AAA_AUTHEN_TYPE_CERTIFICATE) || Iterator->bAuthaction)
 		{
Index: /branches/rel_ag_9_4_5/windows/SecurityGateway/FillDataInterface.cpp
===================================================================
--- /branches/rel_ag_9_4_5/windows/SecurityGateway/FillDataInterface.cpp	(revision 20637)
+++ /branches/rel_ag_9_4_5/windows/SecurityGateway/FillDataInterface.cpp	(working copy)
@@ -439,7 +439,7 @@
 				}
 			}
 
-			CDialogAuthenInfor Dialog(pAuthenInfor->pAuthenStruct);
+			CDialogAuthenInfor Dialog(pAuthenInfor->pAuthenStruct, pAuthenInfor->chUserName);
 			if(Dialog.DoModal() == IDOK)
 			{
 				Dialog.FillData(pAuthenInfor);
@@ -449,10 +449,11 @@
 			{
 				SetCancelValueToReg();
 			}
+      break;
 		}
 	case FILL_SMX:
 		{
-			
+
 			SMX_MATRIX* pMatrix = (SMX_MATRIX*)pInfoStruct;
 			if(pMatrix->boxCount==0&&strlen(pMatrix->chLoginID)==0&&strlen(pMatrix->chMxRes)==0)
 			{
