ReactOS  0.4.12-dev-409-g9f418243
winsvc.h
Go to the documentation of this file.
1 #ifndef _WINSVC_
2 #define _WINSVC_
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 #define SERVICES_ACTIVE_DATABASEA "ServicesActive"
8 #define SERVICES_ACTIVE_DATABASEW L"ServicesActive"
9 #define SERVICES_FAILED_DATABASEA "ServicesFailed"
10 #define SERVICES_FAILED_DATABASEW L"ServicesFailed"
11 #define SC_GROUP_IDENTIFIERA '+'
12 #define SC_GROUP_IDENTIFIERW L'+'
13 #define SC_MANAGER_ALL_ACCESS 0xf003f
14 #define SC_MANAGER_CONNECT 1
15 #define SC_MANAGER_CREATE_SERVICE 2
16 #define SC_MANAGER_ENUMERATE_SERVICE 4
17 #define SC_MANAGER_LOCK 8
18 #define SC_MANAGER_QUERY_LOCK_STATUS 16
19 #define SC_MANAGER_MODIFY_BOOT_CONFIG 32
20 #define SERVICE_NO_CHANGE 0xffffffff
21 #define SERVICE_STOPPED 1
22 #define SERVICE_START_PENDING 2
23 #define SERVICE_STOP_PENDING 3
24 #define SERVICE_RUNNING 4
25 #define SERVICE_CONTINUE_PENDING 5
26 #define SERVICE_PAUSE_PENDING 6
27 #define SERVICE_PAUSED 7
28 #define SERVICE_ACCEPT_STOP 1
29 #define SERVICE_ACCEPT_PAUSE_CONTINUE 2
30 #define SERVICE_ACCEPT_SHUTDOWN 4
31 #define SERVICE_ACCEPT_PARAMCHANGE 8
32 #define SERVICE_ACCEPT_NETBINDCHANGE 16
33 #define SERVICE_ACCEPT_HARDWAREPROFILECHANGE 32
34 #define SERVICE_ACCEPT_POWEREVENT 64
35 #define SERVICE_ACCEPT_SESSIONCHANGE 128
36 #define SERVICE_CONTROL_STOP 1
37 #define SERVICE_CONTROL_PAUSE 2
38 #define SERVICE_CONTROL_CONTINUE 3
39 #define SERVICE_CONTROL_INTERROGATE 4
40 #define SERVICE_CONTROL_SHUTDOWN 5
41 #define SERVICE_CONTROL_PARAMCHANGE 6
42 #define SERVICE_CONTROL_NETBINDADD 7
43 #define SERVICE_CONTROL_NETBINDREMOVE 8
44 #define SERVICE_CONTROL_NETBINDENABLE 9
45 #define SERVICE_CONTROL_NETBINDDISABLE 10
46 #define SERVICE_CONTROL_DEVICEEVENT 11
47 #define SERVICE_CONTROL_HARDWAREPROFILECHANGE 12
48 #define SERVICE_CONTROL_POWEREVENT 13
49 #define SERVICE_CONTROL_SESSIONCHANGE 14
50 #define SERVICE_ACTIVE 1
51 #define SERVICE_INACTIVE 2
52 #define SERVICE_STATE_ALL 3
53 #define SERVICE_QUERY_CONFIG 1
54 #define SERVICE_CHANGE_CONFIG 2
55 #define SERVICE_QUERY_STATUS 4
56 #define SERVICE_ENUMERATE_DEPENDENTS 8
57 #define SERVICE_START 16
58 #define SERVICE_STOP 32
59 #define SERVICE_PAUSE_CONTINUE 64
60 #define SERVICE_INTERROGATE 128
61 #define SERVICE_USER_DEFINED_CONTROL 256
62 #define SERVICE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SERVICE_QUERY_CONFIG|SERVICE_CHANGE_CONFIG|SERVICE_QUERY_STATUS|SERVICE_ENUMERATE_DEPENDENTS|SERVICE_START|SERVICE_STOP|SERVICE_PAUSE_CONTINUE|SERVICE_INTERROGATE|SERVICE_USER_DEFINED_CONTROL)
63 #define SERVICE_RUNS_IN_SYSTEM_PROCESS 1
64 
65 #define SERVICE_CONFIG_DESCRIPTION 1
66 #define SERVICE_CONFIG_FAILURE_ACTIONS 2
67 #define SERVICE_CONFIG_DELAYED_AUTO_START_INFO 3
68 #define SERVICE_CONFIG_FAILURE_ACTIONS_FLAG 4
69 #define SERVICE_CONFIG_SERVICE_SID_INFO 5
70 #define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO 6
71 #define SERVICE_CONFIG_PRESHUTDOWN_INFO 7
72 #define SERVICE_CONFIG_TRIGGER_INFO 8
73 #define SERVICE_CONFIG_PREFERRED_NODE 9
74 #define SERVICE_CONFIG_RUNLEVEL_INFO 10
75 
76 #define SERVICE_NOTIFY_STATUS_CHANGE_1 1
77 #define SERVICE_NOTIFY_STATUS_CHANGE_2 2
78 #define SERVICE_NOTIFY_STATUS_CHANGE SERVICE_NOTIFY_STATUS_CHANGE_2
79 
80 #define SERVICE_NOTIFY_STOPPED 1
81 #define SERVICE_NOTIFY_START_PENDING 2
82 #define SERVICE_NOTIFY_STOP_PENDING 4
83 #define SERVICE_NOTIFY_RUNNING 8
84 #define SERVICE_NOTIFY_CONTINUE_PENDING 16
85 #define SERVICE_NOTIFY_PAUSE_PENDING 32
86 #define SERVICE_NOTIFY_PAUSED 64
87 #define SERVICE_NOTIFY_CREATED 128
88 #define SERVICE_NOTIFY_DELETED 256
89 #define SERVICE_NOTIFY_DELETE_PENDING 512
90 
91 #ifndef _SERVICE_PRESHUTDOWN_INFO_DEFINED_
92 #define _SERVICE_PRESHUTDOWN_INFO_DEFINED_
93 typedef struct _SERVICE_PRESHUTDOWN_INFO {
96 #endif
97 
98 typedef struct _SERVICE_STATUS {
107 typedef struct _SERVICE_STATUS_PROCESS {
118 typedef enum _SC_STATUS_TYPE {
121 typedef enum _SC_ENUM_TYPE {
123 } SC_ENUM_TYPE;
124 typedef struct _ENUM_SERVICE_STATUSA {
129 typedef struct _ENUM_SERVICE_STATUSW {
144 typedef struct _QUERY_SERVICE_CONFIGA {
155 typedef struct _QUERY_SERVICE_CONFIGW {
178 typedef struct _SERVICE_TABLE_ENTRYA {
182 typedef struct _SERVICE_TABLE_ENTRYW {
186 DECLARE_HANDLE(SC_HANDLE);
187 typedef SC_HANDLE *LPSC_HANDLE;
188 typedef PVOID SC_LOCK;
192 typedef struct _SERVICE_DESCRIPTIONA {
195 typedef struct _SERVICE_DESCRIPTIONW {
198 typedef enum _SC_ACTION_TYPE {
204 typedef struct _SC_ACTION {
222 
226 
230 
232 typedef struct _SERVICE_NOTIFY_1 {
239 typedef struct _SERVICE_NOTIFY_2A {
248 typedef struct _SERVICE_NOTIFY_2W {
259 
268 BOOL WINAPI DeleteService(_In_ SC_HANDLE);
269 
271 BOOL
272 WINAPI
274  _In_ SC_HANDLE hService,
275  _In_ DWORD dwServiceState,
279  _Out_ LPDWORD lpServicesReturned);
280 
282 BOOL
283 WINAPI
285  _In_ SC_HANDLE hService,
286  _In_ DWORD dwServiceState,
290  _Out_ LPDWORD lpServicesReturned);
291 
293 BOOL
294 WINAPI
296  _In_ SC_HANDLE hSCManager,
297  _In_ DWORD dwServiceType,
298  _In_ DWORD dwServiceState,
302  _Out_ LPDWORD lpServicesReturned,
303  _Inout_opt_ LPDWORD lpResumeHandle);
304 
306 BOOL
307 WINAPI
309  _In_ SC_HANDLE hSCManager,
310  _In_ DWORD dwServiceType,
311  _In_ DWORD dwServiceState,
315  _Out_ LPDWORD lpServicesReturned,
316  _Inout_opt_ LPDWORD lpResumeHandle);
317 
319 BOOL
320 WINAPI
322  _In_ SC_HANDLE hSCManager,
323  _In_ SC_ENUM_TYPE InfoLevel,
324  _In_ DWORD dwServiceType,
325  _In_ DWORD dwServiceState,
329  _Out_ LPDWORD lpServicesReturned,
330  _Inout_opt_ LPDWORD lpResumeHandle,
331  _In_opt_ LPCSTR pszGroupName);
332 
334 BOOL
335 WINAPI
337  _In_ SC_HANDLE hSCManager,
338  _In_ SC_ENUM_TYPE InfoLevel,
339  _In_ DWORD dwServiceType,
340  _In_ DWORD dwServiceState,
344  _Out_ LPDWORD lpServicesReturned,
345  _Inout_opt_ LPDWORD lpResumeHandle,
346  _In_opt_ LPCWSTR pszGroupName);
347 
349 BOOL
350 WINAPI
352  _In_ SC_HANDLE hSCManager,
353  _In_ LPCSTR lpServiceName,
354  _Out_writes_opt_(*lpcchBuffer) LPSTR lpDisplayName,
355  _Inout_ LPDWORD lpcchBuffer);
356 
358 BOOL
359 WINAPI
361  _In_ SC_HANDLE hSCManager,
362  _In_ LPCWSTR lpServiceName,
363  _Out_writes_opt_(*lpcchBuffer) LPWSTR lpDisplayName,
364  _Inout_ LPDWORD lpcchBuffer);
365 
367 BOOL
368 WINAPI
370  _In_ SC_HANDLE hSCManager,
372  _Out_writes_opt_(*lpcchBuffer) LPSTR lpServiceName,
373  _Inout_ LPDWORD lpcchBuffer);
374 
376 BOOL
377 WINAPI
379  _In_ SC_HANDLE hSCManager,
381  _Out_writes_opt_(*lpcchBuffer) LPWSTR lpServiceName,
382  _Inout_ LPDWORD lpcchBuffer);
383 
390 
391 #if (NTDDI_VERSION >= NTDDI_VISTA)
394 #endif
395 
397 BOOL
398 WINAPI
400  _In_ SC_HANDLE hService,
404 
406 BOOL
407 WINAPI
409  _In_ SC_HANDLE hService,
413 
418 BOOL
419 WINAPI
421  _In_ SC_HANDLE hService,
426 
431 BOOL
432 WINAPI
434  _In_ SC_HANDLE hService,
439 
441 BOOL
442 WINAPI
444  _In_ SC_HANDLE hSCManager,
448 
450 BOOL
451 WINAPI
453  _In_ SC_HANDLE hSCManager,
457 
459 BOOL
460 WINAPI
462  _In_ SC_HANDLE hService,
463  _In_ SECURITY_INFORMATION dwSecurityInformation,
467 
469 
471 BOOL
472 WINAPI
474  _In_ SC_HANDLE hService,
475  _In_ SC_STATUS_TYPE InfoLevel,
479 
486 
487 BOOL
488 WINAPI
490  _In_ SC_HANDLE hService,
491  _In_ DWORD dwNumServiceArgs,
492  _In_reads_opt_(dwNumServiceArgs) LPCSTR *lpServiceArgVectors);
493 
494 BOOL
495 WINAPI
497  _In_ SC_HANDLE hService,
498  _In_ DWORD dwNumServiceArgs,
499  _In_reads_opt_(dwNumServiceArgs) LPCWSTR *lpServiceArgVectors);
500 
504 
505 #ifdef UNICODE
523 #define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEW
524 #define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEW
525 #define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERW
526 #define ChangeServiceConfig ChangeServiceConfigW
527 #define ChangeServiceConfig2 ChangeServiceConfig2W
528 #define CreateService CreateServiceW
529 #define EnumDependentServices EnumDependentServicesW
530 #define EnumServicesStatus EnumServicesStatusW
531 #define EnumServicesStatusEx EnumServicesStatusExW
532 #define GetServiceDisplayName GetServiceDisplayNameW
533 #define GetServiceKeyName GetServiceKeyNameW
534 #if (NTDDI_VERSION >= NTDDI_VISTA)
535 #define NotifyServiceStatusChange NotifyServiceStatusChangeW
536 #endif
537 #define OpenSCManager OpenSCManagerW
538 #define OpenService OpenServiceW
539 #define QueryServiceConfig QueryServiceConfigW
540 #define QueryServiceConfig2 QueryServiceConfig2W
541 #define QueryServiceLockStatus QueryServiceLockStatusW
542 #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW
543 #define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExW
544 #define StartService StartServiceW
545 #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW
546 #else
564 #define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEA
565 #define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEA
566 #define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERA
567 #define ChangeServiceConfig ChangeServiceConfigA
568 #define ChangeServiceConfig2 ChangeServiceConfig2A
569 #define CreateService CreateServiceA
570 #define EnumDependentServices EnumDependentServicesA
571 #define EnumServicesStatus EnumServicesStatusA
572 #define EnumServicesStatusEx EnumServicesStatusExA
573 #define GetServiceDisplayName GetServiceDisplayNameA
574 #define GetServiceKeyName GetServiceKeyNameA
575 #define OpenSCManager OpenSCManagerA
576 #define OpenService OpenServiceA
577 #if (NTDDI_VERSION >= NTDDI_VISTA)
578 #define NotifyServiceStatusChange NotifyServiceStatusChangeA
579 #endif
580 #define QueryServiceConfig QueryServiceConfigA
581 #define QueryServiceConfig2 QueryServiceConfig2A
582 #define QueryServiceLockStatus QueryServiceLockStatusA
583 #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA
584 #define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExA
585 #define StartService StartServiceA
586 #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA
587 #endif
588 #ifdef __cplusplus
589 }
590 #endif
591 #endif /* _WINSVC_H */
struct _SERVICE_PRESHUTDOWN_INFO SERVICE_PRESHUTDOWN_INFO
DWORD dwNotificationStatus
Definition: winsvc.h:252
_Must_inspect_result_ BOOL WINAPI QueryServiceLockStatusW(_In_ SC_HANDLE hSCManager, _Out_writes_bytes_opt_(cbBufSize) LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded)
LPSERVICE_MAIN_FUNCTIONW lpServiceProc
Definition: winsvc.h:184
struct _SERVICE_NOTIFY_2W SERVICE_NOTIFY_2W
BOOL WINAPI ChangeServiceConfig2W(_In_ SC_HANDLE, _In_ DWORD, _In_opt_ LPVOID)
_Must_inspect_result_ BOOL WINAPI QueryServiceObjectSecurity(_In_ SC_HANDLE hService, _In_ SECURITY_INFORMATION dwSecurityInformation, _Out_writes_bytes_opt_(cbBufSize) PSECURITY_DESCRIPTOR lpSecurityDescriptor, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded)
BOOL WINAPI ChangeServiceConfigW(_In_ SC_HANDLE, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _Out_opt_ LPDWORD, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
_In_ DWORD _In_ DWORD _Out_ LPDWORD pcbBytesNeeded
Definition: winsvc.h:424
#define _Must_inspect_result_
Definition: no_sal2.h:314
void(WINAPI * LPSERVICE_MAIN_FUNCTIONW)(DWORD, LPWSTR *)
Definition: winsvc.h:177
BOOL WINAPI CloseServiceHandle(_In_ SC_HANDLE)
struct _QUERY_SERVICE_CONFIGW QUERY_SERVICE_CONFIGW
SERVICE_TABLE_ENTRYA * LPSERVICE_TABLE_ENTRY
Definition: winsvc.h:552
BOOL WINAPI StartServiceCtrlDispatcherA(_In_ const SERVICE_TABLE_ENTRYA *)
PSERVICE_NOTIFYA PSERVICE_NOTIFY
Definition: winsvc.h:563
DWORD dwNotificationTriggered
Definition: winsvc.h:254
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
QUERY_SERVICE_CONFIGA * LPQUERY_SERVICE_CONFIG
Definition: winsvc.h:550
struct _SERVICE_DESCRIPTIONA * LPSERVICE_DESCRIPTIONA
BOOL WINAPI StartServiceW(_In_ SC_HANDLE hService, _In_ DWORD dwNumServiceArgs, _In_reads_opt_(dwNumServiceArgs) LPCWSTR *lpServiceArgVectors)
_Must_inspect_result_ SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(_In_ LPCWSTR, _In_ LPHANDLER_FUNCTION_EX, _In_opt_ LPVOID)
DWORD dwCurrentState
Definition: winsvc.h:100
SERVICE_STATUS_PROCESS ServiceStatus
Definition: winsvc.h:244
DECLARE_HANDLE(SC_HANDLE)
PFN_SC_NOTIFY_CALLBACK pfnNotifyCallback
Definition: winsvc.h:234
LPSTR lpServiceStartName
Definition: winsvc.h:152
SERVICE_DESCRIPTIONA SERVICE_DESCRIPTION
Definition: winsvc.h:554
struct _SERVICE_STATUS_PROCESS SERVICE_STATUS_PROCESS
#define DWORD
Definition: msvc.h:34
SC_ACTION * lpsaActions
Definition: winsvc.h:220
BOOL WINAPI ChangeServiceConfigA(_In_ SC_HANDLE, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _Out_opt_ LPDWORD, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR)
_SC_ENUM_TYPE
Definition: winsvc.h:121
SC_ACTION_TYPE Type
Definition: winsvc.h:205
VOID(CALLBACK * PFN_SC_NOTIFY_CALLBACK)(_In_ PVOID)
Definition: winsvc.h:231
_Must_inspect_result_ SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExA(_In_ LPCSTR, _In_ LPHANDLER_FUNCTION_EX, _In_opt_ LPVOID)
LPWSTR lpLoadOrderGroup
Definition: winsvc.h:160
struct _QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIGA
_Must_inspect_result_ BOOL WINAPI EnumServicesStatusW(_In_ SC_HANDLE hSCManager, _In_ DWORD dwServiceType, _In_ DWORD dwServiceState, _Out_writes_bytes_opt_(cbBufSize) LPENUM_SERVICE_STATUSW lpServices, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded, _Out_ LPDWORD lpServicesReturned, _Inout_opt_ LPDWORD lpResumeHandle)
enum _SC_STATUS_TYPE SC_STATUS_TYPE
struct _SERVICE_FAILURE_ACTIONSA SERVICE_FAILURE_ACTIONSA
PVOID pContext
Definition: winsvc.h:235
struct _SERVICE_DESCRIPTIONW SERVICE_DESCRIPTIONW
_In_ DWORD _Out_writes_bytes_opt_(cbBufSize) LPBYTE lpBuffer
#define CALLBACK
Definition: compat.h:27
ENUM_SERVICE_STATUSA ENUM_SERVICE_STATUS
Definition: winsvc.h:547
struct _SERVICE_STATUS * LPSERVICE_STATUS
BOOL WINAPI StartServiceA(_In_ SC_HANDLE hService, _In_ DWORD dwNumServiceArgs, _In_reads_opt_(dwNumServiceArgs) LPCSTR *lpServiceArgVectors)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
LPSERVICE_MAIN_FUNCTIONA LPSERVICE_MAIN_FUNCTION
Definition: winsvc.h:553
DWORD dwServiceSpecificExitCode
Definition: winsvc.h:103
#define SERVICE_CONFIG_DESCRIPTION
Definition: winsvc.h:65
SERVICE_REQUIRED_PRIVILEGES_INFOA SERVICE_REQUIRED_PRIVILEGES_INFO
Definition: winsvc.h:558
SERVICE_STATUS ServiceStatus
Definition: winsvc.h:127
SERVICE_NOTIFY_2A SERVICE_NOTIFYA
Definition: winsvc.h:257
BOOL WINAPI SetServiceStatus(_In_ SERVICE_STATUS_HANDLE, _In_ LPSERVICE_STATUS)
LPWSTR lpServiceName
Definition: winsvc.h:183
LPSERVICE_REQUIRED_PRIVILEGES_INFOA LPSERVICE_REQUIRED_PRIVILEGES_INFO
Definition: winsvc.h:559
char * LPSTR
Definition: xmlstorage.h:182
struct _SC_ACTION SC_ACTION
_Must_inspect_result_ BOOL WINAPI QueryServiceStatusEx(_In_ SC_HANDLE hService, _In_ SC_STATUS_TYPE InfoLevel, _Out_writes_bytes_opt_(cbBufSize) LPBYTE lpBuffer, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded)
BOOL WINAPI SetServiceObjectSecurity(_In_ SC_HANDLE, _In_ SECURITY_INFORMATION, _In_ PSECURITY_DESCRIPTOR)
enum _SC_ACTION_TYPE SC_ACTION_TYPE
QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG
Definition: winsvc.h:550
DWORD Delay
Definition: winsvc.h:206
#define _In_opt_
Definition: no_sal2.h:213
_Must_inspect_result_ BOOL WINAPI QueryServiceStatus(_In_ SC_HANDLE, _Out_ LPSERVICE_STATUS)
struct _SERVICE_REQUIRED_PRIVILEGES_INFOW * LPSERVICE_REQUIRED_PRIVILEGES_INFOW
_When_(dwInfoLevel==SERVICE_CONFIG_DESCRIPTION, _At_(cbBufSize, _In_range_(>=, sizeof(LPSERVICE_DESCRIPTIONA)))) _When_(dwInfoLevel
struct _QUERY_SERVICE_CONFIGW * LPQUERY_SERVICE_CONFIGW
struct _QUERY_SERVICE_LOCK_STATUSA * LPQUERY_SERVICE_LOCK_STATUSA
struct _SERVICE_TABLE_ENTRYA * LPSERVICE_TABLE_ENTRYA
struct _SERVICE_PRESHUTDOWN_INFO * LPSERVICE_PRESHUTDOWN_INFO
LPENUM_SERVICE_STATUS_PROCESSA LPENUM_SERVICE_STATUS_PROCESS
Definition: winsvc.h:549
struct _SERVICE_REQUIRED_PRIVILEGES_INFOW SERVICE_REQUIRED_PRIVILEGES_INFOW
_Must_inspect_result_ BOOL WINAPI EnumServicesStatusA(_In_ SC_HANDLE hSCManager, _In_ DWORD dwServiceType, _In_ DWORD dwServiceState, _Out_writes_bytes_opt_(cbBufSize) LPENUM_SERVICE_STATUSA lpServices, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded, _Out_ LPDWORD lpServicesReturned, _Inout_opt_ LPDWORD lpResumeHandle)
DWORD WINAPI NotifyServiceStatusChangeW(_In_ SC_HANDLE, _In_ DWORD, _In_ PSERVICE_NOTIFYW)
DWORD dwCheckPoint
Definition: winsvc.h:104
unsigned char * LPBYTE
Definition: typedefs.h:52
PVOID SC_LOCK
Definition: winsvc.h:188
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
LPSERVICE_MAIN_FUNCTIONA lpServiceProc
Definition: winsvc.h:180
PFN_SC_NOTIFY_CALLBACK pfnNotifyCallback
Definition: winsvc.h:241
#define SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO
Definition: winsvc.h:70
SERVICE_NOTIFY_2W * PSERVICE_NOTIFYW
Definition: winsvc.h:258
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:163
ENUM_SERVICE_STATUSA * LPENUM_SERVICE_STATUS
Definition: winsvc.h:547
struct _SERVICE_NOTIFY_2W * PSERVICE_NOTIFY_2W
SERVICE_NOTIFY_2W SERVICE_NOTIFYW
Definition: winsvc.h:258
SERVICE_STATUS_PROCESS ServiceStatus
Definition: winsvc.h:237
BOOL WINAPI QueryServiceConfig2A(SC_HANDLE hService, DWORD dwInfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
Definition: scm.c:2317
QUERY_SERVICE_LOCK_STATUSA QUERY_SERVICE_LOCK_STATUS
Definition: winsvc.h:551
struct _ENUM_SERVICE_STATUSW * LPENUM_SERVICE_STATUSW
#define _Out_
Definition: no_sal2.h:323
_SC_STATUS_TYPE
Definition: winsvc.h:118
BOOL WINAPI UnlockServiceDatabase(_In_ SC_LOCK)
struct _ENUM_SERVICE_STATUS_PROCESSA ENUM_SERVICE_STATUS_PROCESSA
_Must_inspect_result_ SC_HANDLE WINAPI CreateServiceW(_In_ SC_HANDLE, _In_ LPCWSTR, _In_opt_ LPCWSTR, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _Out_opt_ PDWORD, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
struct _QUERY_SERVICE_CONFIGA * LPQUERY_SERVICE_CONFIGA
const char * LPCSTR
Definition: xmlstorage.h:183
void * PVOID
Definition: retypes.h:9
struct _SERVICE_TABLE_ENTRYW * LPSERVICE_TABLE_ENTRYW
struct _SERVICE_NOTIFY_1 * PSERVICE_NOTIFY_1
SERVICE_FAILURE_ACTIONSA SERVICE_FAILURE_ACTIONS
Definition: winsvc.h:556
static SERVICE_STATUS_HANDLE(WINAPI *pRegisterServiceCtrlHandlerExA)(LPCSTR
#define _Out_opt_
Definition: no_sal2.h:339
struct _SERVICE_TABLE_ENTRYW SERVICE_TABLE_ENTRYW
unsigned int BOOL
Definition: ntddk_ex.h:94
struct _QUERY_SERVICE_LOCK_STATUSW QUERY_SERVICE_LOCK_STATUSW
SC_HANDLE * LPSC_HANDLE
Definition: winsvc.h:187
enum _SC_ENUM_TYPE SC_ENUM_TYPE
Definition: service.c:43
struct _SERVICE_DESCRIPTIONW * LPSERVICE_DESCRIPTIONW
DWORD(WINAPI * LPHANDLER_FUNCTION_EX)(DWORD, DWORD, LPVOID, LPVOID)
Definition: winsvc.h:191
SERVICE_NOTIFY_2A SERVICE_NOTIFY_2
Definition: winsvc.h:560
struct _ENUM_SERVICE_STATUS_PROCESSA * LPENUM_SERVICE_STATUS_PROCESSA
DWORD dwWaitHint
Definition: winsvc.h:105
_Must_inspect_result_ SC_HANDLE WINAPI OpenSCManagerW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ DWORD)
DWORD WINAPI NotifyServiceStatusChangeA(_In_ SC_HANDLE, _In_ DWORD, _In_ PSERVICE_NOTIFYA)
struct _SERVICE_FAILURE_ACTIONSW SERVICE_FAILURE_ACTIONSW
_Must_inspect_result_ BOOL WINAPI GetServiceDisplayNameW(_In_ SC_HANDLE hSCManager, _In_ LPCWSTR lpServiceName, _Out_writes_opt_(*lpcchBuffer) LPWSTR lpDisplayName, _Inout_ LPDWORD lpcchBuffer)
DWORD dwWin32ExitCode
Definition: winsvc.h:102
#define SERVICE_CONFIG_FAILURE_ACTIONS
Definition: winsvc.h:66
BOOL WINAPI StartServiceCtrlDispatcherW(_In_ const SERVICE_TABLE_ENTRYW *)
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ DWORD _In_ DWORD cbBufSize
Definition: winsvc.h:424
SERVICE_STATUS_PROCESS ServiceStatusProcess
Definition: winsvc.h:142
_Must_inspect_result_ BOOL WINAPI EnumDependentServicesW(_In_ SC_HANDLE hService, _In_ DWORD dwServiceState, _Out_writes_bytes_opt_(cbBufSize) LPENUM_SERVICE_STATUSW lpServices, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded, _Out_ LPDWORD lpServicesReturned)
_Must_inspect_result_ BOOL WINAPI EnumServicesStatusExW(_In_ SC_HANDLE hSCManager, _In_ SC_ENUM_TYPE InfoLevel, _In_ DWORD dwServiceType, _In_ DWORD dwServiceState, _Out_writes_bytes_opt_(cbBufSize) LPBYTE lpServices, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded, _Out_ LPDWORD lpServicesReturned, _Inout_opt_ LPDWORD lpResumeHandle, _In_opt_ LPCWSTR pszGroupName)
DWORD dwServiceType
Definition: winsvc.h:99
struct _SERVICE_NOTIFY_2A SERVICE_NOTIFY_2A
#define _Inout_
Definition: no_sal2.h:244
SERVICE_NOTIFYA SERVICE_NOTIFY
Definition: winsvc.h:562
_Must_inspect_result_ SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerA(_In_ LPCSTR, _In_ LPHANDLER_FUNCTION)
#define LPVOID
Definition: nt_native.h:45
_Must_inspect_result_ BOOL WINAPI GetServiceKeyNameW(_In_ SC_HANDLE hSCManager, _In_ LPCWSTR lpDisplayName, _Out_writes_opt_(*lpcchBuffer) LPWSTR lpServiceName, _Inout_ LPDWORD lpcchBuffer)
struct _ENUM_SERVICE_STATUSW ENUM_SERVICE_STATUSW
LPWSTR lpDescription
Definition: winsvc.h:196
_SC_ACTION_TYPE
Definition: winsvc.h:198
struct _SERVICE_REQUIRED_PRIVILEGES_INFOA * LPSERVICE_REQUIRED_PRIVILEGES_INFOA
void(WINAPI * LPSERVICE_MAIN_FUNCTIONA)(DWORD, LPSTR *)
Definition: winsvc.h:176
struct _ENUM_SERVICE_STATUS_PROCESSW * LPENUM_SERVICE_STATUS_PROCESSW
_At_(cbBufSize, _In_range_(>=, sizeof(LPSERVICE_FAILURE_ACTIONSA)))) _When_(dwInfoLevel
_Must_inspect_result_ BOOL WINAPI QueryServiceConfigW(_In_ SC_HANDLE hService, _Out_writes_bytes_opt_(cbBufSize) LPQUERY_SERVICE_CONFIGW lpServiceConfig, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded)
_Must_inspect_result_ BOOL WINAPI EnumServicesStatusExA(_In_ SC_HANDLE hSCManager, _In_ SC_ENUM_TYPE InfoLevel, _In_ DWORD dwServiceType, _In_ DWORD dwServiceState, _Out_writes_bytes_opt_(cbBufSize) LPBYTE lpServices, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded, _Out_ LPDWORD lpServicesReturned, _Inout_opt_ LPDWORD lpResumeHandle, _In_opt_ LPCSTR pszGroupName)
_Must_inspect_result_ BOOL WINAPI EnumDependentServicesA(_In_ SC_HANDLE hService, _In_ DWORD dwServiceState, _Out_writes_bytes_opt_(cbBufSize) LPENUM_SERVICE_STATUSA lpServices, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded, _Out_ LPDWORD lpServicesReturned)
#define VOID
Definition: acefi.h:82
BOOL WINAPI QueryServiceConfig2W(SC_HANDLE hService, DWORD dwInfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
Definition: scm.c:2434
PFN_SC_NOTIFY_CALLBACK pfnNotifyCallback
Definition: winsvc.h:250
LPWSTR pszServiceNames
Definition: winsvc.h:255
SERVICE_STATUS ServiceStatus
Definition: winsvc.h:132
_In_ DWORD dwInfoLevel
Definition: winsvc.h:422
SC_HANDLE hSCManager
Definition: sc.c:12
#define WINAPI
Definition: msvc.h:20
_Must_inspect_result_ BOOL WINAPI GetServiceDisplayNameA(_In_ SC_HANDLE hSCManager, _In_ LPCSTR lpServiceName, _Out_writes_opt_(*lpcchBuffer) LPSTR lpDisplayName, _Inout_ LPDWORD lpcchBuffer)
struct _QUERY_SERVICE_LOCK_STATUSA QUERY_SERVICE_LOCK_STATUSA
struct _SERVICE_NOTIFY_1 SERVICE_NOTIFY_1
_Must_inspect_result_ SC_HANDLE WINAPI CreateServiceA(_In_ SC_HANDLE, _In_ LPCSTR, _In_opt_ LPCSTR, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _Out_opt_ PDWORD, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_opt_ LPCSTR)
struct _SERVICE_DESCRIPTIONA SERVICE_DESCRIPTIONA
BOOL WINAPI DeleteService(_In_ SC_HANDLE)
#define _In_
Definition: no_sal2.h:204
PSERVICE_NOTIFY_2A PSERVICE_NOTIFY_2
Definition: winsvc.h:561
DWORD dwControlsAccepted
Definition: winsvc.h:101
SC_ACTION * lpsaActions
Definition: winsvc.h:213
LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS
Definition: winsvc.h:557
LPSTR pszServiceNames
Definition: winsvc.h:246
SC_LOCK WINAPI LockServiceDatabase(_In_ SC_HANDLE)
DWORD dwVersion
Definition: winsvc.h:233
_Must_inspect_result_ SC_HANDLE WINAPI OpenServiceA(_In_ SC_HANDLE, _In_ LPCSTR, _In_ DWORD)
struct _SERVICE_REQUIRED_PRIVILEGES_INFOA SERVICE_REQUIRED_PRIVILEGES_INFOA
_In_ UINT _Out_writes_opt_(cch) LPSTR lpszFile
SERVICE_NOTIFY_2A * PSERVICE_NOTIFYA
Definition: winsvc.h:257
SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY
Definition: winsvc.h:552
LPWSTR lpServiceName
Definition: winsvc.h:130
ENUM_SERVICE_STATUS_PROCESSA ENUM_SERVICE_STATUS_PROCESS
Definition: winsvc.h:548
DWORD dwNotificationStatus
Definition: winsvc.h:236
LPWSTR lpDisplayName
Definition: winsvc.h:131
QUERY_SERVICE_LOCK_STATUSA * LPQUERY_SERVICE_LOCK_STATUS
Definition: winsvc.h:551
_Must_inspect_result_ SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerW(_In_ LPCWSTR, _In_ LPHANDLER_FUNCTION)
DWORD dwNotificationTriggered
Definition: winsvc.h:245
_Must_inspect_result_ BOOL WINAPI QueryServiceLockStatusA(_In_ SC_HANDLE hSCManager, _Out_writes_bytes_opt_(cbBufSize) LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded)
struct _SERVICE_FAILURE_ACTIONSW * LPSERVICE_FAILURE_ACTIONSW
struct _ENUM_SERVICE_STATUSA * LPENUM_SERVICE_STATUSA
_Must_inspect_result_ BOOL WINAPI QueryServiceConfigA(_In_ SC_HANDLE hService, _Out_writes_bytes_opt_(cbBufSize) LPQUERY_SERVICE_CONFIGA lpServiceConfig, _In_ DWORD cbBufSize, _Out_ LPDWORD pcbBytesNeeded)
DWORD * PDWORD
Definition: pedump.c:68
LPWSTR lpServiceStartName
Definition: winsvc.h:163
BOOL WINAPI ControlService(_In_ SC_HANDLE, _In_ DWORD, _Out_ LPSERVICE_STATUS)
struct _QUERY_SERVICE_LOCK_STATUSW * LPQUERY_SERVICE_LOCK_STATUSW
struct _ENUM_SERVICE_STATUS_PROCESSW ENUM_SERVICE_STATUS_PROCESSW
#define _In_reads_opt_(size)
Definition: no_sal2.h:231
VOID(WINAPI * LPHANDLER_FUNCTION)(DWORD)
Definition: winsvc.h:190
struct _SERVICE_NOTIFY_2A * PSERVICE_NOTIFY_2A
struct _SERVICE_STATUS_PROCESS * LPSERVICE_STATUS_PROCESS
uint32_t * LPDWORD
Definition: typedefs.h:57
_Must_inspect_result_ SC_HANDLE WINAPI OpenSCManagerA(_In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ DWORD)
LPSERVICE_DESCRIPTIONA LPSERVICE_DESCRIPTION
Definition: winsvc.h:555
SERVICE_STATUS_PROCESS ServiceStatus
Definition: winsvc.h:253
LPWSTR lpBinaryPathName
Definition: winsvc.h:159
_Must_inspect_result_ BOOL WINAPI GetServiceKeyNameA(_In_ SC_HANDLE hSCManager, _In_ LPCSTR lpDisplayName, _Out_writes_opt_(*lpcchBuffer) LPSTR lpServiceName, _Inout_ LPDWORD lpcchBuffer)
struct _SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRYA
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define _In_range_(lb, ub)
Definition: no_sal2.h:227
BOOL WINAPI ChangeServiceConfig2A(_In_ SC_HANDLE, _In_ DWORD, _In_opt_ LPVOID)
DWORD dwServiceSpecificExitCode
Definition: winsvc.h:112
struct _ENUM_SERVICE_STATUSA ENUM_SERVICE_STATUSA
SERVICE_STATUS_PROCESS ServiceStatusProcess
Definition: winsvc.h:137
_Must_inspect_result_ SC_HANDLE WINAPI OpenServiceW(_In_ SC_HANDLE, _In_ LPCWSTR, _In_ DWORD)
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
Definition: winbase.h:2730
struct _SERVICE_STATUS SERVICE_STATUS
struct _SC_ACTION * LPSC_ACTION
DWORD dwNotificationStatus
Definition: winsvc.h:243
struct _SERVICE_FAILURE_ACTIONSA * LPSERVICE_FAILURE_ACTIONSA
BOOL WINAPI NotifyBootConfigStatus(_In_ BOOL)
#define _Inout_opt_
Definition: no_sal2.h:258