| 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 #ifndef REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ | 5 #ifndef REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ |
| 6 #define REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ | 6 #define REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcom.h> | 9 #include <atlcom.h> |
| 10 #include <atlctl.h> | 10 #include <atlctl.h> |
| 11 | 11 |
| 12 #include "remoting/base/scoped_sc_handle_win.h" |
| 13 |
| 12 // MIDL-generated declarations. | 14 // MIDL-generated declarations. |
| 13 #include <elevated_controller.h> | 15 #include <elevated_controller.h> |
| 14 | 16 |
| 15 namespace remoting { | 17 namespace remoting { |
| 16 | 18 |
| 17 class ATL_NO_VTABLE ElevatedControllerWin | 19 class ATL_NO_VTABLE ElevatedControllerWin |
| 18 : public ATL::CComObjectRootEx<ATL::CComSingleThreadModel>, | 20 : public ATL::CComObjectRootEx<ATL::CComSingleThreadModel>, |
| 19 public ATL::CComCoClass<ElevatedControllerWin, &CLSID_ElevatedController>, | 21 public ATL::CComCoClass<ElevatedControllerWin, &CLSID_ElevatedController>, |
| 20 public ATL::IDispatchImpl<IDaemonControl, &IID_IDaemonControl, | 22 public ATL::IDispatchImpl<IDaemonControl, &IID_IDaemonControl, |
| 21 &LIBID_ChromotingElevatedControllerLib, 1, 0>, | 23 &LIBID_ChromotingElevatedControllerLib, 1, 0> { |
| 22 public ATL::IConnectionPointContainerImpl<ElevatedControllerWin>, | |
| 23 public ATL::IConnectionPointImpl<ElevatedControllerWin, | |
| 24 &IID_IDaemonEvents> { | |
| 25 public: | 24 public: |
| 26 ElevatedControllerWin(); | 25 ElevatedControllerWin(); |
| 27 | 26 |
| 28 HRESULT FinalConstruct(); | 27 HRESULT FinalConstruct(); |
| 29 void FinalRelease(); | 28 void FinalRelease(); |
| 30 | 29 |
| 31 // IDaemonControl implementation. | 30 // IDaemonControl implementation. |
| 32 STDMETHOD(get_State)(DaemonState* state_out); | 31 STDMETHOD(GetConfig)(BSTR* config_out); |
| 33 STDMETHOD(ReadConfig)(BSTR* config_out); | 32 STDMETHOD(SetConfig)(BSTR config); |
| 34 STDMETHOD(WriteConfig)(BSTR config); | |
| 35 STDMETHOD(StartDaemon)(); | 33 STDMETHOD(StartDaemon)(); |
| 36 STDMETHOD(StopDaemon)(); | 34 STDMETHOD(StopDaemon)(); |
| 37 | 35 |
| 38 // Fires IDaemonEvents::OnStateChange notification. | 36 DECLARE_NO_REGISTRY() |
| 39 HRESULT FireOnStateChange(DaemonState state); | |
| 40 | 37 |
| 41 DECLARE_NO_REGISTRY() | 38 private: |
| 39 HRESULT OpenService(ScopedScHandle* service_out); |
| 42 | 40 |
| 43 BEGIN_COM_MAP(ElevatedControllerWin) | 41 BEGIN_COM_MAP(ElevatedControllerWin) |
| 44 COM_INTERFACE_ENTRY(IDaemonControl) | 42 COM_INTERFACE_ENTRY(IDaemonControl) |
| 45 COM_INTERFACE_ENTRY(IDispatch) | 43 COM_INTERFACE_ENTRY(IDispatch) |
| 46 COM_INTERFACE_ENTRY(IConnectionPointContainer) | |
| 47 END_COM_MAP() | 44 END_COM_MAP() |
| 48 | 45 |
| 49 BEGIN_CONNECTION_POINT_MAP(ElevatedControllerWin) | |
| 50 CONNECTION_POINT_ENTRY(IID_IDaemonEvents) | |
| 51 END_CONNECTION_POINT_MAP() | |
| 52 | |
| 53 DECLARE_PROTECT_FINAL_CONSTRUCT() | 46 DECLARE_PROTECT_FINAL_CONSTRUCT() |
| 54 }; | 47 }; |
| 55 | 48 |
| 56 OBJECT_ENTRY_AUTO(CLSID_ElevatedController, ElevatedControllerWin) | 49 OBJECT_ENTRY_AUTO(CLSID_ElevatedController, ElevatedControllerWin) |
| 57 | 50 |
| 58 } // namespace remoting | 51 } // namespace remoting |
| 59 | 52 |
| 60 #endif // REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ | 53 #endif // REMOTING_HOST_ELEVATED_CONTROLLER_WIN_H_ |
| OLD | NEW |