![Xcalibur Systems LLC Logo](../icons/logo.png) |
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.ServicesAssembly: 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
)
<DllImportAttribute("advapi32.dll", CharSet := CharSet.Auto, SetLastError := true>]
Public Shared Function EnumServicesStatusEx (
managerHandle As IntPtr,
infoLevel As Integer,
serviceType As ServiceTypes,
serviceState As ServiceStates,
servicesPointer As IntPtr,
bufferSize As UInteger,
<OutAttribute> ByRef bytesNeeded As UInteger,
<OutAttribute> ByRef servicesReturnedPointer As UInteger,
ByRef resumeHandle As UInteger,
groupName As String
) As Boolean
public:
[DllImportAttribute(L"advapi32.dll", CharSet = CharSet::Auto, SetLastError = true)]
static bool EnumServicesStatusEx(
IntPtr managerHandle,
int infoLevel,
ServiceTypes serviceType,
ServiceStates serviceState,
IntPtr servicesPointer,
unsigned int bufferSize,
[OutAttribute] unsigned int% bytesNeeded,
[OutAttribute] unsigned int% servicesReturnedPointer,
unsigned int% resumeHandle,
String^ groupName
)
[<DllImportAttribute("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)>]
static member EnumServicesStatusEx :
managerHandle : IntPtr *
infoLevel : int *
serviceType : ServiceTypes *
serviceState : ServiceStates *
servicesPointer : IntPtr *
bufferSize : uint32 *
bytesNeeded : uint32 byref *
servicesReturnedPointer : uint32 byref *
resumeHandle : uint32 byref *
groupName : string -> bool
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
BooleanIf the function fails, the return value is zero. To get extended error
information, call .
See Also