<!--
{
  "availability" : [
    "DriverKit: 27.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VideoDriverKit",
  "identifier" : "/documentation/VideoDriverKit/IOUserVideoDevice/SetIOOperationHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "VideoDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserVideoDevice@F@SetIOOperationHandler#BFI(#i#i#i#k#k)#"
  },
  "title" : "SetIOOperationHandler"
}
-->

# SetIOOperationHandler

Sets the IOOperationHandler block on the device.

```
kern_return_t SetIOOperationHandler(IOOperationHandler in_io_operation_block);
```

## Parameters

`in_io_operation_block`

The IOOperationHandler block to be called when the host performs an IO operation.

## Return Value

`kIOReturnSuccess` if the IOOperationHandler block was successfuly set on the device

## Discussion

The IOOperationHandler will be invoked when a IO operation is performed by the host.
The handler will be called on a real time priority thread, so any work should only call
real-time safe operations and never block. Many of the calls to various IOUserVideoObjects
are syncrhonized against the work queue, so any necessary information to perform IO
should be cached and captured in the block.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)