summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-07-21 09:55:11 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-07-21 09:55:11 +0000
commit6e40d0f8274e6425c1710ce0f5ed11b30e87dd91 (patch)
treec327120acebc7504a024085f9f08000678aa0aa6 /src
parent0076184101635db631aa005f7252b8c50c2d98b9 (diff)
mir_core: added wine detection
git-svn-id: http://svn.miranda-ng.org/main/trunk@17112 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/lists.cpp6
-rw-r--r--src/mir_core/src/winver.cpp8
2 files changed, 11 insertions, 3 deletions
diff --git a/src/mir_core/src/lists.cpp b/src/mir_core/src/lists.cpp
index ba0c94cb29..dd5bdf77a0 100644
--- a/src/mir_core/src/lists.cpp
+++ b/src/mir_core/src/lists.cpp
@@ -74,7 +74,7 @@ MIR_CORE_DLL(int) List_GetIndex(SortedList* p_list, void* p_value, int* p_index)
int high = p_list->realCount - 1;
switch ((INT_PTR)p_list->sortFunc) {
- case HandleKeySort:
+ case HandleKeySortT:
#ifdef _WIN64
{
const unsigned __int64 val = *(unsigned __int64 *)p_value;
@@ -96,7 +96,7 @@ MIR_CORE_DLL(int) List_GetIndex(SortedList* p_list, void* p_value, int* p_index)
break;
#endif
- case NumericKeySort:
+ case NumericKeySortT:
{
const unsigned val = *(unsigned *)p_value;
@@ -116,7 +116,7 @@ MIR_CORE_DLL(int) List_GetIndex(SortedList* p_list, void* p_value, int* p_index)
}
break;
- case PtrKeySort:
+ case PtrKeySortT:
while (low <= high) {
int i = (low + high) / 2;
const void* vali = p_list->items[i];
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp
index ce2a00dfb3..5c7e983761 100644
--- a/src/mir_core/src/winver.cpp
+++ b/src/mir_core/src/winver.cpp
@@ -196,6 +196,7 @@ MIR_CORE_DLL(BOOL) IsScreenSaverRunning(void)
#endif
typedef BOOL(WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
+typedef LPCSTR(WINAPI *WGV)(void);
MIR_CORE_DLL(BOOL) GetOSDisplayString(TCHAR *buf, size_t bufSize)
{
@@ -400,6 +401,13 @@ MIR_CORE_DLL(BOOL) GetOSDisplayString(TCHAR *buf, size_t bufSize)
}
ret.AppendFormat(_T(" (build %d)"), osvi.dwBuildNumber);
+
+ HMODULE hNtDll = GetModuleHandleA("ntdll.dll");
+ if (WGV wine_get_version = (WGV)GetProcAddress(hNtDll, "wine_get_version"))
+ {
+ ret.AppendFormat(_T(" (Wine %s)"), _A2T(wine_get_version()));
+ }
+
mir_tstrncpy(buf, ret, bufSize);
return TRUE;
}