1 | 'winsrv.ab |
---|
2 | |
---|
3 | #ifdef UNICODE |
---|
4 | Const _FuncName_ChangeServiceConfig = "ChangeServiceConfigW" |
---|
5 | Const _FuncName_ChangeServiceConfig2 = "ChangeServiceConfig2W" |
---|
6 | Const _FuncName_CreateService = "CreateServiceW" |
---|
7 | Const _FuncName_EnumDependentServices = "EnumDependentServicesW" |
---|
8 | Const _FuncName_EnumServicesStatus = "EnumServicesStatusW" |
---|
9 | Const _FuncName_EnumServicesStatusEx = "EnumServicesStatusExW" |
---|
10 | Const _FuncName_GetServiceKeyName = "GetServiceKeyNameW" |
---|
11 | Const _FuncName_GetServiceDisplayName = "GetServiceDisplayNameW" |
---|
12 | Const _FuncName_OpenSCManager = "OpenSCManagerW" |
---|
13 | Const _FuncName_OpenService = "OpenServiceW" |
---|
14 | Const _FuncName_QueryServiceConfig = "QueryServiceConfigW" |
---|
15 | Const _FuncName_QueryServiceConfig2 = "QueryServiceConfig2W" |
---|
16 | Const _FuncName_QueryServiceLockStatus = "QueryServiceLockStatusW" |
---|
17 | Const _FuncName_RegisterServiceCtrlHandler = "RegisterServiceCtrlHandlerW" |
---|
18 | Const _FuncName_RegisterServiceCtrlHandlerEx = "RegisterServiceCtrlHandlerExW" |
---|
19 | Const _FuncName_StartServiceCtrlDispatcher = "StartServiceCtrlDispatcherW" |
---|
20 | Const _FuncName_StartService = "StartServiceW" |
---|
21 | Const _FuncName_NotifyServiceStatusChange = "NotifyServiceStatusChangeW" |
---|
22 | Const _FuncName_ControlServiceEx = "ControlServiceExW" |
---|
23 | #else |
---|
24 | Const _FuncName_ChangeServiceConfig = "ChangeServiceConfigA" |
---|
25 | Const _FuncName_ChangeServiceConfig2 = "ChangeServiceConfig2A" |
---|
26 | Const _FuncName_CreateService = "CreateServiceA" |
---|
27 | Const _FuncName_EnumDependentServices = "EnumDependentServicesA" |
---|
28 | Const _FuncName_EnumServicesStatus = "EnumServicesStatusA" |
---|
29 | Const _FuncName_EnumServicesStatusEx = "EnumServicesStatusExA" |
---|
30 | Const _FuncName_GetServiceKeyName = "GetServiceKeyNameA" |
---|
31 | Const _FuncName_GetServiceDisplayName = "GetServiceDisplayNameA" |
---|
32 | Const _FuncName_OpenSCManager = "OpenSCManagerA" |
---|
33 | Const _FuncName_OpenService = "OpenServiceA" |
---|
34 | Const _FuncName_QueryServiceConfig = "QueryServiceConfigA" |
---|
35 | Const _FuncName_QueryServiceConfig2 = "QueryServiceConfig2A" |
---|
36 | Const _FuncName_QueryServiceLockStatus = "QueryServiceLockStatusA" |
---|
37 | Const _FuncName_RegisterServiceCtrlHandler = "RegisterServiceCtrlHandlerA" |
---|
38 | Const _FuncName_RegisterServiceCtrlHandlerEx = "RegisterServiceCtrlHandlerExA" |
---|
39 | Const _FuncName_StartServiceCtrlDispatcher = "StartServiceCtrlDispatcherA" |
---|
40 | Const _FuncName_StartService = "StartServiceA" |
---|
41 | Const _FuncName_NotifyServiceStatusChange = "NotifyServiceStatusChangeA" |
---|
42 | Const _FuncName_ControlServiceEx = "ControlServiceExA" |
---|
43 | #endif |
---|
44 | |
---|
45 | Const SERVICES_ACTIVE_DATABASE = "ServicesActive" |
---|
46 | Const SERVICES_FAILED_DATABASE = "ServicesFailed" |
---|
47 | |
---|
48 | Const SC_GROUP_IDENTIFIER = "+" |
---|
49 | |
---|
50 | Const SERVICE_NO_CHANGE = &hffffffff |
---|
51 | |
---|
52 | Const SERVICE_ACTIVE = &h00000001 |
---|
53 | Const SERVICE_INACTIVE = &h00000002 |
---|
54 | Const SERVICE_STATE_ALL = (SERVICE_ACTIVE Or SERVICE_INACTIVE) |
---|
55 | |
---|
56 | Const SERVICE_CONTROL_STOP = &h00000001 |
---|
57 | Const SERVICE_CONTROL_PAUSE = &h00000002 |
---|
58 | Const SERVICE_CONTROL_CONTINUE = &h00000003 |
---|
59 | Const SERVICE_CONTROL_INTERROGATE = &h00000004 |
---|
60 | Const SERVICE_CONTROL_SHUTDOWN = &h00000005 |
---|
61 | Const SERVICE_CONTROL_PARAMCHANGE = &h00000006 |
---|
62 | Const SERVICE_CONTROL_NETBINDADD = &h00000007 |
---|
63 | Const SERVICE_CONTROL_NETBINDREMOVE = &h00000008 |
---|
64 | Const SERVICE_CONTROL_NETBINDENABLE = &h00000009 |
---|
65 | Const SERVICE_CONTROL_NETBINDDISABLE = &h0000000A |
---|
66 | Const SERVICE_CONTROL_DEVICEEVENT = &h0000000B |
---|
67 | Const SERVICE_CONTROL_HARDWAREPROFILECHANGE = &h0000000C |
---|
68 | Const SERVICE_CONTROL_POWEREVENT = &h0000000D |
---|
69 | Const SERVICE_CONTROL_SESSIONCHANGE = &h0000000E |
---|
70 | Const SERVICE_CONTROL_PRESHUTDOWN = &h0000000F |
---|
71 | |
---|
72 | Const SERVICE_STOPPED = &h00000001 |
---|
73 | Const SERVICE_START_PENDING = &h00000002 |
---|
74 | Const SERVICE_STOP_PENDING = &h00000003 |
---|
75 | Const SERVICE_RUNNING = &h00000004 |
---|
76 | Const SERVICE_CONTINUE_PENDING = &h00000005 |
---|
77 | Const SERVICE_PAUSE_PENDING = &h00000006 |
---|
78 | Const SERVICE_PAUSED = &h00000007 |
---|
79 | |
---|
80 | Const SERVICE_ACCEPT_STOP = &h00000001 |
---|
81 | Const SERVICE_ACCEPT_PAUSE_CONTINUE = &h00000002 |
---|
82 | Const SERVICE_ACCEPT_SHUTDOWN = &h00000004 |
---|
83 | Const SERVICE_ACCEPT_PARAMCHANGE = &h00000008 |
---|
84 | Const SERVICE_ACCEPT_NETBINDCHANGE = &h00000010 |
---|
85 | Const SERVICE_ACCEPT_HARDWAREPROFILECHANGE = &h00000020 |
---|
86 | Const SERVICE_ACCEPT_POWEREVENT = &h00000040 |
---|
87 | Const SERVICE_ACCEPT_SESSIONCHANGE = &h00000080 |
---|
88 | Const SERVICE_ACCEPT_PRESHUTDOWN = &h00000100 |
---|
89 | |
---|
90 | Const SC_MANAGER_CONNECT = &h0001 |
---|
91 | Const SC_MANAGER_CREATE_SERVICE = &h0002 |
---|
92 | Const SC_MANAGER_ENUMERATE_SERVICE = &h0004 |
---|
93 | Const SC_MANAGER_LOCK = &h0008 |
---|
94 | Const SC_MANAGER_QUERY_LOCK_STATUS = &h0010 |
---|
95 | Const SC_MANAGER_MODIFY_BOOT_CONFIG = &h0020 |
---|
96 | |
---|
97 | Const SC_MANAGER_ALL_ACCESS = ( |
---|
98 | STANDARD_RIGHTS_REQUIRED Or _ |
---|
99 | SC_MANAGER_CONNECT Or _ |
---|
100 | SC_MANAGER_CREATE_SERVICE Or _ |
---|
101 | SC_MANAGER_ENUMERATE_SERVICE Or _ |
---|
102 | SC_MANAGER_LOCK Or _ |
---|
103 | SC_MANAGER_QUERY_LOCK_STATUS Or _ |
---|
104 | SC_MANAGER_MODIFY_BOOT_CONFIG) |
---|
105 | |
---|
106 | Const SERVICE_QUERY_CONFIG = &h0001 |
---|
107 | Const SERVICE_CHANGE_CONFIG = &h0002 |
---|
108 | Const SERVICE_QUERY_STATUS = &h0004 |
---|
109 | Const SERVICE_ENUMERATE_DEPENDENTS = &h0008 |
---|
110 | Const SERVICE_START = &h0010 |
---|
111 | Const SERVICE_STOP = &h0020 |
---|
112 | Const SERVICE_PAUSE_CONTINUE = &h0040 |
---|
113 | Const SERVICE_INTERROGATE = &h0080 |
---|
114 | Const SERVICE_USER_DEFINED_CONTROL = &h0100 |
---|
115 | |
---|
116 | Const SERVICE_ALL_ACCESS = ( |
---|
117 | STANDARD_RIGHTS_REQUIRED Or _ |
---|
118 | SERVICE_QUERY_CONFIG Or _ |
---|
119 | SERVICE_CHANGE_CONFIG Or _ |
---|
120 | SERVICE_QUERY_STATUS Or _ |
---|
121 | SERVICE_ENUMERATE_DEPENDENTS Or _ |
---|
122 | SERVICE_START Or _ |
---|
123 | SERVICE_STOP Or _ |
---|
124 | SERVICE_PAUSE_CONTINUE Or _ |
---|
125 | SERVICE_INTERROGATE Or _ |
---|
126 | SERVICE_USER_DEFINED_CONTROL) |
---|
127 | |
---|
128 | Const SERVICE_RUNS_IN_SYSTEM_PROCESS = &h00000001 |
---|
129 | |
---|
130 | Const SERVICE_CONFIG_DESCRIPTION = 1 |
---|
131 | Const SERVICE_CONFIG_FAILURE_ACTIONS = 2 |
---|
132 | Const SERVICE_CONFIG_DELAYED_AUTO_START_INFO = 3 |
---|
133 | Const SERVICE_CONFIG_FAILURE_ACTIONS_FLAG = 4 |
---|
134 | Const SERVICE_CONFIG_SERVICE_SID_INFO = 5 |
---|
135 | Const SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO = 6 |
---|
136 | Const SERVICE_CONFIG_PRESHUTDOWN_INFO = 7 |
---|
137 | |
---|
138 | Const SERVICE_NOTIFY_STATUS_CHANGE_1 = 1 |
---|
139 | Const SERVICE_NOTIFY_STATUS_CHANGE_2 = 2 |
---|
140 | |
---|
141 | Const SERVICE_NOTIFY_STATUS_CHANGE = SERVICE_NOTIFY_STATUS_CHANGE_2 |
---|
142 | |
---|
143 | Const SERVICE_NOTIFY_STOPPED = &h00000001 |
---|
144 | Const SERVICE_NOTIFY_START_PENDING = &h00000002 |
---|
145 | Const SERVICE_NOTIFY_STOP_PENDING = &h00000004 |
---|
146 | Const SERVICE_NOTIFY_RUNNING = &h00000008 |
---|
147 | Const SERVICE_NOTIFY_CONTINUE_PENDING = &h00000010 |
---|
148 | Const SERVICE_NOTIFY_PAUSE_PENDING = &h00000020 |
---|
149 | Const SERVICE_NOTIFY_PAUSED = &h00000040 |
---|
150 | Const SERVICE_NOTIFY_CREATED = &h00000080 |
---|
151 | Const SERVICE_NOTIFY_DELETED = &h00000100 |
---|
152 | Const SERVICE_NOTIFY_DELETE_PENDING = &h00000200 |
---|
153 | |
---|
154 | Const SERVICE_STOP_REASON_FLAG_MIN = &h00000000 |
---|
155 | Const SERVICE_STOP_REASON_FLAG_UNPLANNED = &h10000000 |
---|
156 | Const SERVICE_STOP_REASON_FLAG_CUSTOM = &h20000000 |
---|
157 | Const SERVICE_STOP_REASON_FLAG_PLANNED = &h40000000 |
---|
158 | Const SERVICE_STOP_REASON_FLAG_MAX = &h80000000 |
---|
159 | |
---|
160 | Const SERVICE_STOP_REASON_MAJOR_MIN = &h00000000 |
---|
161 | Const SERVICE_STOP_REASON_MAJOR_OTHER = &h00010000 |
---|
162 | Const SERVICE_STOP_REASON_MAJOR_HARDWARE = &h00020000 |
---|
163 | Const SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM = &h00030000 |
---|
164 | Const SERVICE_STOP_REASON_MAJOR_SOFTWARE = &h00040000 |
---|
165 | Const SERVICE_STOP_REASON_MAJOR_APPLICATION = &h00050000 |
---|
166 | Const SERVICE_STOP_REASON_MAJOR_NONE = &h00060000 |
---|
167 | Const SERVICE_STOP_REASON_MAJOR_MAX = &h00070000 |
---|
168 | Const SERVICE_STOP_REASON_MAJOR_MIN_CUSTOM = &h00400000 |
---|
169 | Const SERVICE_STOP_REASON_MAJOR_MAX_CUSTOM = &h00ff0000 |
---|
170 | |
---|
171 | Const SERVICE_STOP_REASON_MINOR_MIN = &h00000000 |
---|
172 | Const SERVICE_STOP_REASON_MINOR_OTHER = &h00000001 |
---|
173 | Const SERVICE_STOP_REASON_MINOR_MAINTENANCE = &h00000002 |
---|
174 | Const SERVICE_STOP_REASON_MINOR_INSTALLATION = &h00000003 |
---|
175 | Const SERVICE_STOP_REASON_MINOR_UPGRADE = &h00000004 |
---|
176 | Const SERVICE_STOP_REASON_MINOR_RECONFIG = &h00000005 |
---|
177 | Const SERVICE_STOP_REASON_MINOR_HUNG = &h00000006 |
---|
178 | Const SERVICE_STOP_REASON_MINOR_UNSTABLE = &h00000007 |
---|
179 | Const SERVICE_STOP_REASON_MINOR_DISK = &h00000008 |
---|
180 | Const SERVICE_STOP_REASON_MINOR_NETWORKCARD = &h00000009 |
---|
181 | Const SERVICE_STOP_REASON_MINOR_ENVIRONMENT = &h0000000a |
---|
182 | Const SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER = &h0000000b |
---|
183 | Const SERVICE_STOP_REASON_MINOR_OTHERDRIVER = &h0000000c |
---|
184 | Const SERVICE_STOP_REASON_MINOR_SERVICEPACK = &h0000000d |
---|
185 | Const SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE = &h0000000e |
---|
186 | Const SERVICE_STOP_REASON_MINOR_SECURITYFIX = &h0000000f |
---|
187 | Const SERVICE_STOP_REASON_MINOR_SECURITY = &h00000010 |
---|
188 | Const SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY = &h00000011 |
---|
189 | Const SERVICE_STOP_REASON_MINOR_WMI = &h00000012 |
---|
190 | Const SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL = &h00000013 |
---|
191 | Const SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL = &h00000014 |
---|
192 | Const SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL = &h00000015 |
---|
193 | Const SERVICE_STOP_REASON_MINOR_MMC = &h00000016 |
---|
194 | Const SERVICE_STOP_REASON_MINOR_NONE = &h00000017 |
---|
195 | Const SERVICE_STOP_REASON_MINOR_MAX = &h00000018 |
---|
196 | Const SERVICE_STOP_REASON_MINOR_MIN_CUSTOM = &h00000100 |
---|
197 | Const SERVICE_STOP_REASON_MINOR_MAX_CUSTOM = &h0000FFFF |
---|
198 | |
---|
199 | Const SERVICE_CONTROL_STATUS_REASON_INFO = 1 |
---|
200 | |
---|
201 | Const SERVICE_SID_TYPE_NONE = &h00000000 |
---|
202 | Const SERVICE_SID_TYPE_UNRESTRICTED = &h00000001 |
---|
203 | Const SERVICE_SID_TYPE_RESTRICTED = (&h00000002 Or SERVICE_SID_TYPE_UNRESTRICTED) |
---|
204 | |
---|
205 | Type SERVICE_DESCRIPTION |
---|
206 | lpDescription As LPTSTR |
---|
207 | End Type |
---|
208 | /* |
---|
209 | Const Enum SC_ACTION_TYPE |
---|
210 | SC_ACTION_NONE = 0 |
---|
211 | SC_ACTION_RESTART = 1 |
---|
212 | SC_ACTION_REBOOT = 2 |
---|
213 | SC_ACTION_RUN_COMMAND = 3 |
---|
214 | End Type |
---|
215 | */ |
---|
216 | TypeDef SC_ACTION_TYPE = DWord |
---|
217 | Const SC_ACTION_NONE = 0 |
---|
218 | Const SC_ACTION_RESTART = 1 |
---|
219 | Const SC_ACTION_REBOOT = 2 |
---|
220 | Const SC_ACTION_RUN_COMMAND = 3 |
---|
221 | |
---|
222 | Type SC_ACTION |
---|
223 | Type_ As SC_ACTION_TYPE |
---|
224 | Delay As DWord |
---|
225 | End Type |
---|
226 | |
---|
227 | Type SERVICE_FAILURE_ACTIONS |
---|
228 | dwResetPeriod As DWord |
---|
229 | lpRebootMsg As LPTSTR |
---|
230 | lpCommand As LPTSTR |
---|
231 | /*[range(0, 1024)]*/ cActions As DWord |
---|
232 | /*[size_is(cActions)]*/ lpsaActions As *SC_ACTION |
---|
233 | End Type |
---|
234 | |
---|
235 | Type SERVICE_DELAYED_AUTO_START_INFO |
---|
236 | fDelayedAutostart As BOOL |
---|
237 | End Type |
---|
238 | |
---|
239 | Type SERVICE_FAILURE_ACTIONS_FLAG |
---|
240 | fFailureActionsOnNonCrashFailures As BOOL |
---|
241 | End Type |
---|
242 | |
---|
243 | Type SERVICE_SID_INFO |
---|
244 | dwServiceSidType As DWord |
---|
245 | End Type |
---|
246 | |
---|
247 | Type _SERVICE_REQUIRED_PRIVILEGES_INFO |
---|
248 | pmszRequiredPrivileges As LPTSTR |
---|
249 | End Type |
---|
250 | |
---|
251 | Type SERVICE_PRESHUTDOWN_INFO |
---|
252 | dwPreshutdownTimeout As DWord |
---|
253 | End Type |
---|
254 | |
---|
255 | Type _System_DeclareHandle_SC_HANDLE:unused As DWord:End Type |
---|
256 | TypeDef SC_HANDLE = *_System_DeclareHandle_SC_HANDLE |
---|
257 | |
---|
258 | Type _System_DeclareHandle_SERVICE_STATUS_HANDLE:unused As DWord:End Type |
---|
259 | TypeDef SERVICE_STATUS_HANDLE = *_System_DeclareHandle_SERVICE_STATUS_HANDLE |
---|
260 | |
---|
261 | Const Enum SC_STATUS_TYPE |
---|
262 | SC_STATUS_PROCESS_INFO = 0 |
---|
263 | End Enum |
---|
264 | |
---|
265 | Const Enum SC_ENUM_TYPE |
---|
266 | SC_ENUM_PROCESS_INFO = 0 |
---|
267 | End Enum |
---|
268 | |
---|
269 | Type SERVICE_STATUS |
---|
270 | dwServiceType As DWord |
---|
271 | dwCurrentState As DWord |
---|
272 | dwControlsAccepted As DWord |
---|
273 | dwWin32ExitCode As DWord |
---|
274 | dwServiceSpecificExitCode As DWord |
---|
275 | dwCheckPoint As DWord |
---|
276 | dwWaitHint As DWord |
---|
277 | End Type |
---|
278 | |
---|
279 | Type SERVICE_STATUS_PROCESS |
---|
280 | dwServiceType As DWord |
---|
281 | dwCurrentState As DWord |
---|
282 | dwControlsAccepted As DWord |
---|
283 | dwWin32ExitCode As DWord |
---|
284 | dwServiceSpecificExitCode As DWord |
---|
285 | dwCheckPoint As DWord |
---|
286 | dwWaitHint As DWord |
---|
287 | dwProcessId As DWord |
---|
288 | dwServiceFlags As DWord |
---|
289 | End Type |
---|
290 | |
---|
291 | Type ENUM_SERVICE_STATUS |
---|
292 | lpServiceName As LPTSTR |
---|
293 | lpDisplayName As LPTSTR |
---|
294 | ServiceStatus As SERVICE_STATUS |
---|
295 | End Type |
---|
296 | |
---|
297 | Type ENUM_SERVICE_STATUS_PROCESS |
---|
298 | lpServiceName As LPTSTR |
---|
299 | lpDisplayName As LPTSTR |
---|
300 | ServiceStatusProcess As SERVICE_STATUS_PROCESS |
---|
301 | End Type |
---|
302 | |
---|
303 | TypeDef SC_LOCK = VoidPtr |
---|
304 | |
---|
305 | Type QUERY_SERVICE_LOCK_STATUS |
---|
306 | fIsLocked As DWord |
---|
307 | lpLockOwner As LPTSTR |
---|
308 | dwLockDuration As DWord |
---|
309 | End Type |
---|
310 | |
---|
311 | Type QUERY_SERVICE_CONFIG |
---|
312 | dwServiceType As DWord |
---|
313 | dwStartType As DWord |
---|
314 | dwErrorControl As DWord |
---|
315 | lpBinaryPathName As LPTSTR |
---|
316 | lpLoadOrderGroup As LPTSTR |
---|
317 | dwTagId As DWord |
---|
318 | lpDependencies As LPTSTR |
---|
319 | lpServiceStartName As LPTSTR |
---|
320 | lpDisplayName As LPTSTR |
---|
321 | End Type |
---|
322 | |
---|
323 | TypeDef LPSERVICE_MAIN_FUNCTION = *Sub(dwNumServicesArgs As DWord, lpServiceArgVectors As *LPTSTR) |
---|
324 | |
---|
325 | Type SERVICE_TABLE_ENTRY |
---|
326 | lpServiceName As LPTSTR |
---|
327 | lpServiceProc As LPSERVICE_MAIN_FUNCTION |
---|
328 | End Type |
---|
329 | |
---|
330 | TypeDef LPHANDLER_FUNCTION = *Sub(dwControl As DWord) |
---|
331 | |
---|
332 | TypeDef LPHANDLER_FUNCTION_EX = *Function(dwControl As DWord, dwEventType As DWord, lpEventData As VoidPtr, lpContext As VoidPtr) As DWord |
---|
333 | |
---|
334 | TypeDef PFN_SC_NOTIFY_CALLBACK = *Sub(pParameter As VoidPtr) |
---|
335 | |
---|
336 | Type SERVICE_NOTIFY_1 |
---|
337 | dwVersion As DWord |
---|
338 | pfnNotifyCallback As PFN_SC_NOTIFY_CALLBACK |
---|
339 | pContext As VoidPtr |
---|
340 | dwNotificationStatus As DWord |
---|
341 | ServiceStatus As SERVICE_STATUS_PROCESS |
---|
342 | End Type |
---|
343 | |
---|
344 | Type SERVICE_NOTIFY_2 |
---|
345 | dwVersion As DWord |
---|
346 | pfnNotifyCallback As PFN_SC_NOTIFY_CALLBACK |
---|
347 | pContext As VoidPtr |
---|
348 | dwNotificationStatus As DWord |
---|
349 | ServiceStatus As SERVICE_STATUS_PROCESS |
---|
350 | dwNotificationTriggered As DWord |
---|
351 | pszServiceNames As LPTSTR |
---|
352 | End Type |
---|
353 | |
---|
354 | TypeDef SERVICE_NOTIFY = SERVICE_NOTIFY_2 |
---|
355 | |
---|
356 | Type SERVICE_CONTROL_STATUS_REASON_PARAMS |
---|
357 | dwReason As DWord |
---|
358 | pszComment As LPTSTR |
---|
359 | ServiceStatus As SERVICE_STATUS_PROCESS |
---|
360 | End Type |
---|
361 | |
---|
362 | Declare Function ChangeServiceConfig Lib "advapi32" Alias _FuncName_ChangeServiceConfig ( |
---|
363 | /*__in*/ hService As SC_HANDLE, |
---|
364 | /*__in*/ dwServiceType As DWord, |
---|
365 | /*__in*/ dwStartType As DWord, |
---|
366 | /*__in*/ dwErrorControl As DWord, |
---|
367 | /*__in_opt*/ lpBinaryPathName As LPCTSTR, |
---|
368 | /*__in_opt*/ lpLoadOrderGroup As LPCTSTR, |
---|
369 | /*__out_opt*/ lpdwTagId As *DWord, |
---|
370 | /*__in_opt*/ lpDependencies As LPCTSTR, |
---|
371 | /*__in_opt*/ lpServiceStartName As LPCTSTR, |
---|
372 | /*__in_opt*/ lpPassword As LPCTSTR, |
---|
373 | /*__in_opt*/ lpDisplayName As LPCTSTR |
---|
374 | ) As BOOL |
---|
375 | |
---|
376 | Declare Function ChangeServiceConfig2 Lib "advapi32" Alias _FuncName_ChangeServiceConfig2 ( |
---|
377 | /*__in*/ hService As SC_HANDLE, |
---|
378 | /*__in*/ dwInfoLevel As DWord, |
---|
379 | /*__in_opt*/ lpInfo As VoidPtr |
---|
380 | ) As BOOL |
---|
381 | |
---|
382 | Declare Function CloseServiceHandle Lib "advapi32" ( |
---|
383 | /*__in*/ hSCObject As SC_HANDLE |
---|
384 | ) As BOOL |
---|
385 | |
---|
386 | Declare Function ControlService Lib "advapi32" ( |
---|
387 | /*__in*/ hService As SC_HANDLE, |
---|
388 | /*__in*/ dwControl As DWord, |
---|
389 | /*__out*/ ByRef ServiceStatus As SERVICE_STATUS |
---|
390 | ) As BOOL |
---|
391 | |
---|
392 | Declare Function CreateService Lib "advapi32" Alias _FuncName_CreateService ( |
---|
393 | /*__in*/ hSCManager As SC_HANDLE, |
---|
394 | /*__in*/ lpServiceName As LPCTSTR, |
---|
395 | /*__in_opt*/ lpDisplayName As LPCTSTR, |
---|
396 | /*__in*/ dwDesiredAccess As DWord, |
---|
397 | /*__in*/ dwServiceType As DWord, |
---|
398 | /*__in*/ dwStartType As DWord, |
---|
399 | /*__in*/ dwErrorControl As DWord, |
---|
400 | /*__in_opt*/ lpBinaryPathName As LPCTSTR, |
---|
401 | /*__in_opt*/ lpLoadOrderGroup As LPCTSTR, |
---|
402 | /*__out_opt*/ lpdwTagId As *DWord, |
---|
403 | /*__in_opt*/ lpDependencies As LPCTSTR, |
---|
404 | /*__in_opt*/ lpServiceStartName As LPCTSTR, |
---|
405 | /*__in_opt*/ lpPassword As LPCTSTR |
---|
406 | ) As SC_HANDLE |
---|
407 | |
---|
408 | Declare Function DeleteService Lib "advapi32" ( |
---|
409 | /*__in*/ hService As SC_HANDLE |
---|
410 | ) As BOOL |
---|
411 | |
---|
412 | Declare Function EnumDependentServices Lib "advapi32" Alias _FuncName_EnumDependentServices ( |
---|
413 | /*__in*/ hService As SC_HANDLE, |
---|
414 | /*__in*/ dwServiceState As DWord, |
---|
415 | /*__out_bcount_opt(cbBufSize)*/ lpServices As *ENUM_SERVICE_STATUS, |
---|
416 | /*__in*/ cbBufSize As DWord, |
---|
417 | /*__out*/ pcbBytesNeeded As *DWord, |
---|
418 | /*__out*/ lpServicesReturned As *DWord |
---|
419 | ) As BOOL |
---|
420 | |
---|
421 | Declare Function EnumServicesStatus Lib "advapi32" Alias _FuncName_EnumServicesStatus ( |
---|
422 | /*__in*/ hSCManager As SC_HANDLE, |
---|
423 | /*__in*/ dwServiceType As DWord, |
---|
424 | /*__in*/ dwServiceState As DWord, |
---|
425 | /*__out_bcount_opt(cbBufSize)*/ lpServices As *ENUM_SERVICE_STATUS, |
---|
426 | /*__in*/ cbBufSize As DWord, |
---|
427 | /*__out*/ pcbBytesNeeded As *DWord, |
---|
428 | /*__out*/ lpServicesReturned As *DWord, |
---|
429 | /*__inout_opt*/ lpResumeHandle As *DWord |
---|
430 | ) As BOOL |
---|
431 | |
---|
432 | Declare Function EnumServicesStatusEx Lib "advapi32" Alias _FuncName_EnumServicesStatusEx ( |
---|
433 | /*__in*/ hSCManager As SC_HANDLE, |
---|
434 | /*__in*/ InfoLevel As SC_ENUM_TYPE, |
---|
435 | /*__in*/ dwServiceType As DWord, |
---|
436 | /*__in*/ dwServiceState As DWord, |
---|
437 | /*__out_bcount_opt(cbBufSize)*/ lpServices As *Byte, |
---|
438 | /*__in*/ cbBufSize As DWord, |
---|
439 | /*__out*/ pcbBytesNeeded As *DWord, |
---|
440 | /*__out*/ lpServicesReturned As *DWord, |
---|
441 | /*__inout_opt*/ lpResumeHandle As *DWord, |
---|
442 | /*__in_opt*/ pszGroupName As LPCTSTR |
---|
443 | ) As BOOL |
---|
444 | |
---|
445 | Declare Function GetServiceKeyName Lib "advapi32" Alias _FuncName_GetServiceKeyName ( |
---|
446 | /*__in*/ hSCManager As SC_HANDLE, |
---|
447 | /*__in*/ lpDisplayName As LPCTSTR, |
---|
448 | /*__out_ecount_opt(*lpcchBuffer)*/ lpServiceName As LPTSTR, |
---|
449 | /*__inout*/ lpcchBuffer As *DWord |
---|
450 | ) As BOOL |
---|
451 | |
---|
452 | Declare Function GetServiceDisplayName Lib "advapi32" Alias _FuncName_GetServiceDisplayName ( |
---|
453 | /*__in*/ hSCManager As SC_HANDLE, |
---|
454 | /*__in*/ lpServiceName As LPCTSTR, |
---|
455 | /*__out_ecount_opt(*lpcchBuffer)*/ lpDisplayName As LPTSTR, |
---|
456 | /*__inout*/ lpcchBuffer As *DWord |
---|
457 | ) As BOOL |
---|
458 | |
---|
459 | Declare Function LockServiceDatabase Lib "advapi32" ( |
---|
460 | /*__in*/ hSCManager As SC_HANDLE |
---|
461 | ) As SC_LOCK |
---|
462 | |
---|
463 | Declare Function NotifyBootConfigStatus Lib "advapi32" ( |
---|
464 | /*__in*/ BootAcceptable As BOOL |
---|
465 | ) As BOOL |
---|
466 | |
---|
467 | Declare Function OpenSCManager Lib "advapi32" Alias _FuncName_OpenSCManager ( |
---|
468 | /*__in_opt*/ lpMachineName As LPCTSTR, |
---|
469 | /*__in_opt*/ lpDatabaseName As LPCTSTR, |
---|
470 | /*__in*/ dwDesiredAccess As DWord |
---|
471 | ) As SC_HANDLE |
---|
472 | |
---|
473 | Declare Function OpenService Lib "advapi32" Alias _FuncName_OpenService ( |
---|
474 | /*__in*/ hSCManager As SC_HANDLE, |
---|
475 | /*__in*/ lpServiceName As LPCTSTR, |
---|
476 | /*__in*/ dwDesiredAccess As DWord |
---|
477 | ) As SC_HANDLE |
---|
478 | |
---|
479 | Declare Function QueryServiceConfig Lib "advapi32" Alias _FuncName_QueryServiceConfig ( |
---|
480 | /*__in*/ hService As SC_HANDLE, |
---|
481 | /*__out_bcount_opt(cbBufSize)*/ lpServiceConfig As *QUERY_SERVICE_CONFIG, |
---|
482 | /*__in*/ cbBufSize As DWord, |
---|
483 | /*__out*/ pcbBytesNeeded As *DWord |
---|
484 | ) As BOOL |
---|
485 | |
---|
486 | Declare Function QueryServiceConfig2 Lib "advapi32" Alias _FuncName_QueryServiceConfig2 ( |
---|
487 | /*__in*/ hService As SC_HANDLE, |
---|
488 | /*__in*/ dwInfoLevel As DWord, |
---|
489 | /*__out_bcount_opt(cbBufSize)*/ lpBuffer As *Byte, |
---|
490 | /*__in*/ cbBufSize As DWord, |
---|
491 | /*__out*/ pcbBytesNeeded As *DWord |
---|
492 | ) As BOOL |
---|
493 | |
---|
494 | Declare Function QueryServiceLockStatus Lib "advapi32" Alias _FuncName_QueryServiceLockStatus ( |
---|
495 | /*__in*/ hSCManager As SC_HANDLE, |
---|
496 | /*__out_bcount_opt(cbBufSize)*/ lpLockStatus As *QUERY_SERVICE_LOCK_STATUS, |
---|
497 | /*__in*/ cbBufSize As DWord, |
---|
498 | /*__out*/ pcbBytesNeeded As *DWord |
---|
499 | ) As BOOL |
---|
500 | |
---|
501 | Declare Function QueryServiceObjectSecurity Lib "advapi32" ( |
---|
502 | /*__in*/ hService As SC_HANDLE, |
---|
503 | /*__in*/ dwSecurityInformation As SECURITY_INFORMATION, |
---|
504 | /*__out_bcount_opt(cbBufSize)*/ lpSecurityDescriptor As *SECURITY_DESCRIPTOR, |
---|
505 | /*__in*/ cbBufSize As DWord, |
---|
506 | /*__out*/ pcbBytesNeeded As *DWord |
---|
507 | ) As BOOL |
---|
508 | |
---|
509 | Declare Function QueryServiceStatus Lib "advapi32" ( |
---|
510 | /*__in*/ hService As SC_HANDLE, |
---|
511 | /*__out*/ ByRef ServiceStatus As SERVICE_STATUS |
---|
512 | ) As BOOL |
---|
513 | |
---|
514 | Declare Function QueryServiceStatusEx Lib "advapi32" ( |
---|
515 | /*__in*/ hService As SC_HANDLE, |
---|
516 | /*__in*/ InfoLevel As SC_STATUS_TYPE, |
---|
517 | /*__out_bcount_opt(cbBufSize)*/ lpBuffer As *Byte, |
---|
518 | /*__in*/ cbBufSize As DWord, |
---|
519 | /*__out*/ ByRef cbBytesNeeded As DWord |
---|
520 | ) As BOOL |
---|
521 | |
---|
522 | Declare Function RegisterServiceCtrlHandler Lib "advapi32" Alias _FuncName_RegisterServiceCtrlHandler ( |
---|
523 | /*__in*/ lpServiceName As LPCTSTR, |
---|
524 | /*__in __callback*/ lpHandlerProc As LPHANDLER_FUNCTION |
---|
525 | ) As SERVICE_STATUS_HANDLE |
---|
526 | |
---|
527 | Declare Function RegisterServiceCtrlHandlerEx Lib "advapi32" Alias _FuncName_RegisterServiceCtrlHandlerEx ( |
---|
528 | /*__in*/ lpServiceName As LPCTSTR, |
---|
529 | /*__in __callback*/ lpHandlerProc As LPHANDLER_FUNCTION_EX, |
---|
530 | /*__in_opt*/ lpContext As VoidPtr |
---|
531 | ) As SERVICE_STATUS_HANDLE |
---|
532 | |
---|
533 | Declare Function SetServiceObjectSecurity Lib "advapi32" ( |
---|
534 | /*__in*/ hService As SC_HANDLE, |
---|
535 | /*__in*/ dwSecurityInformation As SECURITY_INFORMATION, |
---|
536 | /*__in*/ lpSecurityDescriptor As *SECURITY_DESCRIPTOR |
---|
537 | ) As BOOL |
---|
538 | |
---|
539 | Declare Function SetServiceStatus Lib "advapi32" ( |
---|
540 | /*__in*/ hServiceStatus As SERVICE_STATUS_HANDLE, |
---|
541 | /*__in*/ ByRef ServiceStatus As SERVICE_STATUS |
---|
542 | ) As BOOL |
---|
543 | |
---|
544 | Declare Function StartServiceCtrlDispatcher Lib "advapi32" Alias _FuncName_StartServiceCtrlDispatcher ( |
---|
545 | /*__in CONST*/ lpServiceStartTable As *SERVICE_TABLE_ENTRY, |
---|
546 | ) As BOOL |
---|
547 | |
---|
548 | Declare Function StartService Lib "advapi32" Alias _FuncName_StartService ( |
---|
549 | /*__in*/ hService As SC_HANDLE, |
---|
550 | /*__in*/ dwNumServiceArgs As DWord, |
---|
551 | /*__in_ecount_opt(dwNumServiceArgs)*/ lpServiceArgVectors As *LPCTSTR, |
---|
552 | ) As BOOL |
---|
553 | |
---|
554 | Declare Function UnlockServiceDatabase Lib "advapi32" ( |
---|
555 | /*__in*/ ScLock As SC_LOCK |
---|
556 | ) As BOOL |
---|
557 | |
---|
558 | Declare Function NotifyServiceStatusChange Lib "advapi32" Alias _FuncName_NotifyServiceStatusChange ( |
---|
559 | /*__in*/ hService As SC_HANDLE, |
---|
560 | /*__in*/ dwNotifyMask As DWord, |
---|
561 | /*__in*/ ByRef NotifyBuffer As SERVICE_NOTIFY |
---|
562 | ) As DWord |
---|
563 | |
---|
564 | Declare Function ControlServiceEx Lib "advapi32" Alias _FuncName_ControlServiceEx ( |
---|
565 | /*__in*/ hService As SC_HANDLE, |
---|
566 | /*__in*/ dwControl As DWord, |
---|
567 | /*__in*/ dwInfoLevel As DWord, |
---|
568 | /*__inout*/ pControlParams As VoidPtr |
---|
569 | ) As BOOL |
---|