Application Verifier - Stop Codes - Services

The services tests, check for the proper use of Windows Services. For example that services are being started and stopped properly. For more information on Windows Services see Services.

The following stop codes are contained in this set of tests.

Using a non-Unicode API (e.g. RegisterServiceCtrlHandlerA instead of RegisterServiceCtrlHandlerW)

Probable cause

Most probably the application was not compiled with the UNICODE macro defined and therefore non-Unicode interfaces are used.

Information displayed by Application Verifier
  • Format: -  API name %ws
  • Parameter 1 - Not used.
  • Parameter 2 - Not used.
  • Parameter 3 - Not used.
  • Parameter 4 - Not used.

Additional Information
  • Test Layer: Service
  • Stop ID: USING_NON_UNICODE_API
  • Stop code: 4000000
  • Severity: Error
  • One-time error: no
  • Error report: Break
  • Log to file: yes
  • Create backtrace: yes

StartServiceCtrlDispatcher API is being called a second time

Probable cause

This API is meant to be called only once at the start of the service wmain function.

Information displayed by Application Verifier
  • Format: -  API name %ws
  • Parameter 1 - SERVICE_TABLE_ENTRY parameter.
  • Parameter 2 - Not used.
  • Parameter 3 - Not used.
  • Parameter 4 - Not used.

Additional Information
  • Test Layer: Service
  • Stop ID: CTRL_DISPATCHER_CALLED_TWICE
  • Stop code: 4000001
  • Severity: Error
  • One-time error: no
  • Error report: Break
  • Log to file: yes
  • Create backtrace: yes

Invalid SERVICE_STATUS handle is being passed to SetServiceStatus

Probable cause

Invalid SERVICE_STATUS handle is being passed to SetServiceStatus.

Information displayed by Application Verifier
  • Format: -  API name %ws
  • Parameter 1 - SERVICE_STATUS_HANDLE value.
  • Parameter 2 - Not used.
  • Parameter 3 - Not used.
  • Parameter 4 - Not used.

Additional Information
  • Test Layer: Service
  • Stop ID: INVALID_SERVICE_STATUS_HANDLE
  • Stop code: 4000002
  • Severity: Error
  • One-time error: no
  • Error report: Break
  • Log to file: yes
  • Create backtrace: yes

SetServiceStatus is being called from two threads

Probable cause

This API is meant to be called serially.

Information displayed by Application Verifier
  • Format: -  API name %ws is being called concurrently from %ws service
  • Parameter 1 - LPSERVICE_STATUS value passed.
  • Parameter 2 - Not used.
  • Parameter 3 - Not used.
  • Parameter 4 - Not used.

Additional Information
  • Test Layer: Service
  • Stop ID: SET_SERVICE_STATUS_RACE
  • Stop code: 4000003
  • Severity: Error
  • One-time error: no
  • Error report: Break
  • Log to file: yes
  • Create backtrace: yes

STOP/SHUTDOWN controls are being accepted while service is in START_PENDING state

Probable cause

Most services cannot accept stop/shutdown controls during initialization

Information displayed by Application Verifier
  • Format: -  Service name: %ws dwControlsAccepted: %08X
  • Parameter 1 - LPSERVICE_STATUS value passed.
  • Parameter 2 - Not used.
  • Parameter 3 - Not used.
  • Parameter 4 - Not used.

Additional Information
  • Test Layer: Service
  • Stop ID: STOP_SHUTDOWN_ACCEPTED
  • Stop code: 4000004
  • Severity: Warning
  • One-time error: no
  • Error report: None
  • Log to file: yes
  • Create backtrace: yes

SERVICE is attempting an invalid state transition

Probable cause

The service attempted to do an invalid state transition or setting identical status parameters

Information displayed by Application Verifier
  • Format: -  Service %ws was found attempting an invalid state transition
  • Parameter 1 - LPSERVICE_STATUS Current State.
  • Parameter 2 - LPSERVICE_STATUS New State.
  • Parameter 3 - Last SetServiceStatus stack trace.
  • Parameter 4 - Not used.

Additional Information
  • Test Layer: Service
  • Stop ID: INVALID_STATE_TRANSITION
  • Stop code: 4000005
  • Severity: Error
  • One-time error: no
  • Error report: Break
  • Log to file: yes
  • Create backtrace: yes

SERVICE is attempting to set identical status parameters

Probable cause

The service attempted to set identical status parameters

Information displayed by Application Verifier
  • Format: -  The service %ws attempted to set identical status parameters
  • Parameter 1 - LPSERVICE_STATUS Current State.
  • Parameter 2 - LPSERVICE_STATUS New State.
  • Parameter 3 - Last SetServiceStatus stack trace.
  • Parameter 4 - Not used.

Additional Information
  • Test Layer: Service
  • Stop ID: DUPLICATE_STATE_PARAMS
  • Stop code: 4000006
  • Severity: Warning
  • One-time error: no
  • Error report: None
  • Log to file: yes
  • Create backtrace: yes

SERVICE is leaving pending threads after entering STOPPED state

Probable cause

The service is leaving pending threads after declaring STOPPED state

Information displayed by Application Verifier
  • Format: -  Service %ws is leaking threads
  • Parameter 1 - Thread Id of the leaked thread.
  • Parameter 2 - Service Tag.
  • Parameter 3 - Not used.
  • Parameter 4 - Not used.

Additional Information
  • Test Layer: Service
  • Stop ID: LEAKED_THREAD
  • Stop code: 4000007
  • Severity: Error
  • One-time error: no
  • Error report: Break
  • Log to file: yes
  • Create backtrace: yes

See Also

Application Verifier - Stop Codes and Definitions

Application Verifier - Overview

Application Verifier - Features

Application Verifier - Testing Applications

Application Verifier - Tests within Application Verifier

Application Verifier - Debugging Application Verifier Stops

Application Verifier - Frequently Asked Questions