---
title: ExternalMethod
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/iouserclient/externalmethod
---

# ExternalMethod

Receive arguments from IOKit.framework IOConnectMethod calls.

## Declaration

```occ
virtual kern_return_t ExternalMethod(uint64_t selector, IOUserClientMethodArguments *arguments, const IOUserClientMethodDispatch *dispatch, OSObject *target, void *reference);
```

## Parameters

- `selector`: Selector argument to IOConnectMethod.
- `arguments`: Structure describing all arguments being passed to IOConnectMethod. See the doc://com.apple.driverkit/documentation/DriverKit/IOUserClientMethodArguments definition.
- `dispatch`: NULL when called in the driver. The doc://com.apple.driverkit/documentation/DriverKit/IOUserClient/ExternalMethod implementation may be called with a non-NULL argument to check certain fields of the arguments structure before calling a target procedure specified by the dispatch structure ‘function’ field, and the ‘target’ and ‘reference’ parameters to this method. See the doc://com.apple.driverkit/documentation/DriverKit/IOUserClientMethodDispatch definition.
- `target`: Target for the dispatch function
- `reference`: Reference constant for the dispatch function

## Return Value

Return Value kIOReturnSuccess on success. See IOReturn.h for error codes.

## Discussion

Discussion IOConnectMethod calls from the owner of the connection come here. Any argument may be passed as NULL if not passed by the caller.

## See Also

### Responding to Messages

- [IOUserClientMethodArguments](driverkit/iouserclientmethodarguments.md)
- [IOUserClientMethodDispatch](driverkit/iouserclientmethoddispatch.md)
- [IOUserClientMethodFunction](driverkit/iouserclientmethodfunction.md)
