Click or drag to resize
Xcalibur Systems LLC Logo

ServiceHelperEnumServicesStatusEx Method

Enumerates services in the specified service control manager database. The name and status of each service are provided, along with additional data based on the specified information level.

EnumServicesStatusEx function


Namespace: Xcalibur.NativeMethods.V2.Services
Assembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax
[DllImportAttribute("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static bool EnumServicesStatusEx(
	IntPtr managerHandle,
	int infoLevel,
	ServiceTypes serviceType,
	ServiceStates serviceState,
	IntPtr servicesPointer,
	uint bufferSize,
	out uint bytesNeeded,
	out uint servicesReturnedPointer,
	ref uint resumeHandle,
	string groupName
)

Parameters

managerHandle  IntPtr
A handle to the service control manager database.
infoLevel  Int32
The service attributes that are to be returned. Use SC_ENUM_PROCESS_INFO to retrieve the name and service status information for each service in the database. The lpServices parameter is a pointer to a buffer that receives an array of structures. The buffer must be large enough to hold the structures as well as the strings to which their members point.
serviceType  ServiceTypes
The type of services to be enumerated.
serviceState  ServiceStates
The state of the services to be enumerated.
servicesPointer  IntPtr
A pointer to the buffer that receives the status information. The format of this data depends on the value of the infoLevel parameter.
bufferSize  UInt32
The size of the buffer pointed to by the servicesPointer parameter, in bytes.
bytesNeeded  UInt32
A pointer to a variable that receives the number of bytes needed to return the remaining service entries, if the buffer is too small.
servicesReturnedPointer  UInt32
A pointer to a variable that receives the number of service entries returned.
resumeHandle  UInt32
A pointer to a variable that, on input, specifies the starting point of enumeration.
groupName  String
The load-order group name. If this parameter is a string, the only services enumerated are those that belong to the group that has the name specified by the string. If this parameter is an empty string, only services that do not belong to any group are enumerated. If this parameter is NULL, group membership is ignored and all services are enumerated.

Return Value

Boolean
If the function fails, the return value is zero. To get extended error information, call .
See Also