MIDI device identification



I have an application that talks to MIDI input and output devices. With this application, users often connect several of the same MIDI device to the host computer. My application needs to save and restore a unique identifier for the device so that it can be restored as best as possible. On OS X, multiple devices of the same type is not a problem as users can rename individual devices. On Windows, this is not possible, so the only way to distinguish between devices of the same type is the port index. So, questions:

1) Is the port index a reliable way of distinguishing between multiple devices of the same type? In other words, assuming that the user does not change their USB MIDI device connections in any way, will devices restore with the same port numbers?

2) Is there a better way?



1. 99.9% yes, but it's not something M$ will tell you is 100%, i save both the ID and the Name, and when starting my app try to match both


2. There is no better known way, the MIDI protocol does not define any way to identify you MIDI interface (you can identify the connected devices using SysEx Identity request message)