---
title: Create
framework: driverkit
role: symbol
role_heading: Static Method
path: driverkit/iointerruptdispatchsource/create
---

# Create

Create a dispatch source that reports hardware-related interrupts generated by the specified service provider.

## Declaration

```occ
static kern_return_t Create(IOService *provider, uint32_t index, IODispatchQueue *queue, IOInterruptDispatchSource **source);
```

## Parameters

- `provider`: The doc://com.apple.driverkit/documentation/DriverKit/IOService object representing the hardware device that generated the interrupt.
- `index`: The index for the interrupt.
- `queue`: The dispatch queue on which to run any handler blocks.
- `source`: A variable for storing the dispatch source. On return, this variable contains the retained object. You are responsible for releasing this object.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

Discussion Creates a new interrupt source for the specified provider object. After creating the dispatch source, call the SetHandler method to specify the action to perform when interrupts occur.

## See Also

### Configuring the Interrupt Source

- [init](driverkit/iointerruptdispatchsource/init.md)
- [free](driverkit/iointerruptdispatchsource/free.md)
- [SetHandler](driverkit/iointerruptdispatchsource/sethandler.md)
