[Mono-osx] How to handle CFArrayRef?
sebastian.mauer at rwth-aachen.de
Tue Apr 22 03:12:27 EDT 2008
thanks for that hint. So I'm able to read an IntPtr for each entry within
CFArray. My Header File says "the arrays hold CFData objects which contain
So I guess I have to implement some part of CFData as well. If I had a
pointer to the CFData's contents could I use Marshal.PtrToStructure to
finally get my WirelessNetworkInfo structs?
Von: Erik Ylvisaker [mailto:eylvisaker at physics.ucdavis.edu]
Gesendet: Dienstag, 22. April 2008 03:47
An: Sebastian Mauer; mono-osx at lists.ximian.com
Betreff: Re: [Mono-osx] How to handle CFArrayRef?
You have to call other functions in Core Foundation to get values out of
the array. If all you need is the functions CFArrayGetCount and
CFArrayGetValueAtIndex, you can use the sample code I've attached
below. You might also want CFArrayGetValues. Documentation for the
CFArray functions is here:
const string appServices =
internal static extern int CFArrayGetCount(IntPtr theArray);
internal static extern IntPtr CFArrayGetValueAtIndex(IntPtr
theArray, int idx);
Sebastian Mauer wrote:
> Hello there,
> I'm currently implementing part of the Apple80211.framework, and made good
> progress until now.
> The function WirelessScan will pass me a pointer to a CFArrayRef (part of
> CoreFoundation) which contains several WirelessNetworkInfo structs and I'm
> not sure how to map/handle them within c#
> extern WIErr WirelessScan(
> WirelessContextPtr inContext,
> CFArrayRef *apList,
> const UInt32 stripDups);
> This is the information I got from the respective header file:
> * It will allocate 2 CFArrays to store a list
> * of managed and adhoc networks. The arrays hold CFData
> * objects which contain WirelessNetworkInfo structures.
> What can I do to ultimately recieve an Array out of WirelessNetworkInfo
> Sebastian Mauer
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
More information about the Mono-osx