Windows specific: added registerServiceDeviceNotification() and handleDeviceEvent() to handle SERVICE_CONTROL_DEVICEEVENT events

This commit is contained in:
Günter Obiltschnig
2015-03-13 13:51:51 +01:00
parent e6b4c12ad2
commit e1694c3e68
2 changed files with 37 additions and 5 deletions

View File

@@ -168,6 +168,16 @@ protected:
void defineOptions(OptionSet& options);
#endif
#if defined(POCO_OS_FAMILY_WINDOWS)
static HDEVNOTIFY registerServiceDeviceNotification(LPVOID filter, DWORD flags);
/// Registers the ServerApplication to receive SERVICE_CONTROL_DEVICEEVENT
/// events.
virtual DWORD handleDeviceEvent(DWORD event_type, LPVOID event_data);
/// Handles the SERVICE_CONTROL_DEVICEEVENT event. The default
/// implementation does nothing and returns ERROR_CALL_NOT_IMPLEMENTED.
#endif // if defined(POCO_OS_FAMILY_WINDOWS)
private:
#if defined(POCO_VXWORKS)
static Poco::Event _terminate;
@@ -188,7 +198,7 @@ private:
SRV_UNREGISTER
};
static BOOL __stdcall ConsoleCtrlHandler(DWORD ctrlType);
static void __stdcall ServiceControlHandler(DWORD control);
static DWORD __stdcall ServiceControlHandler(DWORD control, DWORD event_type, LPVOID event_data, LPVOID context);
#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING)
static void __stdcall ServiceMain(DWORD argc, LPWSTR* argv);
#else