请输入您要查询的百科知识:

 

词条 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

);

函数功能

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

参数介绍

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.

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2024/11/16 20:56:32