OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "remoting/host/win/elevated_controller_module.h" |
| 6 |
5 #include <atlbase.h> | 7 #include <atlbase.h> |
6 #include <atlcom.h> | 8 #include <atlcom.h> |
7 #include <atlctl.h> | 9 #include <atlctl.h> |
8 | 10 |
9 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
11 #include "remoting/base/breakpad.h" | 13 #include "remoting/base/breakpad.h" |
12 #include "remoting/host/logging.h" | 14 #include "remoting/host/logging.h" |
13 #include "remoting/host/usage_stats_consent.h" | 15 #include "remoting/host/usage_stats_consent.h" |
14 | |
15 // MIDL-generated declarations. | |
16 #include "remoting/host/win/elevated_controller.h" | 16 #include "remoting/host/win/elevated_controller.h" |
17 | 17 |
18 namespace remoting { | 18 namespace remoting { |
19 | 19 |
20 class ElevatedControllerModule | 20 class ElevatedControllerModule |
21 : public ATL::CAtlExeModuleT<ElevatedControllerModule> { | 21 : public ATL::CAtlExeModuleT<ElevatedControllerModule> { |
22 public: | 22 public: |
23 DECLARE_LIBID(LIBID_ChromotingElevatedControllerLib) | 23 DECLARE_LIBID(LIBID_ChromotingElevatedControllerLib) |
24 }; | 24 }; |
25 | 25 |
26 } // namespace remoting | 26 int RunElevatedController() { |
27 | |
28 | |
29 remoting::ElevatedControllerModule _AtlModule; | |
30 | |
31 int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int command) { | |
32 #ifdef OFFICIAL_BUILD | 27 #ifdef OFFICIAL_BUILD |
33 if (remoting::IsUsageStatsAllowed()) { | 28 if (IsUsageStatsAllowed()) { |
34 remoting::InitializeCrashReporting(); | 29 InitializeCrashReporting(); |
35 } | 30 } |
36 #endif // OFFICIAL_BUILD | 31 #endif // OFFICIAL_BUILD |
37 | 32 |
38 CommandLine::Init(0, NULL); | 33 CommandLine::Init(0, NULL); |
39 | 34 |
40 // Register and initialize common controls. | 35 // Register and initialize common controls. |
41 INITCOMMONCONTROLSEX info; | 36 INITCOMMONCONTROLSEX info; |
42 info.dwSize = sizeof(info); | 37 info.dwSize = sizeof(info); |
43 info.dwICC = ICC_STANDARD_CLASSES; | 38 info.dwICC = ICC_STANDARD_CLASSES; |
44 InitCommonControlsEx(&info); | 39 InitCommonControlsEx(&info); |
45 | 40 |
46 // This object instance is required by Chrome code (for example, | 41 // This object instance is required by Chrome code (for example, |
47 // FilePath, LazyInstance, MessageLoop). | 42 // FilePath, LazyInstance, MessageLoop). |
48 base::AtExitManager exit_manager; | 43 base::AtExitManager exit_manager; |
49 | 44 |
50 remoting::InitHostLogging(); | 45 InitHostLogging(); |
51 | 46 |
52 return _AtlModule.WinMain(command); | 47 ElevatedControllerModule module; |
| 48 return module.WinMain(SW_HIDE); |
53 } | 49 } |
| 50 |
| 51 } // namespace remoting |
OLD | NEW |