public InterfaceDescription[] GetInterfaces()
{
UIntPtr numIfaces = alljoyn_busattachment_getinterfaces(_busAttachment, IntPtr.Zero, (UIntPtr)0);
IntPtr[] ifaces = new IntPtr[(int)numIfaces];
GCHandle gch = GCHandle.Alloc(ifaces, GCHandleType.Pinned);
UIntPtr numIfacesFilled = alljoyn_busattachment_getinterfaces(_busAttachment,
gch.AddrOfPinnedObject(), numIfaces);
gch.Free();
if(numIfaces != numIfacesFilled)
{
// Warn?
}
InterfaceDescription[] ret = new InterfaceDescription[(int)numIfacesFilled];
for(int i = 0; i < ret.Length; i++)
{
ret[i] = new InterfaceDescription(ifaces[i]);
}
return ret;
}