1c2c66affSColin Finck #ifndef _SC_PCH_ 2c2c66affSColin Finck #define _SC_PCH_ 3c2c66affSColin Finck 4c2c66affSColin Finck #include <stdarg.h> 5c2c66affSColin Finck 6c2c66affSColin Finck #define WIN32_NO_STATUS 7c2c66affSColin Finck #include <windef.h> 8c2c66affSColin Finck #include <winbase.h> 9c2c66affSColin Finck #include <winsvc.h> 10c2c66affSColin Finck #include <sddl.h> 11c2c66affSColin Finck #include <tchar.h> 12c2c66affSColin Finck 13c2c66affSColin Finck #include <ndk/rtlfuncs.h> 14c2c66affSColin Finck #include <ndk/setypes.h> 15c2c66affSColin Finck 16c2c66affSColin Finck 1746f96733SSerge Gautherie // Uncomment to enable debug messages on user interface. 1846f96733SSerge Gautherie // #define SCDBG 19c2c66affSColin Finck 20c2c66affSColin Finck typedef struct 21c2c66affSColin Finck { 22c2c66affSColin Finck LPCTSTR lpServiceName; 23c2c66affSColin Finck LPCTSTR lpDisplayName; 24c2c66affSColin Finck DWORD dwServiceType; 25c2c66affSColin Finck DWORD dwStartType; 26c2c66affSColin Finck DWORD dwErrorControl; 27c2c66affSColin Finck LPCTSTR lpBinaryPathName; 28c2c66affSColin Finck LPCTSTR lpLoadOrderGroup; 29c2c66affSColin Finck DWORD dwTagId; 30c2c66affSColin Finck LPCTSTR lpDependencies; 31c2c66affSColin Finck LPCTSTR lpServiceStartName; 32c2c66affSColin Finck LPCTSTR lpPassword; 33c2c66affSColin Finck 34c2c66affSColin Finck BOOL bTagId; 35c2c66affSColin Finck } SERVICE_CREATE_INFO, *LPSERVICE_CREATE_INFO; 36c2c66affSColin Finck 37c2c66affSColin Finck 38c2c66affSColin Finck /* control functions */ 39c2c66affSColin Finck BOOL Start(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, INT ArgCount); 40c2c66affSColin Finck BOOL Create(LPCTSTR *ServiceArgs, INT ArgCount); 41c2c66affSColin Finck BOOL Delete(LPCTSTR ServiceName); 42c2c66affSColin Finck BOOL Control(DWORD Control, LPCTSTR ServiceName, LPCTSTR *Args, INT ArgCount); 43c2c66affSColin Finck BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended); 44c2c66affSColin Finck 45c2c66affSColin Finck LPSERVICE_STATUS_PROCESS QueryService(LPCTSTR ServiceName); 46c2c66affSColin Finck BOOL SdShow(LPCTSTR ServiceName); 47c2c66affSColin Finck BOOL SdSet(LPCTSTR ServiceName, LPCTSTR SecurityDescriptor); 48c2c66affSColin Finck BOOL QueryConfig(LPCTSTR ServiceName); 49c2c66affSColin Finck BOOL SetConfig(LPCTSTR *ServiceArgs, INT ArgCount); 50c2c66affSColin Finck BOOL QueryDescription(LPCTSTR ServiceName); 51c2c66affSColin Finck BOOL SetDescription(LPCTSTR ServiceName, LPCTSTR Description); 52c2c66affSColin Finck BOOL QueryFailure(LPCTSTR ServiceName); 53c2c66affSColin Finck BOOL SetFailure(LPCTSTR *ServiceArgs, INT ArgCount); 54c2c66affSColin Finck BOOL GetDisplayName(LPCTSTR ServiceName); 55c2c66affSColin Finck BOOL GetKeyName(LPCTSTR ServiceName); 56c2c66affSColin Finck BOOL EnumDepend(LPCTSTR ServiceName); 57c2c66affSColin Finck 58c2c66affSColin Finck /* print and error functions */ 59*47281571SEric Kohl VOID PrintService(LPCTSTR ServiceName, LPCTSTR DisplayName, LPSERVICE_STATUS_PROCESS pStatus, BOOL bExtended); 60c2c66affSColin Finck VOID PrintServiceStatus(LPSERVICE_STATUS pStatus); 61c2c66affSColin Finck VOID ReportLastError(VOID); 62c2c66affSColin Finck 63c2c66affSColin Finck /* misc.c */ 64c2c66affSColin Finck BOOL 65c2c66affSColin Finck ParseCreateConfigArguments( 66c2c66affSColin Finck LPCTSTR *ServiceArgs, 67c2c66affSColin Finck INT ArgCount, 68c2c66affSColin Finck BOOL bChangeService, 69c2c66affSColin Finck OUT LPSERVICE_CREATE_INFO lpServiceInfo); 70c2c66affSColin Finck 71c2c66affSColin Finck BOOL 72c2c66affSColin Finck ParseFailureArguments( 73c2c66affSColin Finck LPCTSTR *ServiceArgs, 74c2c66affSColin Finck INT ArgCount, 75c2c66affSColin Finck OUT LPCTSTR *ppServiceName, 76c2c66affSColin Finck OUT LPSERVICE_FAILURE_ACTIONS pFailureActions); 77c2c66affSColin Finck 78c2c66affSColin Finck /* usage functions */ 79c2c66affSColin Finck VOID MainUsage(VOID); 80c2c66affSColin Finck VOID StartUsage(VOID); 81c2c66affSColin Finck VOID PauseUsage(VOID); 82c2c66affSColin Finck VOID InterrogateUsage(VOID); 83c2c66affSColin Finck VOID ContinueUsage(VOID); 84c2c66affSColin Finck VOID StopUsage(VOID); 85c2c66affSColin Finck VOID DeleteUsage(VOID); 86c2c66affSColin Finck VOID CreateUsage(VOID); 87c2c66affSColin Finck VOID ControlUsage(VOID); 88c2c66affSColin Finck VOID SdShowUsage(VOID); 89c2c66affSColin Finck VOID SdSetUsage(VOID); 90c2c66affSColin Finck VOID QueryConfigUsage(VOID); 91c2c66affSColin Finck VOID QueryDescriptionUsage(VOID); 92c2c66affSColin Finck VOID QueryFailureUsage(VOID); 93c2c66affSColin Finck VOID SetDescriptionUsage(VOID); 94c2c66affSColin Finck VOID SetConfigUsage(VOID); 95c2c66affSColin Finck VOID SetFailureUsage(VOID); 96c2c66affSColin Finck VOID GetDisplayNameUsage(VOID); 97c2c66affSColin Finck VOID GetKeyNameUsage(VOID); 98c2c66affSColin Finck VOID EnumDependUsage(VOID); 99c2c66affSColin Finck 100c2c66affSColin Finck #endif /* _SC_PCH_ */ 101