2014-02-03 16:13:37 +00:00
|
|
|
#ifndef _SC_PCH_
|
|
|
|
#define _SC_PCH_
|
|
|
|
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <stdarg.h>
|
2014-01-07 17:10:31 +00:00
|
|
|
|
2016-07-03 08:56:43 +00:00
|
|
|
#define WIN32_NO_STATUS
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <winsvc.h>
|
2016-06-07 21:51:37 +00:00
|
|
|
#include <sddl.h>
|
2006-02-16 23:18:11 +00:00
|
|
|
#include <tchar.h>
|
|
|
|
|
2016-07-03 08:56:43 +00:00
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
#include <ndk/setypes.h>
|
|
|
|
|
|
|
|
|
2018-02-15 13:58:17 +00:00
|
|
|
// Uncomment to enable debug messages on user interface.
|
|
|
|
// #define SCDBG
|
2006-02-16 23:18:11 +00:00
|
|
|
|
2016-06-13 19:43:02 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
LPCTSTR lpServiceName;
|
|
|
|
LPCTSTR lpDisplayName;
|
|
|
|
DWORD dwServiceType;
|
|
|
|
DWORD dwStartType;
|
|
|
|
DWORD dwErrorControl;
|
|
|
|
LPCTSTR lpBinaryPathName;
|
|
|
|
LPCTSTR lpLoadOrderGroup;
|
|
|
|
DWORD dwTagId;
|
|
|
|
LPCTSTR lpDependencies;
|
|
|
|
LPCTSTR lpServiceStartName;
|
|
|
|
LPCTSTR lpPassword;
|
|
|
|
|
|
|
|
BOOL bTagId;
|
|
|
|
} SERVICE_CREATE_INFO, *LPSERVICE_CREATE_INFO;
|
|
|
|
|
|
|
|
|
2006-02-16 23:18:11 +00:00
|
|
|
/* control functions */
|
|
|
|
BOOL Start(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, INT ArgCount);
|
2010-09-18 08:41:06 +00:00
|
|
|
BOOL Create(LPCTSTR *ServiceArgs, INT ArgCount);
|
2006-02-16 23:18:11 +00:00
|
|
|
BOOL Delete(LPCTSTR ServiceName);
|
2006-08-31 17:59:02 +00:00
|
|
|
BOOL Control(DWORD Control, LPCTSTR ServiceName, LPCTSTR *Args, INT ArgCount);
|
2006-09-01 16:55:36 +00:00
|
|
|
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended);
|
|
|
|
|
|
|
|
LPSERVICE_STATUS_PROCESS QueryService(LPCTSTR ServiceName);
|
2016-06-07 21:51:37 +00:00
|
|
|
BOOL SdShow(LPCTSTR ServiceName);
|
2016-06-11 15:01:01 +00:00
|
|
|
BOOL SdSet(LPCTSTR ServiceName, LPCTSTR SecurityDescriptor);
|
2016-06-11 21:24:40 +00:00
|
|
|
BOOL QueryConfig(LPCTSTR ServiceName);
|
2016-06-13 19:43:02 +00:00
|
|
|
BOOL SetConfig(LPCTSTR *ServiceArgs, INT ArgCount);
|
2016-06-11 21:24:40 +00:00
|
|
|
BOOL QueryDescription(LPCTSTR ServiceName);
|
2016-06-12 19:18:15 +00:00
|
|
|
BOOL SetDescription(LPCTSTR ServiceName, LPCTSTR Description);
|
2016-06-11 21:24:40 +00:00
|
|
|
BOOL QueryFailure(LPCTSTR ServiceName);
|
2016-06-14 20:34:21 +00:00
|
|
|
BOOL SetFailure(LPCTSTR *ServiceArgs, INT ArgCount);
|
2016-06-16 19:47:50 +00:00
|
|
|
BOOL GetDisplayName(LPCTSTR ServiceName);
|
2016-06-16 21:18:59 +00:00
|
|
|
BOOL GetKeyName(LPCTSTR ServiceName);
|
2016-06-18 11:18:53 +00:00
|
|
|
BOOL EnumDepend(LPCTSTR ServiceName);
|
2006-02-16 23:18:11 +00:00
|
|
|
|
|
|
|
/* print and error functions */
|
2006-09-01 16:55:36 +00:00
|
|
|
VOID PrintService(LPCTSTR ServiceName, LPSERVICE_STATUS_PROCESS pStatus, BOOL bExtended);
|
2016-06-18 11:18:53 +00:00
|
|
|
VOID PrintServiceStatus(LPSERVICE_STATUS pStatus);
|
2006-08-31 17:59:02 +00:00
|
|
|
VOID ReportLastError(VOID);
|
2006-02-16 23:18:11 +00:00
|
|
|
|
2016-06-13 19:43:02 +00:00
|
|
|
/* misc.c */
|
|
|
|
BOOL
|
|
|
|
ParseCreateConfigArguments(
|
|
|
|
LPCTSTR *ServiceArgs,
|
|
|
|
INT ArgCount,
|
|
|
|
BOOL bChangeService,
|
|
|
|
OUT LPSERVICE_CREATE_INFO lpServiceInfo);
|
|
|
|
|
2016-06-14 20:34:21 +00:00
|
|
|
BOOL
|
|
|
|
ParseFailureArguments(
|
|
|
|
LPCTSTR *ServiceArgs,
|
|
|
|
INT ArgCount,
|
|
|
|
OUT LPCTSTR *ppServiceName,
|
|
|
|
OUT LPSERVICE_FAILURE_ACTIONS pFailureActions);
|
|
|
|
|
2006-02-16 23:18:11 +00:00
|
|
|
/* usage functions */
|
2006-08-31 17:59:02 +00:00
|
|
|
VOID MainUsage(VOID);
|
|
|
|
VOID StartUsage(VOID);
|
|
|
|
VOID PauseUsage(VOID);
|
|
|
|
VOID InterrogateUsage(VOID);
|
|
|
|
VOID ContinueUsage(VOID);
|
|
|
|
VOID StopUsage(VOID);
|
|
|
|
VOID DeleteUsage(VOID);
|
|
|
|
VOID CreateUsage(VOID);
|
2010-09-18 08:41:06 +00:00
|
|
|
VOID ControlUsage(VOID);
|
2016-06-07 21:51:37 +00:00
|
|
|
VOID SdShowUsage(VOID);
|
2016-06-11 15:01:01 +00:00
|
|
|
VOID SdSetUsage(VOID);
|
2016-06-11 21:24:40 +00:00
|
|
|
VOID QueryConfigUsage(VOID);
|
|
|
|
VOID QueryDescriptionUsage(VOID);
|
|
|
|
VOID QueryFailureUsage(VOID);
|
2016-06-12 19:18:15 +00:00
|
|
|
VOID SetDescriptionUsage(VOID);
|
2016-06-13 19:43:02 +00:00
|
|
|
VOID SetConfigUsage(VOID);
|
2016-06-14 20:34:21 +00:00
|
|
|
VOID SetFailureUsage(VOID);
|
2016-06-16 19:47:50 +00:00
|
|
|
VOID GetDisplayNameUsage(VOID);
|
2016-06-16 21:18:59 +00:00
|
|
|
VOID GetKeyNameUsage(VOID);
|
2016-06-18 11:18:53 +00:00
|
|
|
VOID EnumDependUsage(VOID);
|
2014-02-03 16:13:37 +00:00
|
|
|
|
|
|
|
#endif /* _SC_PCH_ */
|