Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new PrimaryPartition
 /// </summary>
 /// <param name="aHost">The blockdevice to use</param>
 /// <param name="aStartingSector">The partion starting sector</param>
 /// <param name="aSectorCount">the number of sectors in the partition</param>
 /// <param name="info">The partition infos</param>
 public PrimaryPartition(BlockDevice aHost, ulong aStartingSector, ulong aSectorCount, PartInfo info)
     : base(aHost, aStartingSector, aSectorCount)
 {
     mHost           = aHost;
     mStartingSector = aStartingSector;
     mBlockCount     = aSectorCount;
     mBlockSize      = aHost.BlockSize;
     _infos          = info;
 }
Ejemplo n.º 2
0
        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 PartInfo(xSystemID, xStartSector, xSectorCount);
                _Partitions.Add(xPartInfo);
            }
        }