]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/dird/winservice.h
kes Reapply my bat.conf install script in qt-console. I think I
[bacula/bacula] / bacula / src / win32 / dird / winservice.h
1 //  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
2 //
3 //  This file was part of the ups system.
4 //
5 //  The ups system is free software; you can redistribute it and/or modify
6 //  it under the terms of the GNU General Public License as published by
7 //  the Free Software Foundation; either version 2 of the License, or
8 //  (at your option) any later version.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program; if not, write to the Free Software
17 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
18 //  USA.
19 //
20 // If the source code for the ups system is not available from the place
21 // whence you received this file, check http://www.uk.research.att.com/vnc or contact
22 // the authors on ups@uk.research.att.com for information on obtaining it.
23 //
24 // This file has been adapted to the Win32 version of Bacula
25 // by Kern E. Sibbald.  Many thanks to ATT and James Weatherall,
26 // the original author, for providing an excellent template.
27 //
28 // Copyright (2000) Kern E. Sibbald
29 //
30
31
32 // winservice.cpp
33
34 // SERVICE-MODE CODE
35
36 // This class provides access to service-oriented routines, under both
37 // Windows NT and Windows 95.  Some routines only operate under one
38 // OS, others operate under any OS.
39
40 #if (!defined(_win_bacService))
41 #define _win_bacService
42
43 // The NT-specific code wrapper class
44 class bacService
45 {
46 public:
47    // SERVICE INSTALL & START FUNCTIONS
48
49    // Routine called by WinMain to cause Bacula to be installed
50    // as a service.
51    static int BaculaServiceMain();
52
53    // Routine to install the Apcupsd service on the local machine
54    static int InstallService(const char *pszCmdLine);
55
56    // Routine to remove the Apcupsd service from the local machine
57    static int RemoveService();
58
59    // SERVICE SUPPORT FUNCTIONS
60
61    // Routine to establish whether the current instance is running
62    // as a service or not
63    static BOOL RunningAsService();
64
65    // Routine to kill any other running copy of Apcupsd
66    static BOOL KillRunningCopy();
67 };
68
69 #endif