Re: Another Endpoint Q
Re: Another Endpoint Q
- Subject: Re: Another Endpoint Q
- From: Andy <email@hidden>
- Date: Sat, 7 Sep 2002 10:55:54 +0100
On Saturday, September 7, 2002, at 06:43 am, Herbie Robinson wrote:
In a MIDI driver interface, there's a function named
MIDIDriverEnableSource (MIDIEndpointRef src, Boolean enabled),
The documentation and headers are unclear, but it appears that the
endpoint ref (src) I'm receiving here does not correspond to any that
my driver created on its own ports.
Is that right, is it referring to an external connection ie the
endpoint that is on the other end of the ("virtual") line.
Yes. The driver is running in a different process; so, returning
pointers that the driver sees would not be helpful. Also, because
this is multi-user, the system needs to do something to validate
endpoints so that one user can't shaft everybody else. That means it
can't return a pointer to user code and trust the user code to give
the pointer back. The easiest way to validate is to return a table
index instead of a pointer. The only problem with that is that the
indices get re-used; so, user who uses stale indices can access
another user's port. The solution is to add some uniqueness bits to
the index and mask them off when using the index. I never actually
looked at what is being used, but the hex values you printed out are
consistent with this technique.
Thanks Herbie, but I understand that completely, I'm not relying on
the pointers (opaque type MIDIEndpointRef), however I did expect the
endpoint to be mine and the refcons to be mine when I examined the
endpoint via MIDIEndpointGetRefCons. They are everywhere else except
in the function MIDIDriverEnableSource (). That one function appears to
be giving me an endpoint that does not belong to (was not created by)
my driver. My real question was, is that correct ? Another question
would be if it is correct behaviour then why ? Surely I need to know
which one of drivers' own endpoints has just been disconnected or
connected ?
Is it a bug ? In my code or CA ?
No and no.
good :)
What should/does this EndpointRef refer to ?
You need to treat it as an opaque object (or a handle to an opaque
object).
exactly. but in this particular case (EnableSource), should not the
opaque object refer to one that the driver created and not some
external object that another process owns ?
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.