Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MidiJackGetEndpointName() can return "unknown" for valid handles on 64-bit Windows #37

Open
cdwfs opened this issue Feb 7, 2019 · 0 comments · May be fixed by #38
Open

MidiJackGetEndpointName() can return "unknown" for valid handles on 64-bit Windows #37

cdwfs opened this issue Feb 7, 2019 · 0 comments · May be fixed by #38
Assignees
Labels

Comments

@cdwfs
Copy link

cdwfs commented Feb 7, 2019

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.

@keijiro keijiro self-assigned this Feb 7, 2019
@keijiro keijiro added the bug label Feb 7, 2019
@cdwfs cdwfs changed the title MidiJackGetEndpointName() always returns "unknown" on 64-bit Windows MidiJackGetEndpointName() can return "unknown" for valid handles on 64-bit Windows Feb 9, 2019
@cdwfs cdwfs linked a pull request Feb 9, 2019 that will close this issue
Nagitch added a commit to Nagitch/MidiJack that referenced this issue May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants