Vista - Preshutdown notifications

Vista - Preshutdown notifications

Post by c2phaW4wN » Sun, 03 Jun 2007 05:00:01


Hi,

I am writing a service for Vista where I need to delay system shutdown in
the case it is in the middle of a critical operation.

I am using the new Vista "Preshutdown" notification.
I have configured the preshutdown timeout to a large value (in the order of
hours) using the "ChangeServiceConfig2" API.

In the HandlerEX function, I have a case for the Preshutdown control.
I do get the preshutdown notification and respond by calling
"SetServiceStatus(SERVICE_STOP_PENDING)". However, the service gets killed
within 30s and the system shutdown continues.

If anyone has used/tested this before, please help!

-Thanks,

--
sjain06
 
 
 

Vista - Preshutdown notifications

Post by Stefan Kuh » Wed, 13 Jun 2007 23:27:31

Hello sjain06,



What is your wait hint in the SERVICE_STATUS struct passed to
SetServiceStatus? What is your frequency in calling
SetServiceStatus(SERVICE_STOP_PENDING)? Do you properly increase the
dwCheckPoint value with each call to SetServiceStatus(SERVICE_STOP_PENDING)?

--
Stefan