次の方法で共有


ICcService::GetCurrentState (Compact 2013)

3/26/2014

Deprecated.

This method returns the program state of the service.

Syntax

HRESULT GetCurrentState (
  DWORD* pdwCurrentState
);

Parameters

  • pdwCurrentState
    [out, retval] Current state of the service.

    The first four bits of the service state are reserved for pre-defined service states. Service states 5 and 6 are not used.

    For caching purposes, the SERVICE_LOCKED state determines if the lock count on a service is a positive number.

    If the lock count of the service is greater than 0, Core Connectivity requires the service to set the lock count bit, the fourth bit, to 0x1xxx.

    If the lock count is not a positive number, the service should clear the service state bit; that is, it should set the bit to 0x0xxx.

    The SERVICE_LOCKED state is combined with other services in an OR relationship.

    Core Connectivity requires custom service providers to set the service state to a pre-defined value at different points during the service lifetime. Custom services can add additional service states.

    The following table describes valid service states.

    State

    Value

    Description

    SERVICE_NO_INIT

    0x0

    Not initialized.

    SERVICE_INIT_NO_CONFIGURE

    0x1

    Initialized but not configured.

    SERVICE_INIT_CONFIGURE_NO_CONNECT

    0x2

    Initialized, configured, but not connected.

    SERVICE_INIT_CONFIGURE_PENDING_CONNECT

    0x3

    Initialized, configured, and waiting to connect.

    SERVICE_INIT_CONFIGURE_CONNECT

    0x4

    Initialized, configured, and connected.

    SERVICE_LOCKED

    0x8

    Initialized, configured, but not connected.

Return Value

The following table shows return values for this method.

Value

Description

S_OK

Indicates success.

E_INVALIDARG

Indicates invalid arguments.

E_FAIL

Indicates any other failure.

Remarks

The program state of the service could be a combination of several different states, such as CONNECTED, DOWNLOADING FILE, and so on.

For a full description of the states supported natively and how to extend the service state information, see ICcServiceCB.

Requirements

Header

ccservice.h

See Also

Reference

ICcService
Core Connectivity Interfaces