ID: Q154113
3.51 4.00 WINDOWS NT
The information in this article applies to:
- Microsoft Windows NT, version 3.51
- Microsoft Windows NT, version 4.0
Stopping a Win32 Service may cause an ERROR_SERVICE_REQUEST_TIMEOUT, to be reported by the Service Controller. The description of this error (#1053) is:
"The service did not respond to the start or control request in a
timely fashion."
This problem existed in the Win32 SDK Simple Service sample for Windows NT
3.51 and has been corrected in the sample for Windows NT 4.0.
Error 1053 is the result of a race condition in the service's control handler function, caused by the service setting an event telling the service to stop. The Servicemain() thread returns from the ServiceStart function, and calls SetServiceStatus() to tell the service controller that the service has stopped before a status of STOP_PENDING can be reported by the control handler function.
To fix this problem, first report STOP_PENDING, and then set the event telling the other thread to stop.
Additional reference words: 3.51 4.00 KBCategory: KBSubcategory: BseService
Keywords : kberrmsg kbKernBase kbService kbGrpKernBase
Version : 3.51 4.00
Platform : NT WINDOWS
Last Reviewed: May 23, 1998