From 6e40d0f8274e6425c1710ce0f5ed11b30e87dd91 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Thu, 21 Jul 2016 09:55:11 +0000 Subject: mir_core: added wine detection git-svn-id: http://svn.miranda-ng.org/main/trunk@17112 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/src/lists.cpp | 6 +++--- src/mir_core/src/winver.cpp | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/mir_core') 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; } -- cgit v1.2.3