Files
Work/service/ServiceManager.hpp
2024-08-07 09:16:27 -04:00

27 lines
783 B
C++

#ifndef _TRANSACTIONSERVER_SERVICEMANAGER_H_
#define _TRANSACTIONSERVER_SERVICEMANAGER_H_
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _COMMON_WINSVC_HPP_
#include <common/winsvc.hpp>
#endif
class ServiceManager
{
public:
ServiceManager();
virtual ~ServiceManager();
bool createService(const String &strServiceName,const String &strDisplayName,const String &strBinPath,const String &strAccountName=String(),const String &strPassword=String());
bool deleteService(const String &strServiceName);
bool isOkay(void)const;
private:
void createEventLogEntry(const String &strServiceName,const String &strBinPath);
void removeEventLogEntry(const String &strServiceName);
bool open(void);
void close(void);
SC_HANDLE mhServiceControl;
};
#endif