---
title: Create
framework: kernel
role: symbol
role_heading: Type Method
path: kernel/iointerruptdispatchsource/3438201-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

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