summaryrefslogtreecommitdiffstats
path: root/remoting/host/remoting_host_service_win.h
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/host/remoting_host_service_win.h')
-rw-r--r--remoting/host/remoting_host_service_win.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/remoting/host/remoting_host_service_win.h b/remoting/host/remoting_host_service_win.h
new file mode 100644
index 0000000..6cfd55e
--- /dev/null
+++ b/remoting/host/remoting_host_service_win.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_REMOTING_HOST_SERVICE_WIN_H_
+#define REMOTING_HOST_REMOTING_HOST_SERVICE_WIN_H_
+
+#include <windows.h>
+
+class CommandLine;
+
+namespace remoting {
+
+class HostService {
+ public:
+ HostService();
+ ~HostService();
+
+ // This function parses the command line and selects the action routine.
+ bool InitWithCommandLine(const CommandLine* command_line);
+
+ // Invoke the choosen action routine.
+ int Run();
+
+ private:
+ // This routine registers the service with the service control manager.
+ int Install();
+
+ static VOID CALLBACK OnServiceStopped(PVOID context);
+
+ // This routine uninstalls the service previously regerested by Install().
+ int Remove();
+
+ int RunAsService();
+ int RunInConsole();
+
+ int (HostService::*run_routine_)();
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_REMOTING_HOST_SERVICE_WIN_H_