Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1849)

Unified Diff: base/win_util.cc

Issue 21274: Add code to be able to detect windows7 in GetWinVersion. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/win_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win_util.cc
===================================================================
--- base/win_util.cc (revision 9582)
+++ base/win_util.cc (working copy)
@@ -39,9 +39,9 @@
static bool checked_version = false;
static WinVersion win_version = WINVERSION_PRE_2000;
if (!checked_version) {
- OSVERSIONINFO version_info;
+ OSVERSIONINFOEX version_info;
version_info.dwOSVersionInfoSize = sizeof version_info;
- GetVersionEx(&version_info);
+ GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&version_info));
if (version_info.dwMajorVersion == 5) {
switch (version_info.dwMinorVersion) {
case 0:
@@ -55,8 +55,19 @@
win_version = WINVERSION_SERVER_2003;
break;
}
- } else if (version_info.dwMajorVersion >= 6) {
- win_version = WINVERSION_VISTA;
+ } else if (version_info.dwMajorVersion == 6) {
+ if (version_info.wProductType != VER_NT_WORKSTATION) {
+ // 2008 is 6.0, and 2008 R2 is 6.1.
+ win_version = WINVERSION_2008;
+ } else {
+ if (version_info.dwMinorVersion == 0) {
+ win_version = WINVERSION_VISTA;
+ } else {
+ win_version = WINVERSION_WIN7;
+ }
+ }
+ } else if (version_info.dwMajorVersion > 6) {
+ win_version = WINVERSION_WIN7;
}
checked_version = true;
}
« no previous file with comments | « base/win_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698