.NET windows service and pendings

  • Thread starter Thread starter Constantin Zheltikov
  • Start date Start date
C

Constantin Zheltikov

Hi All!
My service need wait for completion some working threads when it has
receiving stop command, i.e. it need call something like SetServiceStatus
with current state SERVICE_STOP_PENDING. But i cannot find analogue
SetServiceStatus in .NET Framework. How to solve this problem?
 
Hello,

Thanks for your post. Currently there is no built in functionality to delay
the timeout of a Windows service shutdown. A couple of potential
workarounds is to platform invoke all of the Win32 service APIs and create
your own ServiceBase class that implements
dwWaitHint or dwCheckPoint in SetServiceStatus. The other workaround is to
create a true Win32 service that then calls your .Net process or dll.

Please check out this reference:
http://discuss.develop.com/archives/wa.exe?A2=ind0204A&L=DOTNET&P=51929

As far as I know, in the Whidbey version of the CLR, the OnStop method will
be executed in an async call, so it will no longer tie up the underlying
service command dispatcher thread. Also, we will be exposing a way to
update the service status.

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
-----Original Message-----
Hi All!
My service need wait for completion some working threads when it has
receiving stop command, i.e. it need call something like SetServiceStatus
with current state SERVICE_STOP_PENDING. But i cannot find analogue
SetServiceStatus in .NET Framework. How to solve this problem?


.
try to ask on this address http://www.dotnetboards.com/
 
Back
Top