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