Contents

OSKextCancelRequest

Cancels a pending user-space kext request without invoking the callback.

Declaration

OSReturn OSKextCancelRequest(OSKextRequestTag requestTag, void **contextOut);

Parameters

  • requestTag:

    A tag identifying a pending request.

  • contextOut:

    If non-NULL, filled with the context pointer originally passed with the request.

Return Value

kOSReturnSuccess if the request is successfully canceled. kOSKextReturnNotFound if requestTag does not identify any pending request. Other OSKextReturn... errors are possible.

Discussion

This function cancels a pending request if it exists, so that its callback will not be invoked. It returns in contextOut the context pointer used to create the request so that any resources allocated for the request can be cleaned up.

Kexts do not need to cancel outstanding requests in their module stop functions; when a kext is unloaded, all pending request callbacks are invoked with a result of kOSKextReturnTimeout before the stop function is called.

See Also

kext