From f827d65e12435f5f8d48cdbffce3e5b6b2a4fd45 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Fri, 11 Jan 2002 10:17:27 +0000 Subject: [PATCH] 2001-12-30 Guido Serassio * include/winsvc.h: Add EnumServiceStatusEx(), QueryServiceStatusEx() & RegisterServiceCtrlHandlerEx() --- winsup/w32api/ChangeLog | 6 ++++ winsup/w32api/include/winsvc.h | 56 ++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog index c22895fe2..87db75be8 100644 --- a/winsup/w32api/ChangeLog +++ b/winsup/w32api/ChangeLog @@ -1,3 +1,9 @@ +2001-12-30 Guido Serassio + + * include/winsvc.h: Add EnumServiceStatusEx(), + QueryServiceStatusEx() + & RegisterServiceCtrlHandlerEx() + 2001-12-21 Robert Collins * include/wingdi.h: Add GetRandomRgn and SYSRGN. diff --git a/winsup/w32api/include/winsvc.h b/winsup/w32api/include/winsvc.h index b3d1503ed..63af9584e 100644 --- a/winsup/w32api/include/winsvc.h +++ b/winsup/w32api/include/winsvc.h @@ -27,11 +27,25 @@ extern "C" { #define SERVICE_ACCEPT_STOP 1 #define SERVICE_ACCEPT_PAUSE_CONTINUE 2 #define SERVICE_ACCEPT_SHUTDOWN 4 +#define SERVICE_ACCEPT_PARAMCHANGE 8 +#define SERVICE_ACCEPT_NETBINDCHANGE 16 +#define SERVICE_ACCEPT_HARDWAREPROFILECHANGE 32 +#define SERVICE_ACCEPT_POWEREVENT 64 +#define SERVICE_ACCEPT_SESSIONCHANGE 128 #define SERVICE_CONTROL_STOP 1 #define SERVICE_CONTROL_PAUSE 2 #define SERVICE_CONTROL_CONTINUE 3 #define SERVICE_CONTROL_INTERROGATE 4 #define SERVICE_CONTROL_SHUTDOWN 5 +#define SERVICE_CONTROL_PARAMCHANGE 6 +#define SERVICE_CONTROL_NETBINDADD 7 +#define SERVICE_CONTROL_NETBINDREMOVE 8 +#define SERVICE_CONTROL_NETBINDENABLE 9 +#define SERVICE_CONTROL_NETBINDDISABLE 10 +#define SERVICE_CONTROL_DEVICEEVENT 11 +#define SERVICE_CONTROL_HARDWAREPROFILECHANGE 12 +#define SERVICE_CONTROL_POWEREVENT 13 +#define SERVICE_CONTROL_SESSIONCHANGE 14 #define SERVICE_ACTIVE 1 #define SERVICE_INACTIVE 2 #define SERVICE_STATE_ALL 3 @@ -45,6 +59,7 @@ extern "C" { #define SERVICE_INTERROGATE 128 #define SERVICE_USER_DEFINED_CONTROL 256 #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) +#define SERVICE_RUNS_IN_SYSTEM_PROCESS 1 #define SERVICE_CONFIG_DESCRIPTION 1 #define SERVICE_CONFIG_FAILURE_ACTIONS 2 @@ -57,6 +72,23 @@ typedef struct _SERVICE_STATUS { DWORD dwCheckPoint; DWORD dwWaitHint; } SERVICE_STATUS,*LPSERVICE_STATUS; +typedef struct _SERVICE_STATUS_PROCESS { + DWORD dwServiceType; + DWORD dwCurrentState; + DWORD dwControlsAccepted; + DWORD dwWin32ExitCode; + DWORD dwServiceSpecificExitCode; + DWORD dwCheckPoint; + DWORD dwWaitHint; + DWORD dwProcessId; + DWORD dwServiceFlags; +} SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS; +typedef enum _SC_STATUS_TYPE { + SC_STATUS_PROCESS_INFO = 0 +} SC_STATUS_TYPE; +typedef enum _SC_ENUM_TYPE { + SC_ENUM_PROCESS_INFO = 0 +} SC_ENUM_TYPE; typedef struct _ENUM_SERVICE_STATUSA { LPSTR lpServiceName; LPSTR lpDisplayName; @@ -67,6 +99,16 @@ typedef struct _ENUM_SERVICE_STATUSW { LPWSTR lpDisplayName; SERVICE_STATUS ServiceStatus; } ENUM_SERVICE_STATUSW,*LPENUM_SERVICE_STATUSW; +typedef struct _ENUM_SERVICE_STATUS_PROCESSA { + LPSTR lpServiceName; + LPSTR lpDisplayName; + SERVICE_STATUS_PROCESS ServiceStatusProcess; +} ENUM_SERVICE_STATUS_PROCESSA,*LPENUM_SERVICE_STATUS_PROCESSA; +typedef struct _ENUM_SERVICE_STATUS_PROCESSW { + LPWSTR lpServiceName; + LPWSTR lpDisplayName; + SERVICE_STATUS_PROCESS ServiceStatusProcess; +} ENUM_SERVICE_STATUS_PROCESSW,*LPENUM_SERVICE_STATUS_PROCESSW; typedef struct _QUERY_SERVICE_CONFIGA { DWORD dwServiceType; DWORD dwStartType; @@ -114,6 +156,7 @@ typedef SC_HANDLE *LPSC_HANDLE; typedef PVOID SC_LOCK; typedef DWORD SERVICE_STATUS_HANDLE; typedef VOID(WINAPI *LPHANDLER_FUNCTION)(DWORD); +typedef DWORD (WINAPI *LPHANDLER_FUNCTION_EX)(DWORD,DWORD,LPVOID,LPVOID); typedef struct _SERVICE_DESCRIPTIONA { LPSTR lpDescription; } SERVICE_DESCRIPTIONA,*LPSERVICE_DESCRIPTIONA; @@ -158,6 +201,8 @@ BOOL WINAPI EnumDependentServicesA(SC_HANDLE,DWORD,LPENUM_SERVICE_STATUSA,DWORD, BOOL WINAPI EnumDependentServicesW(SC_HANDLE,DWORD,LPENUM_SERVICE_STATUSW,DWORD,PDWORD,PDWORD); BOOL WINAPI EnumServicesStatusA(SC_HANDLE,DWORD,DWORD,LPENUM_SERVICE_STATUSA,DWORD,PDWORD,PDWORD,PDWORD); BOOL WINAPI EnumServicesStatusW(SC_HANDLE,DWORD,DWORD,LPENUM_SERVICE_STATUSW,DWORD,PDWORD,PDWORD,PDWORD); +BOOL WINAPI EnumServicesStatusExA(SC_HANDLE,SC_ENUM_TYPE,DWORD,DWORD,LPBYTE,DWORD,LPDWORD,LPDWORD,LPDWORD,LPCSTR); +BOOL WINAPI EnumServicesStatusExW(SC_HANDLE,SC_ENUM_TYPE,DWORD,DWORD,LPBYTE,DWORD,LPDWORD,LPDWORD,LPDWORD,LPCWSTR); BOOL WINAPI GetServiceDisplayNameA(SC_HANDLE,LPCSTR,LPSTR,PDWORD); BOOL WINAPI GetServiceDisplayNameW(SC_HANDLE,LPCWSTR,LPWSTR,PDWORD); BOOL WINAPI GetServiceKeyNameA(SC_HANDLE,LPCSTR,LPSTR,PDWORD); @@ -176,8 +221,11 @@ BOOL WINAPI QueryServiceLockStatusA(SC_HANDLE,LPQUERY_SERVICE_LOCK_STATUSA,DWORD BOOL WINAPI QueryServiceLockStatusW(SC_HANDLE,LPQUERY_SERVICE_LOCK_STATUSW,DWORD,PDWORD); BOOL WINAPI QueryServiceObjectSecurity(SC_HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD); BOOL WINAPI QueryServiceStatus(SC_HANDLE,LPSERVICE_STATUS); +BOOL WINAPI QueryServiceStatusEx(SC_HANDLE,SC_STATUS_TYPE,LPBYTE,DWORD,LPDWORD); SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerA(LPCSTR,LPHANDLER_FUNCTION); SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerW(LPCWSTR,LPHANDLER_FUNCTION); +SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExA(LPCSTR,LPHANDLER_FUNCTION_EX,LPVOID); +SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR,LPHANDLER_FUNCTION_EX,LPVOID); BOOL WINAPI SetServiceObjectSecurity(SC_HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE,LPSERVICE_STATUS); BOOL WINAPI StartServiceA(SC_HANDLE,DWORD,LPCSTR*); @@ -188,6 +236,8 @@ BOOL WINAPI UnlockServiceDatabase(SC_LOCK); #ifdef UNICODE typedef ENUM_SERVICE_STATUSW ENUM_SERVICE_STATUS,*LPENUM_SERVICE_STATUS; +typedef ENUM_SERVICE_STATUS_PROCESSW ENUM_SERVICE_STATUS_PROCESS; +typedef LPENUM_SERVICE_STATUS_PROCESSW LPENUM_SERVICE_STATUS_PROCESS; typedef QUERY_SERVICE_CONFIGW QUERY_SERVICE_CONFIG,*LPQUERY_SERVICE_CONFIG; typedef QUERY_SERVICE_LOCK_STATUSW QUERY_SERVICE_LOCK_STATUS,*LPQUERY_SERVICE_LOCK_STATUS; typedef SERVICE_TABLE_ENTRYW SERVICE_TABLE_ENTRY,*LPSERVICE_TABLE_ENTRY; @@ -204,6 +254,7 @@ typedef LPSERVICE_FAILURE_ACTIONSW LPSERVICE_FAILURE_ACTIONS; #define CreateService CreateServiceW #define EnumDependentServices EnumDependentServicesW #define EnumServicesStatus EnumServicesStatusW +#define EnumServicesStatusEx EnumServicesStatusExW #define GetServiceDisplayName GetServiceDisplayNameW #define GetServiceKeyName GetServiceKeyNameW #define OpenSCManager OpenSCManagerW @@ -212,10 +263,13 @@ typedef LPSERVICE_FAILURE_ACTIONSW LPSERVICE_FAILURE_ACTIONS; #define QueryServiceConfig2 QueryServiceConfig2W #define QueryServiceLockStatus QueryServiceLockStatusW #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW +#define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExW #define StartService StartServiceW #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW #else typedef ENUM_SERVICE_STATUSA ENUM_SERVICE_STATUS,*LPENUM_SERVICE_STATUS; +typedef ENUM_SERVICE_STATUS_PROCESSA ENUM_SERVICE_STATUS_PROCESS; +typedef LPENUM_SERVICE_STATUS_PROCESSA LPENUM_SERVICE_STATUS_PROCESS; typedef QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG,*LPQUERY_SERVICE_CONFIG; typedef QUERY_SERVICE_LOCK_STATUSA QUERY_SERVICE_LOCK_STATUS,*LPQUERY_SERVICE_LOCK_STATUS; typedef SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY,*LPSERVICE_TABLE_ENTRY; @@ -232,6 +286,7 @@ typedef LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS; #define CreateService CreateServiceA #define EnumDependentServices EnumDependentServicesA #define EnumServicesStatus EnumServicesStatusA +#define EnumServicesStatusEx EnumServicesStatusExA #define GetServiceDisplayName GetServiceDisplayNameA #define GetServiceKeyName GetServiceKeyNameA #define OpenSCManager OpenSCManagerA @@ -240,6 +295,7 @@ typedef LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS; #define QueryServiceConfig2 QueryServiceConfig2A #define QueryServiceLockStatus QueryServiceLockStatusA #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA +#define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExA #define StartService StartServiceA #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA #endif -- 2.43.5