diff options
author | Mykhaylo Yehorov <yehorov@gmail.com> | 2016-05-04 12:27:52 +0300 |
---|---|---|
committer | Mykhaylo Yehorov <yehorov@gmail.com> | 2016-05-04 12:27:52 +0300 |
commit | 03ffd7535ac3ecb0b5985ab919ed3f50fa6aa7dd (patch) | |
tree | e7f8fb32a7c8325deffbdb012fed7b4c7b334949 /src/Mayaqua | |
parent | 698babf408789fc74a9ee5fbc693beff7ad01bef (diff) | |
parent | 1e17c9bcfd7e7b31756aa5389bcbff76c2c9c88a (diff) |
merge upstream v4.21-9613-beta
Diffstat (limited to 'src/Mayaqua')
-rw-r--r-- | src/Mayaqua/Microsoft.c | 46 | ||||
-rw-r--r-- | src/Mayaqua/Microsoft.h | 2 | ||||
-rw-r--r-- | src/Mayaqua/Network.c | 2 | ||||
-rw-r--r-- | src/Mayaqua/Table.c | 7 | ||||
-rw-r--r-- | src/Mayaqua/Table.h | 2 |
5 files changed, 58 insertions, 1 deletions
diff --git a/src/Mayaqua/Microsoft.c b/src/Mayaqua/Microsoft.c index cc623add..61ad84e7 100644 --- a/src/Mayaqua/Microsoft.c +++ b/src/Mayaqua/Microsoft.c @@ -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)
{
@@ -8796,6 +8797,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);
if (p->no_recursion == false)
@@ -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();
diff --git a/src/Mayaqua/Microsoft.h b/src/Mayaqua/Microsoft.h index 822c0a5b..7e516a52 100644 --- a/src/Mayaqua/Microsoft.h +++ b/src/Mayaqua/Microsoft.h @@ -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();
diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index d0df9010..0a7a321a 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -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
{
diff --git a/src/Mayaqua/Table.c b/src/Mayaqua/Table.c index d306059f..0b227661 100644 --- a/src/Mayaqua/Table.c +++ b/src/Mayaqua/Table.c @@ -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)
{
diff --git a/src/Mayaqua/Table.h b/src/Mayaqua/Table.h index fa7e6f89..9de294ad 100644 --- a/src/Mayaqua/Table.h +++ b/src/Mayaqua/Table.h @@ -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"
|