private static unsafe void WriteExceptionHeader(byte[] buffer, uint pos, ExceptionHeader header) { fixed(byte *p = buffer) { ExceptionHeader *ptr = (ExceptionHeader *)(p + pos); *ptr = header; } }
private static unsafe ExceptionHeader ReadExceptionHeader(byte[] buffer, uint pos) { ExceptionHeader exceptionHeader = new ExceptionHeader(); fixed(byte *p = buffer) { ExceptionHeader *ptr = (ExceptionHeader *)(p + pos); exceptionHeader = *ptr; } return(exceptionHeader); }