Discussion:
Windows Service Preshutdown Notifications
(too old to reply)
MegaBrutal
2018-10-29 20:30:00 UTC
Permalink
Hi all,

I propose to add the Windows Service PRESHUTDOWN constants to the Windows unit.

Preshutdown Notifications exist since Windows Vista. It allows Windows
services to receive a preshutdown notification those are fired earlier
than normal shutdown notifications, which allows a service more time
to shut down properly. It's useful for services those take a longer
time to shut down.

Here's a patch to add the necessary constants to process Preshutdown
Notifications in Windows service applications:


Index: rtl/win/wininc/defines.inc
===================================================================
--- rtl/win/wininc/defines.inc (revision 40091)
+++ rtl/win/wininc/defines.inc (working copy)
@@ -248,6 +248,7 @@
SERVICE_ACCEPT_STOP = 1;
SERVICE_ACCEPT_PAUSE_CONTINUE = 2;
SERVICE_ACCEPT_SHUTDOWN = 4;
+ SERVICE_ACCEPT_PRESHUTDOWN = 256;
{ CheckDlgButton }
BST_CHECKED = 1;
BST_INDETERMINATE = 2;
@@ -355,6 +356,7 @@
SERVICE_CONTROL_CONTINUE = 3;
SERVICE_CONTROL_INTERROGATE = 4;
SERVICE_CONTROL_SHUTDOWN = 5;
+ SERVICE_CONTROL_PRESHUTDOWN = 15;
{ CopyImage, LoadImage }
IMAGE_BITMAP = 0;
IMAGE_CURSOR = 2;


Best regards,
MegaBrutal
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mail
Marco van de Voort
2018-10-30 08:56:28 UTC
Permalink
Post by MegaBrutal
I propose to add the Windows Service PRESHUTDOWN constants to the Windows
unit.
r40096 I added the other constants of those series too.
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-

Loading...