Share via


IOCTL_SERVICE_STATUS (Compact 2013)

3/26/2014

This I/O control message returns the current running state of the service. Send this message with DeviceIoControl.

Syntax

BOOL DeviceIoControl(
    HANDLE hDevice,          // handle to the device
    DWORD dwIoControlCode,   // use IOCTL_SERVICE_STATUS
    LPVOID lpInBuffer,       // pointer to input buffer
    DWORD nInBufferSize,     // input buffer size
    LPVOID lpOutBuffer,      // pointer to output buffer
    DWORD nOutBufferSize,    // output buffer size
    LPDWORD lpBytesReturned, // number of bytes returned
    OVERLAPPED lpOverlapped  // pointer to OVERLAPPED structure
);

Parameters

  • hDevice
    [in] Handle to the device.
  • dwIoControlCode
    [in] The control code for the operation. Use IOCTL_SERVICE_STATUS for this operation.
  • lpOutBuffer
    [out] Pointer to a DWORD specifying the running state of the service. The following table shows possible values for this parameter.

    Value

    Description

    SERVICE_STATE_OFF = 0

    The service is turned off.

    SERVICE_STATE_ON = 1

    The service is turned on.

    SERVICE_STATE_STARTING_UP = 2

    The service is in the process of starting up.

    SERVICE_STATE_SHUTTING_DOWN = 3

    The service is in the process of shutting down.

    SERVICE_STATE_UNLOADING = 4

    The service is in the process of unloading.

    SERVICE_STATE_UNINITIALIZED = 5

    The service is not uninitialized.

    SERVICE_STATE_UNKNOWN = 0xffffffff

    The state of the service is unknown.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Remarks

To get extended error information, call SetLastError.

Remarks

The running state is returned in the lpOutBuffer parameter of the xxx_IOControl (Servicesd.exe) function.

Requirements

Header

service.h

See Also

Reference

Servicesd.exe IOCTLS
xxx_IOControl (Servicesd.exe)