source: branch/egtra-stream-without-en_dec/winsvc.ab@ 673

Last change on this file since 673 was 628, checked in by イグトランス (egtra), 16 years ago

winnls.ab, winsvc.abを追加

File size: 19.8 KB
Line 
1'winsrv.ab
2
3#ifdef UNICODE
4Const _FuncName_ChangeServiceConfig = "ChangeServiceConfigW"
5Const _FuncName_ChangeServiceConfig2 = "ChangeServiceConfig2W"
6Const _FuncName_CreateService = "CreateServiceW"
7Const _FuncName_EnumDependentServices = "EnumDependentServicesW"
8Const _FuncName_EnumServicesStatus = "EnumServicesStatusW"
9Const _FuncName_EnumServicesStatusEx = "EnumServicesStatusExW"
10Const _FuncName_GetServiceKeyName = "GetServiceKeyNameW"
11Const _FuncName_GetServiceDisplayName = "GetServiceDisplayNameW"
12Const _FuncName_OpenSCManager = "OpenSCManagerW"
13Const _FuncName_OpenService = "OpenServiceW"
14Const _FuncName_QueryServiceConfig = "QueryServiceConfigW"
15Const _FuncName_QueryServiceConfig2 = "QueryServiceConfig2W"
16Const _FuncName_QueryServiceLockStatus = "QueryServiceLockStatusW"
17Const _FuncName_RegisterServiceCtrlHandler = "RegisterServiceCtrlHandlerW"
18Const _FuncName_RegisterServiceCtrlHandlerEx = "RegisterServiceCtrlHandlerExW"
19Const _FuncName_StartServiceCtrlDispatcher = "StartServiceCtrlDispatcherW"
20Const _FuncName_StartService = "StartServiceW"
21Const _FuncName_NotifyServiceStatusChange = "NotifyServiceStatusChangeW"
22Const _FuncName_ControlServiceEx = "ControlServiceExW"
23#else
24Const _FuncName_ChangeServiceConfig = "ChangeServiceConfigA"
25Const _FuncName_ChangeServiceConfig2 = "ChangeServiceConfig2A"
26Const _FuncName_CreateService = "CreateServiceA"
27Const _FuncName_EnumDependentServices = "EnumDependentServicesA"
28Const _FuncName_EnumServicesStatus = "EnumServicesStatusA"
29Const _FuncName_EnumServicesStatusEx = "EnumServicesStatusExA"
30Const _FuncName_GetServiceKeyName = "GetServiceKeyNameA"
31Const _FuncName_GetServiceDisplayName = "GetServiceDisplayNameA"
32Const _FuncName_OpenSCManager = "OpenSCManagerA"
33Const _FuncName_OpenService = "OpenServiceA"
34Const _FuncName_QueryServiceConfig = "QueryServiceConfigA"
35Const _FuncName_QueryServiceConfig2 = "QueryServiceConfig2A"
36Const _FuncName_QueryServiceLockStatus = "QueryServiceLockStatusA"
37Const _FuncName_RegisterServiceCtrlHandler = "RegisterServiceCtrlHandlerA"
38Const _FuncName_RegisterServiceCtrlHandlerEx = "RegisterServiceCtrlHandlerExA"
39Const _FuncName_StartServiceCtrlDispatcher = "StartServiceCtrlDispatcherA"
40Const _FuncName_StartService = "StartServiceA"
41Const _FuncName_NotifyServiceStatusChange = "NotifyServiceStatusChangeA"
42Const _FuncName_ControlServiceEx = "ControlServiceExA"
43#endif
44
45Const SERVICES_ACTIVE_DATABASE = "ServicesActive"
46Const SERVICES_FAILED_DATABASE = "ServicesFailed"
47
48Const SC_GROUP_IDENTIFIER = "+"
49
50Const SERVICE_NO_CHANGE = &hffffffff
51
52Const SERVICE_ACTIVE = &h00000001
53Const SERVICE_INACTIVE = &h00000002
54Const SERVICE_STATE_ALL = (SERVICE_ACTIVE Or SERVICE_INACTIVE)
55
56Const SERVICE_CONTROL_STOP = &h00000001
57Const SERVICE_CONTROL_PAUSE = &h00000002
58Const SERVICE_CONTROL_CONTINUE = &h00000003
59Const SERVICE_CONTROL_INTERROGATE = &h00000004
60Const SERVICE_CONTROL_SHUTDOWN = &h00000005
61Const SERVICE_CONTROL_PARAMCHANGE = &h00000006
62Const SERVICE_CONTROL_NETBINDADD = &h00000007
63Const SERVICE_CONTROL_NETBINDREMOVE = &h00000008
64Const SERVICE_CONTROL_NETBINDENABLE = &h00000009
65Const SERVICE_CONTROL_NETBINDDISABLE = &h0000000A
66Const SERVICE_CONTROL_DEVICEEVENT = &h0000000B
67Const SERVICE_CONTROL_HARDWAREPROFILECHANGE = &h0000000C
68Const SERVICE_CONTROL_POWEREVENT = &h0000000D
69Const SERVICE_CONTROL_SESSIONCHANGE = &h0000000E
70Const SERVICE_CONTROL_PRESHUTDOWN = &h0000000F
71
72Const SERVICE_STOPPED = &h00000001
73Const SERVICE_START_PENDING = &h00000002
74Const SERVICE_STOP_PENDING = &h00000003
75Const SERVICE_RUNNING = &h00000004
76Const SERVICE_CONTINUE_PENDING = &h00000005
77Const SERVICE_PAUSE_PENDING = &h00000006
78Const SERVICE_PAUSED = &h00000007
79
80Const SERVICE_ACCEPT_STOP = &h00000001
81Const SERVICE_ACCEPT_PAUSE_CONTINUE = &h00000002
82Const SERVICE_ACCEPT_SHUTDOWN = &h00000004
83Const SERVICE_ACCEPT_PARAMCHANGE = &h00000008
84Const SERVICE_ACCEPT_NETBINDCHANGE = &h00000010
85Const SERVICE_ACCEPT_HARDWAREPROFILECHANGE = &h00000020
86Const SERVICE_ACCEPT_POWEREVENT = &h00000040
87Const SERVICE_ACCEPT_SESSIONCHANGE = &h00000080
88Const SERVICE_ACCEPT_PRESHUTDOWN = &h00000100
89
90Const SC_MANAGER_CONNECT = &h0001
91Const SC_MANAGER_CREATE_SERVICE = &h0002
92Const SC_MANAGER_ENUMERATE_SERVICE = &h0004
93Const SC_MANAGER_LOCK = &h0008
94Const SC_MANAGER_QUERY_LOCK_STATUS = &h0010
95Const SC_MANAGER_MODIFY_BOOT_CONFIG = &h0020
96
97Const 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
106Const SERVICE_QUERY_CONFIG = &h0001
107Const SERVICE_CHANGE_CONFIG = &h0002
108Const SERVICE_QUERY_STATUS = &h0004
109Const SERVICE_ENUMERATE_DEPENDENTS = &h0008
110Const SERVICE_START = &h0010
111Const SERVICE_STOP = &h0020
112Const SERVICE_PAUSE_CONTINUE = &h0040
113Const SERVICE_INTERROGATE = &h0080
114Const SERVICE_USER_DEFINED_CONTROL = &h0100
115
116Const 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
128Const SERVICE_RUNS_IN_SYSTEM_PROCESS = &h00000001
129
130Const SERVICE_CONFIG_DESCRIPTION = 1
131Const SERVICE_CONFIG_FAILURE_ACTIONS = 2
132Const SERVICE_CONFIG_DELAYED_AUTO_START_INFO = 3
133Const SERVICE_CONFIG_FAILURE_ACTIONS_FLAG = 4
134Const SERVICE_CONFIG_SERVICE_SID_INFO = 5
135Const SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO = 6
136Const SERVICE_CONFIG_PRESHUTDOWN_INFO = 7
137
138Const SERVICE_NOTIFY_STATUS_CHANGE_1 = 1
139Const SERVICE_NOTIFY_STATUS_CHANGE_2 = 2
140
141Const SERVICE_NOTIFY_STATUS_CHANGE = SERVICE_NOTIFY_STATUS_CHANGE_2
142
143Const SERVICE_NOTIFY_STOPPED = &h00000001
144Const SERVICE_NOTIFY_START_PENDING = &h00000002
145Const SERVICE_NOTIFY_STOP_PENDING = &h00000004
146Const SERVICE_NOTIFY_RUNNING = &h00000008
147Const SERVICE_NOTIFY_CONTINUE_PENDING = &h00000010
148Const SERVICE_NOTIFY_PAUSE_PENDING = &h00000020
149Const SERVICE_NOTIFY_PAUSED = &h00000040
150Const SERVICE_NOTIFY_CREATED = &h00000080
151Const SERVICE_NOTIFY_DELETED = &h00000100
152Const SERVICE_NOTIFY_DELETE_PENDING = &h00000200
153
154Const SERVICE_STOP_REASON_FLAG_MIN = &h00000000
155Const SERVICE_STOP_REASON_FLAG_UNPLANNED = &h10000000
156Const SERVICE_STOP_REASON_FLAG_CUSTOM = &h20000000
157Const SERVICE_STOP_REASON_FLAG_PLANNED = &h40000000
158Const SERVICE_STOP_REASON_FLAG_MAX = &h80000000
159
160Const SERVICE_STOP_REASON_MAJOR_MIN = &h00000000
161Const SERVICE_STOP_REASON_MAJOR_OTHER = &h00010000
162Const SERVICE_STOP_REASON_MAJOR_HARDWARE = &h00020000
163Const SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM = &h00030000
164Const SERVICE_STOP_REASON_MAJOR_SOFTWARE = &h00040000
165Const SERVICE_STOP_REASON_MAJOR_APPLICATION = &h00050000
166Const SERVICE_STOP_REASON_MAJOR_NONE = &h00060000
167Const SERVICE_STOP_REASON_MAJOR_MAX = &h00070000
168Const SERVICE_STOP_REASON_MAJOR_MIN_CUSTOM = &h00400000
169Const SERVICE_STOP_REASON_MAJOR_MAX_CUSTOM = &h00ff0000
170
171Const SERVICE_STOP_REASON_MINOR_MIN = &h00000000
172Const SERVICE_STOP_REASON_MINOR_OTHER = &h00000001
173Const SERVICE_STOP_REASON_MINOR_MAINTENANCE = &h00000002
174Const SERVICE_STOP_REASON_MINOR_INSTALLATION = &h00000003
175Const SERVICE_STOP_REASON_MINOR_UPGRADE = &h00000004
176Const SERVICE_STOP_REASON_MINOR_RECONFIG = &h00000005
177Const SERVICE_STOP_REASON_MINOR_HUNG = &h00000006
178Const SERVICE_STOP_REASON_MINOR_UNSTABLE = &h00000007
179Const SERVICE_STOP_REASON_MINOR_DISK = &h00000008
180Const SERVICE_STOP_REASON_MINOR_NETWORKCARD = &h00000009
181Const SERVICE_STOP_REASON_MINOR_ENVIRONMENT = &h0000000a
182Const SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER = &h0000000b
183Const SERVICE_STOP_REASON_MINOR_OTHERDRIVER = &h0000000c
184Const SERVICE_STOP_REASON_MINOR_SERVICEPACK = &h0000000d
185Const SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE = &h0000000e
186Const SERVICE_STOP_REASON_MINOR_SECURITYFIX = &h0000000f
187Const SERVICE_STOP_REASON_MINOR_SECURITY = &h00000010
188Const SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY = &h00000011
189Const SERVICE_STOP_REASON_MINOR_WMI = &h00000012
190Const SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL = &h00000013
191Const SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL = &h00000014
192Const SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL = &h00000015
193Const SERVICE_STOP_REASON_MINOR_MMC = &h00000016
194Const SERVICE_STOP_REASON_MINOR_NONE = &h00000017
195Const SERVICE_STOP_REASON_MINOR_MAX = &h00000018
196Const SERVICE_STOP_REASON_MINOR_MIN_CUSTOM = &h00000100
197Const SERVICE_STOP_REASON_MINOR_MAX_CUSTOM = &h0000FFFF
198
199Const SERVICE_CONTROL_STATUS_REASON_INFO = 1
200
201Const SERVICE_SID_TYPE_NONE = &h00000000
202Const SERVICE_SID_TYPE_UNRESTRICTED = &h00000001
203Const SERVICE_SID_TYPE_RESTRICTED = (&h00000002 Or SERVICE_SID_TYPE_UNRESTRICTED)
204
205Type SERVICE_DESCRIPTION
206 lpDescription As LPTSTR
207End Type
208/*
209Const 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
214End Type
215*/
216TypeDef SC_ACTION_TYPE = DWord
217Const SC_ACTION_NONE = 0
218Const SC_ACTION_RESTART = 1
219Const SC_ACTION_REBOOT = 2
220Const SC_ACTION_RUN_COMMAND = 3
221
222Type SC_ACTION
223 Type_ As SC_ACTION_TYPE
224 Delay As DWord
225End Type
226
227Type 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
233End Type
234
235Type SERVICE_DELAYED_AUTO_START_INFO
236 fDelayedAutostart As BOOL
237End Type
238
239Type SERVICE_FAILURE_ACTIONS_FLAG
240 fFailureActionsOnNonCrashFailures As BOOL
241End Type
242
243Type SERVICE_SID_INFO
244 dwServiceSidType As DWord
245End Type
246
247Type _SERVICE_REQUIRED_PRIVILEGES_INFO
248 pmszRequiredPrivileges As LPTSTR
249End Type
250
251Type SERVICE_PRESHUTDOWN_INFO
252 dwPreshutdownTimeout As DWord
253End Type
254
255Type _System_DeclareHandle_SC_HANDLE:unused As DWord:End Type
256TypeDef SC_HANDLE = *_System_DeclareHandle_SC_HANDLE
257
258Type _System_DeclareHandle_SERVICE_STATUS_HANDLE:unused As DWord:End Type
259TypeDef SERVICE_STATUS_HANDLE = *_System_DeclareHandle_SERVICE_STATUS_HANDLE
260
261Const Enum SC_STATUS_TYPE
262 SC_STATUS_PROCESS_INFO = 0
263End Enum
264
265Const Enum SC_ENUM_TYPE
266 SC_ENUM_PROCESS_INFO = 0
267End Enum
268
269Type 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
277End Type
278
279Type 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
289End Type
290
291Type ENUM_SERVICE_STATUS
292 lpServiceName As LPTSTR
293 lpDisplayName As LPTSTR
294 ServiceStatus As SERVICE_STATUS
295End Type
296
297Type ENUM_SERVICE_STATUS_PROCESS
298 lpServiceName As LPTSTR
299 lpDisplayName As LPTSTR
300 ServiceStatusProcess As SERVICE_STATUS_PROCESS
301End Type
302
303TypeDef SC_LOCK = VoidPtr
304
305Type QUERY_SERVICE_LOCK_STATUS
306 fIsLocked As DWord
307 lpLockOwner As LPTSTR
308 dwLockDuration As DWord
309End Type
310
311Type 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
321End Type
322
323TypeDef LPSERVICE_MAIN_FUNCTION = *Sub(dwNumServicesArgs As DWord, lpServiceArgVectors As *LPTSTR)
324
325Type SERVICE_TABLE_ENTRY
326 lpServiceName As LPTSTR
327 lpServiceProc As LPSERVICE_MAIN_FUNCTION
328End Type
329
330TypeDef LPHANDLER_FUNCTION = *Sub(dwControl As DWord)
331
332TypeDef LPHANDLER_FUNCTION_EX = *Function(dwControl As DWord, dwEventType As DWord, lpEventData As VoidPtr, lpContext As VoidPtr) As DWord
333
334TypeDef PFN_SC_NOTIFY_CALLBACK = *Sub(pParameter As VoidPtr)
335
336Type 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
342End Type
343
344Type 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
352End Type
353
354TypeDef SERVICE_NOTIFY = SERVICE_NOTIFY_2
355
356Type SERVICE_CONTROL_STATUS_REASON_PARAMS
357 dwReason As DWord
358 pszComment As LPTSTR
359 ServiceStatus As SERVICE_STATUS_PROCESS
360End Type
361
362Declare 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
376Declare 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
382Declare Function CloseServiceHandle Lib "advapi32" (
383 /*__in*/ hSCObject As SC_HANDLE
384) As BOOL
385
386Declare 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
392Declare 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
408Declare Function DeleteService Lib "advapi32" (
409 /*__in*/ hService As SC_HANDLE
410) As BOOL
411
412Declare 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
421Declare 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
432Declare 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
445Declare 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
452Declare 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
459Declare Function LockServiceDatabase Lib "advapi32" (
460 /*__in*/ hSCManager As SC_HANDLE
461) As SC_LOCK
462
463Declare Function NotifyBootConfigStatus Lib "advapi32" (
464 /*__in*/ BootAcceptable As BOOL
465) As BOOL
466
467Declare 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
473Declare 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
479Declare 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
486Declare 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
494Declare 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
501Declare 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
509Declare Function QueryServiceStatus Lib "advapi32" (
510 /*__in*/ hService As SC_HANDLE,
511 /*__out*/ ByRef ServiceStatus As SERVICE_STATUS
512) As BOOL
513
514Declare 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
522Declare 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
527Declare 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
533Declare 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
539Declare Function SetServiceStatus Lib "advapi32" (
540 /*__in*/ hServiceStatus As SERVICE_STATUS_HANDLE,
541 /*__in*/ ByRef ServiceStatus As SERVICE_STATUS
542) As BOOL
543
544Declare Function StartServiceCtrlDispatcher Lib "advapi32" Alias _FuncName_StartServiceCtrlDispatcher (
545 /*__in CONST*/ lpServiceStartTable As *SERVICE_TABLE_ENTRY,
546) As BOOL
547
548Declare 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
554Declare Function UnlockServiceDatabase Lib "advapi32" (
555 /*__in*/ ScLock As SC_LOCK
556) As BOOL
557
558Declare 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
564Declare 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
Note: See TracBrowser for help on using the repository browser.