public static ErrorMessage GetMessage(IntPtr nativeChunkMsg) { NativeErrorMessage msg = Marshal.PtrToStructure <NativeErrorMessage>(nativeChunkMsg); ErrorMessage message = new ErrorMessage(msg); return(message); }
private ErrorMessage(NativeErrorMessage nativeMsg) { Tag = nativeMsg.Tag; Message = (string)UTF8StringMarshaler.GetInstance("").MarshalNativeToManaged(nativeMsg.MessagePtr); Function = (string)UTF8StringMarshaler.GetInstance("").MarshalNativeToManaged(nativeMsg.FunctionPtr); File = (string)UTF8StringMarshaler.GetInstance("").MarshalNativeToManaged(nativeMsg.FilePtr); LineNumber = nativeMsg.LineNumber; }