Index: remoting/host/elevated_controller_module_win.cc |
diff --git a/remoting/host/elevated_controller_module_win.cc b/remoting/host/elevated_controller_module_win.cc |
index 16751075a9994927f58639bbe0e1033cd788c135..ba193d12c70c1baa7e0cb188bf27b2f97614cb4a 100644 |
--- a/remoting/host/elevated_controller_module_win.cc |
+++ b/remoting/host/elevated_controller_module_win.cc |
@@ -6,6 +6,12 @@ |
#include <atlcom.h> |
#include <atlctl.h> |
+#include "base/at_exit.h" |
+#include "base/command_line.h" |
+#include "base/file_path.h" |
+#include "base/logging.h" |
+#include "remoting/host/branding.h" |
+ |
// MIDL-generated declarations. |
#include <elevated_controller.h> |
@@ -23,5 +29,20 @@ class ElevatedControllerModuleWin |
remoting::ElevatedControllerModuleWin _AtlModule; |
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int command) { |
+ CommandLine::Init(0, NULL); |
+ |
+ // This object instance is required by Chrome code (for example, |
+ // FilePath, LazyInstance, MessageLoop). |
+ base::AtExitManager exit_manager; |
+ |
+ // Write logs to the application profile directory. |
+ FilePath debug_log = remoting::GetConfigDir(). |
+ Append(FILE_PATH_LITERAL("debug.log")); |
+ InitLogging(debug_log.value().c_str(), |
+ logging::LOG_ONLY_TO_FILE, |
+ logging::DONT_LOCK_LOG_FILE, |
+ logging::APPEND_TO_OLD_LOG_FILE, |
+ logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
+ |
return _AtlModule.WinMain(command); |
} |