次の方法で共有


2.2.49 SERVICE_STATUS_PROCESS

The SERVICE_STATUS_PROCESS structure contains information about a service that is used by the RQueryServiceStatusEx method.

 typedef struct {
   DWORD dwServiceType;
   DWORD dwCurrentState;
   DWORD dwControlsAccepted;
   DWORD dwWin32ExitCode;
   DWORD dwServiceSpecificExitCode;
   DWORD dwCheckPoint;
   DWORD dwWaitHint;
   DWORD dwProcessId;
   DWORD dwServiceFlags;
 } SERVICE_STATUS_PROCESS,
  *LPSERVICE_STATUS_PROCESS;

dwServiceType: The type of service. This MUST be one of the following values.

Value

Meaning

SERVICE_KERNEL_DRIVER

0x00000001

A driver service. These are services that manage devices on the system.

SERVICE_FILE_SYSTEM_DRIVER

0x00000002

A file system driver service. These are services that manage file systems on the system.

SERVICE_WIN32_OWN_PROCESS

0x00000010

A service that runs in its own process.

SERVICE_WIN32_SHARE_PROCESS

0x00000020

A service that shares a process with other services.

SERVICE_INTERACTIVE_PROCESS

0x00000100

The service can interact with the desktop.

Only SERVICE_WIN32_OWN_PROCESS and SERVICE_INTERACTIVE_PROCESS or SERVICE_WIN32_SHARE_PROCESS and SERVICE_INTERACTIVE_PROCESS can be combined.

dwCurrentState: The current state of the service. This MUST be one of the following values.

Value

Meaning

0x00000005

SERVICE_CONTINUE_PENDING

0x00000006

SERVICE_PAUSE_PENDING

0x00000007

SERVICE_PAUSED

0x00000004

SERVICE_RUNNING

0x00000002

SERVICE_START_PENDING

0x00000003

SERVICE_STOP_PENDING

0x00000001

SERVICE_STOPPED

dwControlsAccepted: The control codes that the service accepts and processes in its handler function. This bit mask MUST be set to zero or more of the following values. The value of dwControlsAccepted is 0x00000000 if the service type is SERVICE_KERNEL_DRIVER or SERVICE_FILE_SYSTEM_DRIVER.

Value

Meaning

0x00000008

SERVICE_ACCEPT_PARAMCHANGE

Service can reread its startup parameters without being stopped and restarted.

0x00000002

SERVICE_ACCEPT_PAUSE_CONTINUE

Service can be paused and continued.

0x00000004

SERVICE_ACCEPT_SHUTDOWN

Service is notified when system shutdown occurs.

0x00000001

SERVICE_ACCEPT_STOP

Service can be stopped.

0x00000020

SERVICE_ACCEPT_HARDWAREPROFILECHANGE

Service is notified when the computer hardware profile changes.

0x00000040

SERVICE_ACCEPT_POWEREVENT

Service is notified when the computer power status changes.

0x00000080

SERVICE_ACCEPT_SESSIONCHANGE

Service is notified when the computer session status changes.

0x00000100

SERVICE_ACCEPT_PRESHUTDOWN<22>

The service can perform preshutdown tasks.

SERVICE_ACCEPT_PRESHUTDOWN is sent before sending SERVICE_CONTROL_SHUTDOWN to give more time to services that need extra time before shutdown occurs.

0x00000200

SERVICE_ACCEPT_TIMECHANGE<23>

Service is notified when the system time changes.

0x00000400

SERVICE_ACCEPT_TRIGGEREVENT<24>

Service is notified when an event for which the service has registered occurs.

dwWin32ExitCode: An error code that the service uses to report an error that occurs when it is starting or stopping.

dwServiceSpecificExitCode: A service-specific error code that the service returns when an error occurs while it is starting or stopping.

dwCheckPoint: A value that the service increments periodically to report its progress during a lengthy start, stop, pause, or continue operation.

dwWaitHint: An estimate of the amount of time, in milliseconds, that the service expects a pending start, stop, pause, or continue operation to take before the service makes its next status update.

dwProcessId: A process identifier of the service. A value of 0 indicates that the service is not started.

dwServiceFlags: The bit flags that describe the process in which the service is running. This MUST be one of the following values.

Value

Meaning

0x00000000

Service is either running in a process that is not a system process, or the service is not running at all. In a nonsystem process, dwProcessId is nonzero. If the service is not running, dwProcessId is 0.

0x00000001

Service runs in a system process that MUST always be running.