The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,439 other followers

Windows service states and service state transitions

Posted by jpluimers on 2018/09/12

States via [WayBackSERVICE_STATUS structure (Windows)

Value Hex Meaning
SERVICE_CONTINUE_PENDING 0x00000005 The service continue is pending.
SERVICE_PAUSE_PENDING 0x00000006 The service pause is pending.
SERVICE_PAUSED 0x00000007 The service is paused.
SERVICE_RUNNING 0x00000004 The service is running.
SERVICE_START_PENDING 0x00000002 The service is starting.
SERVICE_STOP_PENDING 0x00000003 The service is stopping.
SERVICE_STOPPED 0x00000001 The service is not running.

 

State transition overview

It’s complex as a table, so there are two.

  • The initial state is SERVICE_STOPPED.
  • Most logical targets are in italic.

Common transitions:

From state To state
SERVICE_STOPPED SERVICE_START_PENDING
SERVICE_START_PENDING SERVICE_RUNNING
SERVICE_START_PENDING SERVICE_STOPPED
SERVICE_START_PENDING SERVICE_STOP_PENDING
SERVICE_RUNNING SERVICE_STOPPED
SERVICE_RUNNING SERVICE_STOP_PENDING
SERVICE_STOP_PENDING SERVICE_STOPPED

Infrequent transitions:

From state To state
SERVICE_RUNNING SERVICE_PAUSE_PENDING
SERVICE_RUNNING SERVICE_PAUSED
SERVICE_PAUSE_PENDING SERVICE_PAUSED
SERVICE_PAUSE_PENDING SERVICE_STOP_PENDING
SERVICE_PAUSE_PENDING SERVICE_STOPPED
SERVICE_PAUSED SERVICE_RUNNING
SERVICE_PAUSED SERVICE_CONTINUE_PENDING
 SERVICE_PAUSED SERVICE_STOP_PENDING
 SERVICE_PAUSED SERVICE_STOPPED
SERVICE_CONTINUE_PENDING SERVICE_RUNNING
 SERVICE_CONTINUE_PENDING  SERVICE_STOP_PENDING
 SERVICE_CONTINUE_PENDING  SERVICE_STOPPED

 

Detailed state transitions

There are in fact more transitions as some states can transit into themselves:

Source: [WayBackService State Transitions (Windows)

–jeroen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: