summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2012-08-24 17:48:39 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2012-08-24 17:48:39 +0000
commit0318ff1ecdc49088cbc15bc1aa3b6eaa06c16efc (patch)
tree7753ca7b974a322ab574953601639a47285e276e
parent63c51fd9c0fd1068c600e1486be8f99f0f163371 (diff)
more fixes for Windows 8 detection
git-svn-id: http://svn.miranda-ng.org/main/trunk@1529 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/JabberG/jabber_iq_handlers.cpp37
1 files changed, 15 insertions, 22 deletions
diff --git a/protocols/JabberG/jabber_iq_handlers.cpp b/protocols/JabberG/jabber_iq_handlers.cpp
index 7ccbd31e01..c0cdf8b332 100644
--- a/protocols/JabberG/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/jabber_iq_handlers.cpp
@@ -78,7 +78,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
SYSTEM_INFO si;
PGNSI pGNSI;
PGPI pGPI;
- BOOL bOsVersionInfoEx;
+
DWORD dwType;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
@@ -86,25 +86,27 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- if ( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)))
- return FALSE;
+ BOOL bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi);
+ if ( !bOsVersionInfoEx )
+ {
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ if (!GetVersionEx((OSVERSIONINFO*)&osvi))
+ return;
+ }
// Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.
-
- pGNSI = (PGNSI) GetProcAddress(
- GetModuleHandle(TEXT("kernel32.dll")),
- "GetNativeSystemInfo");
+ HMODULE hKernel = GetModuleHandle(TEXT("kernel32.dll"));
+ pGNSI = (PGNSI) GetProcAddress(hKernel,"GetNativeSystemInfo");
if(NULL != pGNSI)
pGNSI(&si);
else GetSystemInfo(&si);
- if ( VER_PLATFORM_WIN32_NT==osvi.dwPlatformId &&
- osvi.dwMajorVersion > 4 )
+ //Some code from Crash Dumper Plugin :-)
+ if ( VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion > 4 )
{
StringCchCopy(pszOS, BUFSIZE, TEXT("Microsoft "));
// Test for the specific product.
-
if (osvi.dwMajorVersion == 6)
{
switch (osvi.dwMinorVersion)
@@ -129,19 +131,10 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
else
StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2012 "));
break;
- }
-
- if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 )
- {
- if ( osvi.wProductType == VER_NT_WORKSTATION )
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Vista "));
- else StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2008 " ));
-
- pGPI = (PGPI) GetProcAddress(
- GetModuleHandle(TEXT("kernel32.dll")),
- "GetProductInfo");
+ }
- pGPI( 6, 0, 0, 0, &dwType);
+ pGPI = (PGPI) GetProcAddress(hKernel, "GetProductInfo");
+ if(pGPI != NULL) pGPI( 6, 0, 0, 0, &dwType);
switch( dwType )
{