---
title: Open
framework: pcidriverkit
role: symbol
role_heading: Instance Method
path: pcidriverkit/iopcidevice/open
---

# Open

Opens a session to the PCI device.

## Declaration

```occ
kern_return_t Open(IOService *forClient, IOOptionBits options);
```

## Parameters

- `forClient`: The service object that is opening the session. Typically, you specify your driver’s custom doc://com.apple.documentation/documentation/DriverKit/IOService object.
- `options`: Additional options for opening the session.

## Return Value

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

## Discussion

Discussion This method gives the specified IOService object exclusive access to the PCI device. It also gives the service object access to the PCI device’s configuration and aperture space.

## See Also

### Running the Service

- [init](pcidriverkit/iopcidevice/init.md)
- [Close](pcidriverkit/iopcidevice/close.md)
- [free](pcidriverkit/iopcidevice/free.md)
