PHP: win32_get_last_control_message - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

win32_query_service_status win32_delete_service

Last updated: Fri, 26 Jan 2007

view this page in

# win32_get_last_control_message

(PECL)

win32_get_last_control_message -- Returns the last control message that was sent to this service

## Описание

int win32_get_last_control_message ( void )

Returns the control code that was last sent to this service process. When running as a service you should periodically check this to determine if your service needs to stop running.

## Возвращаемые значения

Returns a control constant; one of `WIN32_SERVICE_CONTROL_CONTINUE`, `WIN32_SERVICE_CONTROL_INTERROGATE`, `WIN32_SERVICE_CONTROL_PAUSE`, `WIN32_SERVICE_CONTROL_STOP`, `WIN32_SERVICE_CONTROL_HARDWAREPROFILECHANGE`, `WIN32_SERVICE_CONTROL_POWEREVENT`, `WIN32_SERVICE_CONTROL_SESSIONCHANGE`.

## Смотрите также

win32_start_service_ctrl_dispatcher()

add a note User Contributed Notes
win32_get_last_control_message
kermodebea at kermodebear dot Oh Are Gee
02-May-2006 11:35
`The definitions of some of these control codes can be found here (URL broken due to comment system, sorry about that!): http://msdn.microsoft.com/library
/default.asp?url=/library/en-us/dllproc/base/handler.asp
However, for your convenience (and mine):
SERVICE_CONTROL_STOP, 0x00000001
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.
SERVICE_CONTROL_PAUSE, 0x00000002
Notifies a service that it should pause.
(Although I guess that there is no requirement that you must.)
SERVICE_CONTROL_CONTINUE, 0x00000003
Notifies a paused service that it should resume.
SERVICE_CONTROL_INTERROGATE, 0x00000004
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?)
SERVICE_CONTROL_SHUTDOWN, 0x00000005
Notifies a service that the system is shutting down so the service can perform cleanup tasks.`
add a note
win32_query_service_status win32_delete_service

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST