On 64-bit Windows, the ID returned by MidiJackGetEndpointIDAtIndex(index) is the low 32 bits of the DeviceHandle. When this ID is passed into MidiJackGetEndpointName(), it "converts" it back to a handle by casting it back to a 64-bit int, but the high 32 bits of the handle can not be recovered. Passing the resulting handle to midiInGetDevCaps() results in an invalid handle error, so the function returns "unknown".
The issue can be solved by maintaining a std::map<DeviceID, DeviceHandle> to convert 32-bit device IDs back to the full 64-bit device handle. I can prepare a PR if you'd like.
On 64-bit Windows, the ID returned by
MidiJackGetEndpointIDAtIndex(index)
is the low 32 bits of theDeviceHandle
. When this ID is passed intoMidiJackGetEndpointName()
, it "converts" it back to a handle by casting it back to a 64-bit int, but the high 32 bits of the handle can not be recovered. Passing the resulting handle tomidiInGetDevCaps()
results in an invalid handle error, so the function returns "unknown".The issue can be solved by maintaining a
std::map<DeviceID, DeviceHandle>
to convert 32-bit device IDs back to the full 64-bit device handle. I can prepare a PR if you'd like.