Stores information about windows services into an array.
AServices(cArrayName, [cServer [, cDatabase [, nServiceState [, nServiceType]]]])
Parameters
- cArrayName
On return the array contains the following information from the ENUM_SERVICE_STATUS_PROCESS or ENUM_SERVICE_STATUS structure.
Column Content 1 ServiceName 2 DisplayName 3 ServiceType 4 CurrentState 5 Win32ExitCode 6 ServiceSpecificExitCode 7 CheckPoint 8 ControlsAccepted 9 ServiceFlags 10 ProcessId
- cServer (optional)
The server name on which the service is running.
See MSDN help for OpenSCManager.
- cDatabase (optional)
The database under which the service is registered.
See MSDN help for OpenSCManager.
- nServiceState (optional)
default = SERVICE_STATE_ALL
One of the following values. ServiceState Description SERVICE_ACTIVE Enumerate only running servies. SERVICE_INACTIVE Enumerate only stopped services. SERVICE_STATE_ALL Enumerate all services.
- nServiceType (optional, additive)
default = SERVICE_WIN32
One or a combination of the following values. ServiceType Description SERVICE_DRIVER Enumerates services of type SERVICE_KERNEL_DRIVER and SERVICE_FILE_SYSTEM_DRIVER. SERVICE_WIN32 Enumerates services of type SERVICE_WIN32_OWN_PROCESS and SERVICE_WIN32_SHARE_PROCESS.
Return Value
The number of services.
See Also
Reference
ADependentServices
AServiceConfig
AServiceStatus
CloseServiceHandle
ContinueService
ControlService
CreateService
OpenService
PauseService
StartService
StopService
WaitForServiceStatus
Used WinApi functions
EnumServicesStatusEx if supported, otherwise
EnumServicesStatus
OpenSCManager
CloseServiceHandle