public static MoonError FromIntPtr(IntPtr moon_error)
{
MoonError err = (MoonError)Marshal.PtrToStructure (moon_error, typeof (MoonError));
if (err.message != IntPtr.Zero) {
string msg = Marshal.PtrToStringAuto (err.message);
//err.message = Value.StringToIntPtr (msg);
}
return err;
}