/// <summary> /// Constructor for a primary partition /// </summary> /// <param name="aHost"></param> /// <param name="aStartingSector"></param> /// <param name="aSectorCount"></param> /// <param name="info"></param> public PrimaryPartition(BlockDevice aHost, ulong aStartingSector, ulong aSectorCount, PartitionInfo info) : base(aHost, aStartingSector, aSectorCount) { HostDevice = aHost; StartingSector = aStartingSector; mBlockCount = aSectorCount; mBlockSize = aHost.BlockSize; _infos = info; }
private void ParsePartition(byte[] aMBR, UInt32 aLoc) { byte xSystemID = aMBR[aLoc + 4]; // SystemID = 0 means no partition if (xSystemID != 0) { UInt32 xStartSector = BitConverter.ToUInt32(aMBR, (int)aLoc + 8); UInt32 xSectorCount = BitConverter.ToUInt32(aMBR, (int)aLoc + 12); var xPartInfo = new PartitionInfo(xSystemID, xStartSector, xSectorCount, blockDevice.BlockSize); _Partitions.Add(xPartInfo); } }