internal JetHeader(byte[] bytes) { Checksum = BitConverter.ToUInt32(bytes, 0x00); Signature = BitConverter.ToUInt32(bytes, 0x04); FileFormatVersion = BitConverter.ToUInt32(bytes, 0x08); FileType = (JET_FILETYPE)BitConverter.ToUInt32(bytes, 0x0C); DatabaseTime = new JetDbTime(bytes, 0x10); DatabaseSignature = new JetSignature(bytes, 0x18); DatabaseState = (JET_DBSTATE)BitConverter.ToUInt32(bytes, 0x34); ConsistentPostition = new JetLgPos(bytes, 0x38); ConsistentTime = JetLogTime.Get(bytes, 0x40); AttachTime = JetLogTime.Get(bytes, 0x48); AttachPosition = new JetLgPos(bytes, 0x50); DetachTime = JetLogTime.Get(bytes, 0x58); DetachPosition = new JetLgPos(bytes, 0x60); LogSignature = new JetSignature(bytes, 0x68); PreviousFullBackup = new JetBkInfo(bytes, 0x88); PreviousIncrementalBackup = new JetBkInfo(bytes, 0xA0); CurrentFullBackup = new JetBkInfo(bytes, 0xB8); ShadowingDisabled = BitConverter.ToUInt32(bytes, 0xD0); LastObjectIdentifier = BitConverter.ToUInt32(bytes, 0xD4); MajorVersion = BitConverter.ToUInt32(bytes, 0xD8); MinorVersion = BitConverter.ToUInt32(bytes, 0xDC); BuildNumber = BitConverter.ToUInt32(bytes, 0xE0); ServicePackNumber = BitConverter.ToUInt32(bytes, 0xE4); FileFormatRevision = BitConverter.ToUInt32(bytes, 0xE8); PageSize = BitConverter.ToUInt32(bytes, 0xEC); RepairCount = BitConverter.ToUInt32(bytes, 0xF0); RepairTime = JetLogTime.Get(bytes, 0xF4); ScrubDatabaseTime = new JetDbTime(bytes, 0x118); ScrubTime = JetLogTime.Get(bytes, 0x120); RequiredLog = BitConverter.ToUInt32(bytes, 0x128); UpgradeExchangeFormat = BitConverter.ToUInt32(bytes, 0x130); UpgradeFreePages = BitConverter.ToUInt32(bytes, 0x134); UpgradeSpaceMapPages = BitConverter.ToUInt32(bytes, 0x138); CurrentShadowCopyBackup = new JetBkInfo(bytes, 0x13C); CreationFileFormatVersion = BitConverter.ToUInt32(bytes, 0x154); CreationFileFormatRevision = BitConverter.ToUInt32(bytes, 0x158); OldRepairCount = BitConverter.ToUInt32(bytes, 0x16C); EccFixSuccessCount = BitConverter.ToUInt32(bytes, 0x170); LastEccFixTime = JetLogTime.Get(bytes, 0x174); OldEccFixSuccessCount = BitConverter.ToUInt32(bytes, 0x17C); EccFixErrorCount = BitConverter.ToUInt32(bytes, 0x180); LastEccFixErrorTime = JetLogTime.Get(bytes, 0x184); OldEccFixErrorCount = BitConverter.ToUInt32(bytes, 0x18C); BadChecksumErrorCount = BitConverter.ToUInt32(bytes, 0x190); LastBadChecksumTime = JetLogTime.Get(bytes, 0x194); OldBadChecksumErrorCount = BitConverter.ToUInt32(bytes, 0x19C); CommittedLog = BitConverter.ToUInt32(bytes, 0x1A0); PreviousShadowBackup = new JetBkInfo(bytes, 0x1A4); PreviousDifferentialBackup = new JetBkInfo(bytes, 0x1BC); NlsMajorVersion = BitConverter.ToUInt32(bytes, 0x1FC); NlsMinorVersion = BitConverter.ToUInt32(bytes, 0x200); }
internal Page(byte[] bytes, int offset) { JetHeader h = new JetHeader(bytes); PageNumber = GetPageNumber((uint)offset, h.PageSize); Checksum = BitConverter.ToUInt64(bytes, 0x00 + offset); LastModificationTime = new JetDbTime(bytes, offset + 0x08); PreviousPageNumber = BitConverter.ToUInt32(bytes, 0x10 + offset); NextPageNumber = BitConverter.ToUInt32(bytes, 0x14 + offset); FatherDataPage = BitConverter.ToUInt32(bytes, 0x18 + offset); AvailableDataSize = BitConverter.ToUInt16(bytes, 0x1C + offset); AvailableUncommittedDataSize = BitConverter.ToUInt16(bytes, 0x1E + offset); FirstAvailableDataOffset = BitConverter.ToUInt16(bytes, 0x20 + offset); FirstAvailablePageTag = BitConverter.ToUInt16(bytes, 0x22 + offset); PageFlags = ((Page.JET_PAGEFLAGS)BitConverter.ToUInt32(bytes, 0x24 + offset)); Tags = DataTag.GetInstances(bytes, offset); }