Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

add clientClose to properly temrinate userclient #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions foohid/foohid_userclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion foohid/foohid_userclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down