protected override void OnStop() { DeviceNotification.Unregister(_notificationHandle); _notificationHandle = IntPtr.Zero; }
protected override void OnStart(string[] args) { DeviceNotification.Unregister(_notificationHandle); _notificationHandle = DeviceNotification.Register(this.ServiceHandle, GUID_DEVINTERFACE_USB_DEVICE); }