EnumServicesStatus

编辑:浦口网互动百科 时间:2019-12-15 04:00:44
编辑 锁定
EnumServicesStatus是一个函数,主要功能:枚举当前系统服务
外文名
EnumServicesStatus
分    类
函数
功    能
枚举当前系统服务
备    注
参数介绍

EnumServicesStatus函数原型

编辑
BOOL WINAPI EnumServicesStatus(
__in SC_HANDLE hSCManager,
__in DWORD dwServiceType,
__in DWORD dwServiceState,
__out LPENUM_SERVICE_STATUS lpServices,
__in DWORD cbBufSize,
__out LPDWORD pcbBytesNeeded,
__out LPDWORD lpServicesReturned,
__in_out LPDWORD lpResumeHandle
);

EnumServicesStatus函数功能

编辑
主要功能:枚举当前系统服务

EnumServicesStatus参数介绍

编辑
hSCManager :
A handle to the service control manager database. This handle is returned by the OpenSCManager function, and must have the SC_MANAGER_ENUMERATE_SERVICE access right. For more information, see Service Security and Access Rights.
dwServiceType :
The type of services to be enumerated. This parameter can be one or more of the following values.
Value
Meaning
SERVICE_DRIVER
0x0000000B
Enumerates services of type SERVICE_KERNEL_DRIVER and SERVICE_FILE_SYSTEM_DRIVER.
SERVICE_WIN32
0x00000030
Enumerates services of type SERVICE_WIN32_OWN_PROCESS and SERVICE_WIN32_SHARE_PROCESS.
dwServiceState:
The state of the services to be enumerated. This parameter can be one of the following values.
Value
Meaning
SERVICE_ACTIVE
0x00000001
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.
SERVICE_INACTIVE
0x00000002
Enumerates services that are in the SERVICE_STOPPED state.
SERVICE_STATE_ALL
0x00000003
Combines the following states: SERVICE_ACTIVE and SERVICE_INACTIVE.
lpServices :
A pointer to a buffer that contains an array of ENUM_SERVICE_STATUS structures that receive the name and service status information for each service in the database. The buffer must be large enough to hold the structures, plus the strings to which their members point.
cbBufSize :
The size of the buffer pointed to by the lpServices parameter, in bytes.
pcbBytesNeeded :
A pointer to a variable that receives the number of bytes needed to return the remaining service entries, if the buffer is too small.
lpServicesReturned :
A pointer to a variable that receives the number of service entries returned.
lpResumeHandle :
A pointer to a variable that, on input, specifies the starting point of enumeration. You must set this value to zero the first time this function is called. On output, this value is zero if the function succeeds. However, if the function returns zero and the GetLastError function returns ERROR_MORE_DATA, this value is used to indicate the next service entry to be read when the function is called to retrieve the additional data.
词条标签:
计算机学