(PECL win32service SVN)

win32_get_last_control_messageRetourne le dernier message de contrôle qui a été envoyé à ce service


int win32_get_last_control_message ( void )

Retourne le code de contrôle qui a été envoyé en dernier à ce processus de service. Lorsqu'il fonctionne en tant que service, vous devriez vérifier périodiquement pour déterminer si le service doit être arrêté.

Valeurs de retour

Retourne une constante de contrôle qui sera une parmi les constantes de contrôle des messages de service Win32Service : WIN32_SERVICE_CONTROL_CONTINUE, WIN32_SERVICE_CONTROL_INTERROGATE, WIN32_SERVICE_CONTROL_PAUSE, WIN32_SERVICE_CONTROL_PRESHUTDOWN, WIN32_SERVICE_CONTROL_SHUTDOWN, WIN32_SERVICE_CONTROL_STOP.

Voir aussi

add a note add a note

User Contributed Notes 1 note

kermodebea at kermodebear dot Oh Are Gee
11 years ago
The definitions of some of these control codes can be found here (URL broken due to comment system, sorry about that!):

However, for your convenience (and mine):
Notifies a service that it should stop.

If a service accepts this control code, it must stop upon receipt. After the SCM sends this control code, it does not send other control codes.

Windows XP/2000:  If the service returns NO_ERROR and continues to run, it continues to receive control codes. This behavior changed starting with Windows Server 2003 and Windows XP SP2.

Notifies a service that it should pause.
(Although I guess that there is no requirement that you must.)

Notifies a paused service that it should resume.

Notifies a service that it should report its current status information to the service control manager.
(I'm guessing that a call to win32_set_service_status() would satisfy interrogation?)

Notifies a service that the system is shutting down so the service can perform cleanup tasks.
To Top