diff --git a/foohid/foohid_userclient.cpp b/foohid/foohid_userclient.cpp index 8395b70..8cf6764 100644 --- a/foohid/foohid_userclient.cpp +++ b/foohid/foohid_userclient.cpp @@ -46,6 +46,17 @@ void it_unbit_foohid_userclient::stop(IOService *provider) { super::stop(provider); } +IOReturn it_unbit_foohid_userclient::clientClose(void) +{ + bool success = terminate(); + if (!success) { + return kIOReturnDeviceError; + } + + return kIOReturnSuccess; +} + + /** * A dispatch table for this User Client interface, used by 'it_unbit_foohid_userclient::externalMethod()'. * The fields of the IOExternalMethodDispatch type follows: diff --git a/foohid/foohid_userclient.h b/foohid/foohid_userclient.h index b6796c8..6d26291 100644 --- a/foohid/foohid_userclient.h +++ b/foohid/foohid_userclient.h @@ -28,7 +28,8 @@ class it_unbit_foohid_userclient : public IOUserClient { virtual bool start(IOService *provider) override; virtual void stop(IOService *provider) override; - + virtual IOReturn clientClose(void) override; + virtual IOReturn externalMethod(uint32_t selector, IOExternalMethodArguments *arguments, IOExternalMethodDispatch *dispatch,