function enumerates services that depend on another specified service; that
is, the specified service must be running before the enumerated services can
run. The name and status of each dependent service are provided.
| SC_HANDLE hService,
||// handle to service
| DWORD dwServiceState,
||// state of services to enumerate
| LPENUM_SERVICE_STATUS lpServices,
||// pointer to service status buffer
| DWORD cbBufSize,
||// size of service status buffer
| LPDWORD pcbBytesNeeded,
||// pointer to variable for bytes needed
| LPDWORD lpServicesReturned
||// pointer to variable for number returned
Handle that identifies the service. This handle is returned by the OpenService
function, and it must have SERVICE_ENUMERATE_DEPENDENTS access.
Specifies the services to enumerate based on their running state. It must be
one or both of the following values:
||Enumerates services that are in the following states: SERVICE_START_PENDING,
SERVICE_STOP_PENDING, SERVICE_RUNNING, SERVICE_CONTINUE_PENDING,
SERVICE_PAUSE_PENDING, and SERVICE_PAUSED.
||Enumerates services that are in the SERVICE_STOPPED state.
Pointer to an array of ENUM_SERVICE_STATUS
structures. Each structure receives name and service status information for a
dependent service. The order of the services in this array is the reverse of
the start order of the services. In other words, the first dependent service in
the array is the one that would be started last, and the last service in the
array is the one that would be started first.
Specifies the size, in bytes, of the buffer pointed to by the lpServices
Pointer to a variable that receives the number of bytes needed to store the
array of service entries. The variable only receives this value if the buffer
pointed to by lpServices
is too small, indicated by function failure and the ERROR_MORE_DATA error;
otherwise, the contents of *pcbBytesNeeded
Pointer to a variable that receives the number of service entries returned.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error
information, call GetLastError
The following error codes may be set by the service control manager. Other
error codes may be set by the registry functions that are called by the service
||The specified handle was not opened with SERVICE_ENUMERATE_DEPENDENTS access.
||The specified handle is invalid.
||A parameter that was specified is invalid.
||The buffer pointed to by lpServices is not large enough. The function sets the variable pointed to by lpServicesReturned to the actual number of service entries stored into the buffer. The function
sets the variable pointed to by pcbBytesNeeded to the number of bytes required to store all of the service entries.
The returned services entries are ordered in the reverse order of the start
order, with group order taken into account. If you need to stop the dependent
services, you can use the order of entries written to the lpServices
buffer to stop the dependent services in the proper order.
- Software for developers
Software for Android Developers
- More information resources
Unix Manual Pages
- Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database