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

Unified Diff: chrome/tools/disable_outdated_build_detector/disable_outdated_build_detector_main.cc

Issue 2255783003: Make the outdated build detector disabler load and run on XP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: suppress wstring warnings Created 4 years, 4 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
Index: chrome/tools/disable_outdated_build_detector/disable_outdated_build_detector_main.cc
diff --git a/chrome/tools/disable_outdated_build_detector/disable_outdated_build_detector_main.cc b/chrome/tools/disable_outdated_build_detector/disable_outdated_build_detector_main.cc
index aa1253ae8cac7456302497bf469a55e61f1485f2..387343cd8e0fa604367f691e81128795c601ede3 100644
--- a/chrome/tools/disable_outdated_build_detector/disable_outdated_build_detector_main.cc
+++ b/chrome/tools/disable_outdated_build_detector/disable_outdated_build_detector_main.cc
@@ -7,32 +7,29 @@
// disable_outdated_build_detector.h for more information.
#include <windows.h>
-#include <stdint.h>
-#include "base/at_exit.h"
-#include "base/command_line.h"
-#include "base/logging.h"
-#include "base/win/windows_version.h"
#include "chrome/tools/disable_outdated_build_detector/disable_outdated_build_detector.h"
+namespace {
+
+bool IsVistaOrOlder() {
+ OSVERSIONINFO version_info = {sizeof(version_info)};
+ return ::GetVersionEx(&version_info) && (version_info.dwMajorVersion < 6 ||
+ (version_info.dwMajorVersion == 6 &&
+ version_info.dwMinorVersion == 0));
+}
+
+} // namespace
+
int WINAPI wWinMain(HINSTANCE /* instance */,
HINSTANCE /* unused */,
- wchar_t* /* command_line */,
+ wchar_t* command_line,
int /* command_show */) {
- if (base::win::GetVersion() >= base::win::VERSION_WIN7)
+ if (!IsVistaOrOlder())
return static_cast<int>(ExitCode::UNSUPPORTED_OS);
- base::AtExitManager at_exit_manager;
- base::CommandLine::Init(0, nullptr);
-
- // Don't generate any log files.
- logging::LoggingSettings logging_settings;
- logging_settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
- logging::InitLogging(logging_settings);
-
// For reasons, wWinMain returns an int rather than a DWORD. This value
// eventually makes its way to ExitProcess, which indeed takes an unsigned
// int.
- return static_cast<int>(
- DisableOutdatedBuildDetector(*base::CommandLine::ForCurrentProcess()));
+ return static_cast<int>(DisableOutdatedBuildDetector(command_line));
}

Powered by Google App Engine
This is Rietveld 408576698