Hi Bill,
Windows service has very restricted rule for the control code operation.
Basically, the HandlerEx function(this function is encapsulated in .Net
Windows Service to call your OnStop, OnShutdown handlers) must return
within 30 seconds, or the SCM will think that the service has stopped
responding.
SetServiceStatus with dwCheckPoint and dwWaitHint members is merely a hint
to the SCM how long it taks, it can not be used to delay the shutdown of
service or system. Jeffrey Richter's book <Programming Server-Side
Applications for Microsoft Windows 2000"Control Codes and Status
Reporting" section in chapter2 talks about these rules in details.
Thanks.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.