15#define SERVICE_ACCESS (SERVICE_QUERY_STATUS | SERVICE_START | SERVICE_STOP | DELETE)
27 OUT SC_HANDLE *ServiceHandle);
96 OUT SC_HANDLE *ServiceHandle)
123 return "START_PENDING";
125 return "STOP_PENDING";
129 return "CONTINUE_PENDING";
131 return "PAUSE_PENDING";
135 ok(
FALSE,
"Unknown service state = %lu\n", ServiceState);
157 IN SC_HANDLE ServiceHandle,
167 assert(ExpectedServiceState);
187 ok(
FALSE,
"Service = %ls, state = %lu %s (!= %lu %s), waitHint = %lu, checkPoint = %lu\n",
195 trace(
"Service = %ls, state = %lu %s\n",
219 IN OUT SC_HANDLE *ServiceHandle)
266 OUT SC_HANDLE *ServiceHandle,
285 if (!RestartIfRunning)
317 IN OUT SC_HANDLE *ServiceHandle)
358 IN OUT SC_HANDLE *ServiceHandle)
393 IN OUT SC_HANDLE *ServiceHandle)
402 *ServiceHandle =
NULL;
419 OUT SC_HANDLE *ServiceHandle)
static WCHAR ServiceName[]
static SERVICE_STATUS ServiceStatus
static void cleanup(void)
DWORD WINAPI GetTickCount(VOID)
static LARGE_INTEGER StartTime
#define error_value_goto(Error, value, label)
#define error_goto(Error, label)
DWORD KmtServiceCleanup(BOOLEAN IgnoreErrors)
DWORD KmtServiceInit(VOID)
DWORD KmtCloseService(IN OUT SC_HANDLE *ServiceHandle)
static PCSTR KmtGetServiceStateAsString(IN DWORD ServiceState)
static SC_HANDLE ScmHandle
DWORD KmtpCreateService(IN PCWSTR ServiceName, IN PCWSTR ServicePath, IN PCWSTR DisplayName OPTIONAL, IN DWORD ServiceType, OUT SC_HANDLE *ServiceHandle)
DWORD KmtDeleteService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
static DWORD KmtEnsureServiceState(IN PCWSTR ServiceName OPTIONAL, IN SC_HANDLE ServiceHandle, IN DWORD ExpectedServiceState)
DWORD KmtCreateService(IN PCWSTR ServiceName, IN PCWSTR ServicePath, IN PCWSTR DisplayName OPTIONAL, OUT SC_HANDLE *ServiceHandle)
DWORD KmtStopService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
DWORD KmtStartService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
DWORD KmtCreateAndStartService(IN PCWSTR ServiceName, IN PCWSTR ServicePath, IN PCWSTR DisplayName OPTIONAL, OUT SC_HANDLE *ServiceHandle, IN BOOLEAN RestartIfRunning)
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI DeleteService(SC_HANDLE hService)
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
PULONG MinorVersion OPTIONAL
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define INVALID_FILE_ATTRIBUTES
#define GetFileAttributes
#define GetModuleFileName
#define ERROR_SERVICE_ALREADY_RUNNING
#define ERROR_SERVICE_EXISTS
#define SC_MANAGER_CREATE_SERVICE
#define SERVICE_STOP_PENDING
#define SERVICE_START_PENDING
#define SERVICE_CONTROL_STOP
#define SERVICE_PAUSE_PENDING
#define SERVICE_CONTINUE_PENDING
#define SERVICE_DEMAND_START
#define SERVICE_KERNEL_DRIVER
#define SERVICE_ERROR_NORMAL