コード例 #1
0
        private static RawDataManager InitializeNewDrive(Drive.VirtualDrive drive, VirtualDriveParameters parameters)
        {
            var synchronizer = new DriveAccessSynchronizer(drive);
            var retv         = new RawDataManager(synchronizer);

            retv.writeVirtualDriveParameters(parameters);

            retv._sectorInfoWriter = new SectorInfoRawWriter(parameters, synchronizer);
            retv.inititalizeSectors(parameters);

            retv.writeAvailableContentBlocks();

            synchronizer.DriveAccess.Wait();//wait for writing before initializing

            try
            {
                retv.init();
            }
            catch (Exception)
            {
                synchronizer.Dispose();
                throw;
            }

            var rootEntry = new DirectoryEntry
            {
                Id          = 0,
                DirectoryId = -1,
                Name        = string.Empty
            };

            retv.Write(rootEntry).Task.Wait(); //make sure that root is created

            return(retv);
        }
コード例 #2
0
 protected BaseRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer, long initialPosition)
 {
     Synchronizer           = synchronizer;
     VirtualDriveParameters = virtualDriveParameters;
     CurrentPosition        = initialPosition;
     InitialPosition        = initialPosition;
 }
コード例 #3
0
        private static RawDataManager Initialize(Drive.VirtualDrive drive)
        {
            var synchronizer = new DriveAccessSynchronizer(drive);
            var retv         = new RawDataManager(synchronizer);

            try
            {
                retv.init();
            }
            catch (Exception e)
            {
                synchronizer.Dispose();
                throw;
            }

            return(retv);
        }
コード例 #4
0
 public ContentRawReader(DriveAccessSynchronizer synchronizer, long initialPosition, int length)
     : base(synchronizer, initialPosition)
 {
     _length = length;
 }
コード例 #5
0
 public EntriesTableRawReader(DriveAccessSynchronizer synchronizer, VirtualDriveParameters parameters, long initialPosition)
     : base(synchronizer, initialPosition)
 {
     _parameters = parameters;
 }
コード例 #6
0
 protected OptimizedRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer, long initialPosition)
     : base(virtualDriveParameters, synchronizer, initialPosition)
 {
 }
コード例 #7
0
 public SectorInfoRawReader(DriveAccessSynchronizer synchronizer, VirtualDriveParameters parameters)
     : base(synchronizer, FixedPositions.SectorsInformation)
 {
     _parameters = parameters;
 }
コード例 #8
0
 public VirtualDriveParametersRawReader(DriveAccessSynchronizer synchronizer)
     : base(synchronizer, FixedPositions.VirtualDriveParameters)
 {
 }
コード例 #9
0
 public EntryRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer, long initialPosition)
     : base(virtualDriveParameters, synchronizer, initialPosition)
 {
     Length = virtualDriveParameters.EntriesTableSectorLength;
 }
コード例 #10
0
 private RawDataManager(DriveAccessSynchronizer synchronizer)
 {
     _synchronizer          = synchronizer;
     _driveParametersWriter = new VirtualDriveParametersRawWriter(_synchronizer);
 }
コード例 #11
0
 public SectorInfoRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer)
     : base(virtualDriveParameters, synchronizer, FixedPositions.SectorsInformation)
 {
     Length = VirtualDriveParameters.SectorsInformationRegionLength;
 }
コード例 #12
0
 protected BaseRawReader(DriveAccessSynchronizer synchronizer, long initialPosition)
 {
     Synchronizer    = synchronizer;
     InitialPosition = initialPosition;
     CurrentPosition = initialPosition;
 }
コード例 #13
0
 public ContentRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer, long initialPosition)
     : base(virtualDriveParameters, synchronizer, initialPosition)
 {
 }