diff options
author | McCabe Maxsted | 2010-08-15 17:12:38 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-08-26 11:21:42 -0700 |
commit | 285c11b7a6326841a164691559a23c6ec1fff093 (patch) | |
tree | c568a3231d25ce1feb2735f871d56ed8b31f3af3 | |
parent | Added imprudence.url to viewer_manifest.py (diff) | |
download | meta-impy-285c11b7a6326841a164691559a23c6ec1fff093.zip meta-impy-285c11b7a6326841a164691559a23c6ec1fff093.tar.gz meta-impy-285c11b7a6326841a164691559a23c6ec1fff093.tar.bz2 meta-impy-285c11b7a6326841a164691559a23c6ec1fff093.tar.xz |
Applied patch for #424: fix proper detection of Windows 7, backport from Snowglobe 2.0 by Ansariel Hiller
-rw-r--r-- | linden/indra/llcommon/llsys.cpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/linden/indra/llcommon/llsys.cpp b/linden/indra/llcommon/llsys.cpp index 2e93b2a..a56ac47 100644 --- a/linden/indra/llcommon/llsys.cpp +++ b/linden/indra/llcommon/llsys.cpp | |||
@@ -122,14 +122,50 @@ LLOSInfo::LLOSInfo() : | |||
122 | else | 122 | else |
123 | mOSStringSimple = "Microsoft Windows Server 2003 "; | 123 | mOSStringSimple = "Microsoft Windows Server 2003 "; |
124 | } | 124 | } |
125 | else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) | 125 | else if(osvi.dwMajorVersion == 6 && osvi.dwMinorVersion <= 1) |
126 | { | 126 | { |
127 | if(osvi.wProductType == VER_NT_WORKSTATION) | 127 | if(osvi.dwMinorVersion == 0) |
128 | { | ||
128 | mOSStringSimple = "Microsoft Windows Vista "; | 129 | mOSStringSimple = "Microsoft Windows Vista "; |
129 | else mOSStringSimple = "Microsoft Windows Vista Server "; | 130 | } |
131 | else if(osvi.dwMinorVersion == 1) | ||
132 | { | ||
133 | mOSStringSimple = "Microsoft Windows 7 "; | ||
134 | } | ||
135 | |||
136 | if(osvi.wProductType != VER_NT_WORKSTATION) | ||
137 | { | ||
138 | mOSStringSimple += "Server "; | ||
139 | } | ||
140 | |||
141 | ///get native system info if available.. | ||
142 | typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); ///function pointer for loading GetNativeSystemInfo | ||
143 | SYSTEM_INFO si; //System Info object file contains architecture info | ||
144 | PGNSI pGNSI; //pointer object | ||
145 | ZeroMemory(&si, sizeof(SYSTEM_INFO)); //zero out the memory in information | ||
146 | pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); //load kernel32 get function | ||
147 | if(NULL != pGNSI) //check if it has failed | ||
148 | pGNSI(&si); //success | ||
149 | else | ||
150 | GetSystemInfo(&si); //if it fails get regular system info | ||
151 | //(Warning: If GetSystemInfo it may result in incorrect information in a WOW64 machine, if the kernel fails to load) | ||
152 | |||
153 | //msdn microsoft finds 32 bit and 64 bit flavors this way.. | ||
154 | //http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx (example code that contains quite a few more flavors | ||
155 | //of windows than this code does (in case it is needed for the future) | ||
156 | if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 ) //check for 64 bit | ||
157 | { | ||
158 | mOSStringSimple += "64-bit "; | ||
159 | } | ||
160 | else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL ) | ||
161 | { | ||
162 | mOSStringSimple += "32-bit "; | ||
163 | } | ||
130 | } | 164 | } |
131 | else // Use the registry on early versions of Windows NT. | 165 | else // Use the registry on early versions of Windows NT. |
132 | { | 166 | { |
167 | mOSStringSimple = "Microsoft Windows (unrecognized) "; | ||
168 | |||
133 | HKEY hKey; | 169 | HKEY hKey; |
134 | WCHAR szProductType[80]; | 170 | WCHAR szProductType[80]; |
135 | DWORD dwBufLen; | 171 | DWORD dwBufLen; |