---
title: SetName
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/ioservice/setname
---

# SetName

Sets the name of the service in the system’s registry.

## Declaration

```occ
virtual kern_return_t SetName(const IOServiceName name);
```

## Parameters

- `name`: The new name for the service. This method copies the string you provide.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. For a list of error codes, see Error Codes.

## See Also

### Registering the Service with IOKit

- [RegisterService](driverkit/ioservice/registerservice.md)
- [GetRegistryEntryID](driverkit/ioservice/getregistryentryid.md)
- [IOServiceName](driverkit/ioservicename.md)
