Error Message #1053: ERROR_SERVICE_REQUEST_TIMEOUT

Last reviewed: August 8, 1996
Article ID: Q154113
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface included with:

        - Microsoft Windows NT, version 3.51
        - Microsoft Windows NT, version 4.0
    

SUMMARY

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.

MORE INFORMATION

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: kbprg kberrmsg
KBSubcategory: BseService


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 8, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.