bool USERCLIENT_KEXT_CLASSNAME::didTerminate(IOService* provider, IOOptionBits options, bool* defer) { // If all pending I/O has been terminated, close our provider. If I/O is still outstanding, set defer to true // and the user client will not have stop called on it. callback_close(); *defer = false; return super::didTerminate(provider, options, defer); }
bool org_pqrs_driver_KeyRemap4MacBook_UserClient_kext::didTerminate(IOService* provider, IOOptionBits options, bool* defer) { // If all pending I/O has been terminated, close our provider. If I/O is still outstanding, set defer to true // and the user client will not have stop called on it. callback_close(); *defer = false; return super::didTerminate(provider, options, defer); }
// clientClose is called as a result of the user process calling IOServiceClose. IOReturn USERCLIENT_KEXT_CLASSNAME::clientClose(void) { // Defensive coding in case the user process called IOServiceClose // without calling BRIDGE_USERCLIENT_CLOSE first. callback_close(); // Inform the user process that this user client is no longer available. This will also cause the // user client instance to be destroyed. // // terminate would return false if the user process still had this user client open. // This should never happen in our case because this code path is only reached if the user process // explicitly requests closing the connection to the user client. if (!terminate()) { IOLOG_ERROR("UserClient_kext::clientClose terminate() failed\n"); } // DON'T call super::clientClose, which just returns kIOReturnUnsupported. return kIOReturnSuccess; }
static inline long close(long dev) { return callback_close(dev); }