private bool tryMsgImpl(
string name,
ushort fid,
ref MamaMsg result,
bool throwOnError)
{
EnsurePeerCreated();
IntPtr myP = IntPtr.Zero;
int code = NativeMethods.mamaMsg_getMsg(nativeHandle, name, fid, ref myP);
if (throwOnError)
{
CheckResultCode(code);
}
else
{
if (CheckResultCodeIgnoreNotFound(code) != MamaStatus.mamaStatus.MAMA_STATUS_OK)
return false;
}
if (result == null)
result = new MamaMsg();
result.setNativeHandle(myP);
return true;
}