INFO: Dealing w/ Lengthy Processing in Service Control Handler (120557)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • the operating system: Microsoft Windows NT 3.1
    • the operating system: Microsoft Windows NT 3.5
    • the operating system: Microsoft Windows NT 3.51
    • the operating system: Microsoft Windows NT 4.0
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows XP

This article was previously published under Q120557

SUMMARY

The service control handler function must return within 30 seconds. If it does not, the Service Control Manager will return the following error:
Error 2186 - The service is not responding to the control function
If a service needs to do lengthy processing when the service is in the service control handler, it should create a secondary thread to perform the lengthy processing and then return. This prevents the service from tying up the service control handler thread.

Modification Type:MajorLast Reviewed:4/9/2004
Keywords:kbAPI kbinfo kbKernBase kbService KB120557