Microsoft KB Archive/287516

{|
 * width="100%"|

BUG: Service Startup Type Is Disabled

 * }

Q287516

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * the operating system: Microsoft Windows 2000

-

SYMPTOMS
After a service has been deleted, the Startup Type of the service may be shown as &quot;Disabled&quot; within the Services snap-in for Microsoft Management Console (MMC). This will occur if the MMC Services snap-in was open prior to deletion of the service and was used to stop the service before it was deleted.

CAUSE
The Services snap-in does not close the service handle after it stops a service. When a service is deleted, the Service Control Manager marks the service for deletion, but the service will not actually be deleted until all handles to the service are closed. An attempt to query the service configuration will fail once the service has been marked for deletion. The Services snap-in shows the startup type for a service as &quot;Disabled&quot; when its configuration cannot be queried.

RESOLUTION
The service will successfully be removed once the Services snap-in is closed and all other handles to the service are closed.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION
This problem will only occur if a service is stopped from the Services snap-in and an application thereafter programmatically deletes the service but the Services snap-in remains open.

A service can be deleted programmatically through use of the DeleteService API or through the command-line utility SC.exe, which comes with the Windows 2000 Resource Kit. As long as the Services snap-in has an open handle to the service, all other service-related operations against the deleted service will fail with error 1072 (ERROR_SERVICE_MARKED_FOR_DELETE).

This problem will not occur if the service is stopped using command-line utilities like SC.exe or NET.exe or programmatically using the ControlService API with the control code SERVICE_CONTROL_STOP.

Additional query words:

Keywords : kbAPI kbKernBase kbSDKWin32 kbService kbSvcMgr kbDSupport kbGrpDSKernBase

Issue type : kbbug

Technology : kbAudDeveloper kbWin32sSearch kbWin32API