---
title: SetHandler
framework: DriverKit
role: symbol
role_heading: Instance Method
platforms: [DriverKit, iOS, iPadOS, macOS]
path: driverkit/ioservicenotificationdispatchsource/3538748-sethandler
---

# SetHandler

## Declaration

```occ
virtual kern_return_t SetHandler(OSAction *action);
```

## Return Value

kIOReturnSuccess on success. See `IOReturn.h` for error codes.
