Service Control Manager reports Event ID 7016 (320789)
The information in this article applies to:
- Microsoft Win32 Application Programming Interface (API), when used with:
- the operating system: Microsoft Windows XP
- the operating system: Microsoft Windows 2000
- the operating system: Microsoft Windows NT 4.0
This article was previously published under Q320789 SYMPTOMS
If a service is not written correctly, the Service Control Manager (SCM) may log the following error in the system event log when you use the net start command to start the service:
Event ID: 7016
Source: Service Control Manager
Type: Error
Category: None
Description: The ServiceName service has reported an invalid current state 0.
However, this error message may not be generated if the Services tool in Control Panel (on a Windows NT 4.0-based system) or the Microsoft Management Console (MMC) Services snap-in (on a Windows 2000 or Windows XP-based system) is used to start the service.
CAUSE
After you use the net start command to start the service, Net.exe interrogates the service by calling the ControlService function with a SERVICE_CONTROL_INTERROGATE control code until the service reports a status of SERVICE_RUNNING or SERVICE_STOPPED. If the service control handler of the corresponding service calls SetServiceStatus with an invalid value for dwCurrentState, the SCM reports the aforementioned error in the system event log.
RESOLUTION
To resolve this issue, the service must be fixed (rewritten correctly) so that it reports a valid status when it receives a SERVICE_CONTROL_INTERROGATE (or any other) control code from the SCM.
REFERENCESFor additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
257509 Hardware Inventory May Cause Third-Party Win32 Services to Stop
257689 Error Message When You Use "Net" Command with Microsoft Exchange Connector for POP3 Mailboxes
Modification Type: | Major | Last Reviewed: | 6/16/2005 |
---|
Keywords: | kbAPI kbKernBase kbprb kbService KB320789 |
---|
|