public MiniDumpHeader ReadHeader() { // Both SIGNATURE & VERSION are from minidumpapiset.h const UInt32 MINIDUMP_SIGNATURE = 0x504d444d; // PMDM, P = 0x50, M = 0x4d, D = 0x44, M = 0x4d const UInt32 MINIDUMP_VERSION = 42899; using (var viewAccessor = _minidumpMappedFile.CreateViewAccessor(0, Marshal.SizeOf(typeof(MINIDUMP_HEADER)), MemoryMappedFileAccess.Read)) { MINIDUMP_HEADER header; viewAccessor.Read <MINIDUMP_HEADER>(0, out header); if (header.Signature != MINIDUMP_SIGNATURE) { return(null); } if (windows.LoWord(header.Version) != MINIDUMP_VERSION) { return(null); } MINIDUMP_DIRECTORY[] directoryEntries = new MINIDUMP_DIRECTORY[header.NumberOfStreams]; _mappedFileView.ReadArray <MINIDUMP_DIRECTORY>(header.StreamDirectoryRva, directoryEntries, 0, (int)header.NumberOfStreams); return(new MiniDumpHeader(header, directoryEntries, this)); } }