00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __UT_NTServiceManager_h__
00019 #define __UT_NTServiceManager_h__
00020
00021 #include <windows.h>
00022
00023 #include "UT_API.h"
00024
00025 #define HSERVER_SERVICE "HoudiniServer"
00026 #define SESINETD_SERVICE "HoudiniLicenseServer"
00027 #define OLD_HSERVER_SERVICE "HServer"
00028 #define OLD_SESINETD_SERVICE "SESINetD"
00029
00030 class UT_API UT_NTServiceManager
00031 {
00032 public:
00033 UT_NTServiceManager(const char *machine = 0);
00034 virtual ~UT_NTServiceManager();
00035
00036 bool isOpen() const;
00037
00038 bool startService(const char *name) const;
00039 bool stopService(const char *name) const;
00040 bool installService(const char *name, const char *display,
00041 const char *path) const;
00042 bool uninstallService(const char *name) const;
00043 bool isServiceInstalled(const char *name) const;
00044 bool isServiceRunning(const char *name) const;
00045
00046 private:
00047 bool waitForStatus(SC_HANDLE service,
00048 unsigned long desiredState,
00049 int timeout) const;
00050
00051 SC_HANDLE myManager;
00052 };
00053
00054 #endif // __UT_NTServiceManager_h__