API的一个结构不知道是什么意思哪位高手帮小弟我看下
API的一个结构不知道是什么意思谁帮我看下
我在写一个遍历本机服务的程序.
TEnumServiceStatus ServiceStatusRecs[512];
mItem=ListView1->Items->Add();
mItem->Caption= String(ServiceStatusRecs[j].lpServiceName);
mItem->SubItems->Add(String(ServiceStatusRecs[j].lpDisplayName));
SERVICE_STATUS这个结构里的内容是什么意思?谁有中文解释呢?
ServiceStatusRecs[j].ServiceStatus.dwCurrentState
ServiceStatusRecs[j].ServiceStatus.dwServiceType
ServiceStatusRecs[j].ServiceStatus.dwControlsAccepted
ServiceStatusRecs[j].ServiceStatus.dwWin32ExitCode
ServiceStatusRecs[j].ServiceStatus.dwServiceSpecificExitCode
ServiceStatusRecs[j].ServiceStatus.dwCheckPoint
ServiceStatusRecs[j].ServiceStatus.dwWaitHint
------解决方案--------------------
对啊 在msdn文档里面的啊
就是服务状态描述结构体啊
SERVICE_STATUS Structure Visual Studio 2010
Send Feedback
Contains status information for a service. The ControlService, EnumDependentServices, EnumServicesStatus, and QueryServiceStatus functions use this structure. A service uses this structure in the SetServiceStatus function to report its current status to the service control manager.
Syntax
Copy to ClipboardPrint
typedef struct _SERVICE_STATUS {
DWORD dwServiceType;
DWORD dwCurrentState;
DWORD dwControlsAccepted;
DWORD dwWin32ExitCode;
DWORD dwServiceSpecificExitCode;
DWORD dwCheckPoint;
DWORD dwWaitHint;
} SERVICE_STATUS, *LPSERVICE_STATUS;
Members
dwServiceType
The type of service. This member can be one of the following values.
Value Meaning
SERVICE_FILE_SYSTEM_DRIVER
0x00000002
The service is a file system driver.
SERVICE_KERNEL_DRIVER
0x00000001
The service is a device driver.
SERVICE_WIN32_OWN_PROCESS
0x00000010
The service runs in its own process.
SERVICE_WIN32_SHARE_PROCESS
0x00000020
The service shares a process with other services.
If the service type is either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, and the service is running in the context of the LocalSystem account, the following type may also be specified.
Value Meaning
SERVICE_INTERACTIVE_PROCESS
0x00000100
The service can interact with the desktop.
For more information, see Interactive Services.
我在写一个遍历本机服务的程序.
TEnumServiceStatus ServiceStatusRecs[512];
mItem=ListView1->Items->Add();
mItem->Caption= String(ServiceStatusRecs[j].lpServiceName);
mItem->SubItems->Add(String(ServiceStatusRecs[j].lpDisplayName));
SERVICE_STATUS这个结构里的内容是什么意思?谁有中文解释呢?
ServiceStatusRecs[j].ServiceStatus.dwCurrentState
ServiceStatusRecs[j].ServiceStatus.dwServiceType
ServiceStatusRecs[j].ServiceStatus.dwControlsAccepted
ServiceStatusRecs[j].ServiceStatus.dwWin32ExitCode
ServiceStatusRecs[j].ServiceStatus.dwServiceSpecificExitCode
ServiceStatusRecs[j].ServiceStatus.dwCheckPoint
ServiceStatusRecs[j].ServiceStatus.dwWaitHint
------解决方案--------------------
对啊 在msdn文档里面的啊
就是服务状态描述结构体啊
SERVICE_STATUS Structure Visual Studio 2010
Send Feedback
Contains status information for a service. The ControlService, EnumDependentServices, EnumServicesStatus, and QueryServiceStatus functions use this structure. A service uses this structure in the SetServiceStatus function to report its current status to the service control manager.
Syntax
Copy to ClipboardPrint
typedef struct _SERVICE_STATUS {
DWORD dwServiceType;
DWORD dwCurrentState;
DWORD dwControlsAccepted;
DWORD dwWin32ExitCode;
DWORD dwServiceSpecificExitCode;
DWORD dwCheckPoint;
DWORD dwWaitHint;
} SERVICE_STATUS, *LPSERVICE_STATUS;
Members
dwServiceType
The type of service. This member can be one of the following values.
Value Meaning
SERVICE_FILE_SYSTEM_DRIVER
0x00000002
The service is a file system driver.
SERVICE_KERNEL_DRIVER
0x00000001
The service is a device driver.
SERVICE_WIN32_OWN_PROCESS
0x00000010
The service runs in its own process.
SERVICE_WIN32_SHARE_PROCESS
0x00000020
The service shares a process with other services.
If the service type is either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, and the service is running in the context of the LocalSystem account, the following type may also be specified.
Value Meaning
SERVICE_INTERACTIVE_PROCESS
0x00000100
The service can interact with the desktop.
For more information, see Interactive Services.