public QStatus GetPeerGuid(string name, out string guid)
{
UIntPtr guidSz = UIntPtr.Zero;
QStatus ret = alljoyn_busattachment_getpeerguid(_busAttachment, name,
IntPtr.Zero, ref guidSz);
if(!ret)
{
guid = "";
}
else
{
byte[] guidBuffer = new byte[(int)guidSz];
GCHandle gch = GCHandle.Alloc(guidBuffer, GCHandleType.Pinned);
ret = alljoyn_busattachment_getpeerguid(_busAttachment, name,
gch.AddrOfPinnedObject(), ref guidSz);
gch.Free();
if(!ret)
{
guid = "";
}
else
{
guid = System.Text.ASCIIEncoding.ASCII.GetString(guidBuffer);
}
}
return ret;
}