<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: 10.1.0 - 10.6.0",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMIDI",
  "identifier" : "/documentation/CoreMIDI/MIDIGetSerialPortOwner",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core MIDI"
    ],
    "preciseIdentifier" : "c:@F@MIDIGetSerialPortOwner"
  },
  "title" : "MIDIGetSerialPortOwner"
}
-->

# MIDIGetSerialPortOwner

Returns the MIDI driver that owns a serial port.

```
extern OSStatus MIDIGetSerialPortOwner(CFStringRef portName, CFStringRef*outDriverName);
```

## Parameters

`portName`

The name of a serial port.

`outDriverName`

On exit, the name of the driver owning the port, or NULL if no driver owns it.

## Return Value

An OSStatus result code.

## Discussion

The current MIDISetup tracks ownership of serial ports to one of the MIDI drivers installed in the system.

Serial ports can be enumerated using IOServiceMatching( kIOSerialBSDServiceValue). The port’s unique name is the IOService’s kIOTTYDeviceKey property.

New for CoreMIDI 1.1.

A previous version of this documentation specified an incorrect key for obtaining the port’s unique name (IOTTYBaseName).

---

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)