mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-06 07:44:57 +03:00
merge upstream v4.21-9613-beta
This commit is contained in:
@ -8774,6 +8774,7 @@ BOOL CALLBACK EnumChildWindowProc(HWND hWnd, LPARAM lParam)
|
||||
LIST *o;
|
||||
HWND hParent;
|
||||
char c1[MAX_SIZE], c2[MAX_SIZE];
|
||||
bool ok = false;
|
||||
// Validate arguments
|
||||
if (hWnd == NULL || p == NULL)
|
||||
{
|
||||
@ -8795,6 +8796,19 @@ BOOL CALLBACK EnumChildWindowProc(HWND hWnd, LPARAM lParam)
|
||||
}
|
||||
|
||||
if (p->include_ipcontrol || (StrCmpi(c1, "SysIPAddress32") != 0 && (IsEmptyStr(c2) || StrCmpi(c2, "SysIPAddress32") != 0)))
|
||||
{
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if (MsIsWine())
|
||||
{
|
||||
if (StrCmpi(c1, "SysIPAddress32") == 0 || StrCmpi(c2, "SysIPAddress32") == 0)
|
||||
{
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (ok)
|
||||
{
|
||||
AddWindow(o, hWnd);
|
||||
|
||||
@ -12448,6 +12462,33 @@ bool MsIsNt()
|
||||
return ms->IsNt;
|
||||
}
|
||||
|
||||
// Get whether the current system is WINE
|
||||
bool MsIsWine()
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
if (ms == NULL)
|
||||
{
|
||||
HINSTANCE h = LoadLibrary("kernel32.dll");
|
||||
|
||||
if (h != NULL)
|
||||
{
|
||||
if (GetProcAddress(h, "wine_get_unix_file_name") != NULL)
|
||||
{
|
||||
ret = true;
|
||||
}
|
||||
|
||||
FreeLibrary(h);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = ms->IsWine;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Get whether the current user is an Admin
|
||||
bool MsIsAdmin()
|
||||
{
|
||||
@ -14624,6 +14665,11 @@ void MsInit()
|
||||
ms->IsAdmin = true;
|
||||
}
|
||||
|
||||
if (GetProcAddress(ms->hKernel32, "wine_get_unix_file_name") != NULL)
|
||||
{
|
||||
ms->IsWine = true;
|
||||
}
|
||||
|
||||
// Get information about the current process
|
||||
ms->hCurrentProcess = GetCurrentProcess();
|
||||
ms->CurrentProcessId = GetCurrentProcessId();
|
||||
|
@ -400,6 +400,7 @@ typedef struct MS
|
||||
wchar_t *UserNameExW;
|
||||
wchar_t *MinidumpBaseFileNameW;
|
||||
IO *LockFile;
|
||||
bool IsWine;
|
||||
} MS;
|
||||
|
||||
// For Windows NT API
|
||||
@ -732,6 +733,7 @@ bool MsRegUnloadHive(UINT root, wchar_t *keyname);
|
||||
|
||||
bool MsIsNt();
|
||||
bool MsIsAdmin();
|
||||
bool MsIsWine();
|
||||
bool MsEnablePrivilege(char *name, bool enable);
|
||||
void *MsGetCurrentProcess();
|
||||
UINT MsGetCurrentProcessId();
|
||||
|
@ -15275,7 +15275,7 @@ SOCK *ConnectEx4(char *hostname, UINT port, UINT timeout, bool *cancel_flag, cha
|
||||
Copy(&ip4, ret_ip, sizeof(IP));
|
||||
}
|
||||
|
||||
Debug("Using cached IP address: %s = %r\n", hostname_original, ret_ip);
|
||||
//Debug("Using cached IP address: %s = %r\n", hostname_original, ret_ip);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -562,6 +562,13 @@ LIST *LoadLangList()
|
||||
char *filename = LANGLIST_FILENAME;
|
||||
BUF *b;
|
||||
|
||||
#ifdef OS_WIN32
|
||||
if (MsIsWine())
|
||||
{
|
||||
filename = LANGLIST_FILENAME_WINE;
|
||||
}
|
||||
#endif // OS_WIN32
|
||||
|
||||
b = ReadDump(filename);
|
||||
if (b == NULL)
|
||||
{
|
||||
|
@ -117,6 +117,8 @@
|
||||
#define UNICODE_CACHE_FILE L".unicode_cache_%s.dat"
|
||||
|
||||
#define LANGLIST_FILENAME "|languages.txt"
|
||||
#define LANGLIST_FILENAME_WINE "|languages_wine.txt"
|
||||
|
||||
#define LANG_CONFIG_FILENAME L"@lang.config"
|
||||
#define LANG_CONFIG_TEMPLETE "|lang.config"
|
||||
|
||||
|
Reference in New Issue
Block a user