/// <summary>
        /// Returns the offset within the FAT of the next block
        /// </summary>
        /// <param name="baseBlock">The root block for the entry</param>
        static public long BlockToFATOffset(uint baseBlock, Structs.PartitionInfo Partition)
        {
            if (baseBlock > Partition.Clusters)
            {
                // throw new Exception("Cluster ref of range");
            }
            long rVal = baseBlock * (int)Partition.EntrySize;

            rVal += Partition.FATOffset;
            return(rVal);
        }
        /// <summary>
        /// Converts cluster (block) number to offset
        /// </summary>
        static public long GetBlockOffset(uint block, Structs.PartitionInfo Partition)
        {
            if (block > Partition.Clusters)
            {
                // throw new Exception("Cluster ref of range");
            }
            //The way that FATX works is that the root block is considered block 0,
            //so let's think about this like an array...  if the block is reading block
            //2, then it's really block 1 in an array
            block--;
            long rVal = (Partition.DataOffset + ((long)block * Partition.ClusterSize));

            return(rVal);
        }
 /// <summary>
 /// Provides partition/FAT information
 /// </summary>
 public PartitionFunctions(Entry entry)
 {
     FATXDrive = (Drive)entry.Drive;
     Partition = entry.PartitionInfo;
     //ProcessBootSector();
 }
 /// <summary>
 /// Provides partition/FAT information
 /// </summary>
 public PartitionFunctions(Drive Drive, Folder partition)
 {
     FATXDrive = Drive;
     Partition = partition.PartitionInfo;
     ProcessBootSector();
 }
示例#5
0
 public DateTime PartitionTimeStamp(Structs.PartitionInfo PI)
 {
     return(VariousFunctions.DateTimeFromFATInt((ushort)((PI.ID & ~0xFFFF) >> 8), (ushort)PI.ID));
 }
 public PartitionGeometry(CLKsFATXLib.Folder e)
 {
     InitializeComponent();
     CLKsFATXLib.Structs.PartitionInfo PI = e.PartitionInfo;
     propertyGrid1.SelectedObject = PI;
 }
示例#7
0
 public File(PartitionInfo Partition, EntryData EntryData, Drive Drive)
     : base(Partition, EntryData, Drive)
 {
 }
示例#8
0
 public Entry(PartitionInfo Partition, EntryData EntryData, Drive Drive)
 {
     this.PartitionInfo = Partition;
     this.Drive = Drive;
     this.EntryData = EntryData;
 }
示例#9
0
 /// <summary>
 /// Default constructor for the folder class
 /// </summary>
 /// <param name="Partition">Partition information to which this folder belongs to</param>
 /// <param name="EntryData">The entry data for this folder</param>
 /// <param name="Drive">Drive which this folder belongs to</param>
 public Folder(PartitionInfo Partition, EntryData EntryData, Drive Drive)
     : base(Partition, EntryData, Drive)
 {
     ReturnDeletedEntries = false;
 }
 static public uint GetBlockFromOffset(long offset, Structs.PartitionInfo Partition)
 {
     return((uint)(((offset - Partition.DataOffset)) / Partition.ClusterSize));
 }