101{
103
104 SC_HANDLE hScm =
NULL;
105 SC_HANDLE hSvc =
NULL;
107
109 DWORD dwRequiredSize = 0;
112 DWORD dwOldStartType = 0;
113
114
118 if (!hScm)
119 {
120 skip(
"No service control manager; cannot proceed with LockUnlockServiceDatabaseWithServiceStart test\n");
122 }
124
125
128 ok(hSvc !=
NULL,
"hSvc = 0x%p, expected non-null, error=0x%08lx\n", hSvc,
GetLastError());
129 if (!hSvc)
130 {
131 skip(
"Cannot open a handle to service %S; cannot proceed with LockUnlockServiceDatabaseWithServiceStart test\n",
TESTING_SERVICE);
133 }
135
136
139 ok(hLock !=
NULL,
"hLock = 0x%p, expected non-zero, error=0x%08lx\n", hLock,
GetLastError());
140 if (!hLock)
141 {
142 skip(
"Cannot lock the services database; cannot proceed with LockUnlockServiceDatabaseWithServiceStart test\n");
144 }
146
147
154 {
166 }
169 if (bWasRunning)
170 {
173 }
174
175
178 ok(bError ==
FALSE,
"bError = %u, expected FALSE\n", bError);
181
182
185
186
189 ok(bError ==
TRUE,
"bError = %u, expected TRUE\n", bError);
191
192
195 ok(bError ==
TRUE,
"bError = %u, expected TRUE\n", bError);
198
199
202
203
204 if (bWasRunning)
205 {
207 }
208
210 {
222 }
223
224
226 if (hSvc)
228
229 if (hScm)
231
232 return;
233}
#define HeapFree(x, y, z)
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI QueryServiceConfigW(SC_HANDLE hService, LPQUERY_SERVICE_CONFIGW lpServiceConfig, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
BOOL WINAPI ChangeServiceConfigW(SC_HANDLE hService, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCWSTR lpBinaryPathName, LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCWSTR lpDependencies, LPCWSTR lpServiceStartName, LPCWSTR lpPassword, LPCWSTR lpDisplayName)
BOOL WINAPI StartServiceW(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define ERROR_SERVICE_DATABASE_LOCKED
#define SERVICE_QUERY_STATUS
#define SERVICE_NO_CHANGE
#define SERVICE_CHANGE_CONFIG
#define SERVICE_CONTROL_STOP
#define SERVICE_QUERY_CONFIG
#define SERVICE_DEMAND_START