[Mono-osx] Handle Question

Chris McKinnon crmckinnon at shaw.ca
Thu Apr 19 23:09:38 UTC 2012


Hi,

I'm writing some new code that is calling through to native Mac OS libraries.  For the most part I've found IntPtr works well for getting back values.  How do you handle getting back a Handle (a pointer to a pointer)?  For example:

struct SomeApiRecord {
  long                data[1];
};
typedef struct  SomeApiRecord      SomeApiRecord;
typedef  SomeApiRecord *           SomeApiPtr;

Then the function calls might be:

OSError NewSomeApiPtr(SomeApiPtr* ptr);
OSError DoSomething(SomeApiPtr ptr);
OSError DisposeSomeApiPtr(SomeApiPtr ptr);

Only the "New" call returns a handle.  The rest use a pointer.  Any help would be appreciated.

Thanks,

Chris McKinnon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-osx/attachments/20120419/6f73505b/attachment.html>


More information about the Mono-osx mailing list