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); }
protected BaseRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer, long initialPosition) { Synchronizer = synchronizer; VirtualDriveParameters = virtualDriveParameters; CurrentPosition = initialPosition; InitialPosition = initialPosition; }
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); }
public ContentRawReader(DriveAccessSynchronizer synchronizer, long initialPosition, int length) : base(synchronizer, initialPosition) { _length = length; }
public EntriesTableRawReader(DriveAccessSynchronizer synchronizer, VirtualDriveParameters parameters, long initialPosition) : base(synchronizer, initialPosition) { _parameters = parameters; }
protected OptimizedRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer, long initialPosition) : base(virtualDriveParameters, synchronizer, initialPosition) { }
public SectorInfoRawReader(DriveAccessSynchronizer synchronizer, VirtualDriveParameters parameters) : base(synchronizer, FixedPositions.SectorsInformation) { _parameters = parameters; }
public VirtualDriveParametersRawReader(DriveAccessSynchronizer synchronizer) : base(synchronizer, FixedPositions.VirtualDriveParameters) { }
public EntryRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer, long initialPosition) : base(virtualDriveParameters, synchronizer, initialPosition) { Length = virtualDriveParameters.EntriesTableSectorLength; }
private RawDataManager(DriveAccessSynchronizer synchronizer) { _synchronizer = synchronizer; _driveParametersWriter = new VirtualDriveParametersRawWriter(_synchronizer); }
public SectorInfoRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer) : base(virtualDriveParameters, synchronizer, FixedPositions.SectorsInformation) { Length = VirtualDriveParameters.SectorsInformationRegionLength; }
protected BaseRawReader(DriveAccessSynchronizer synchronizer, long initialPosition) { Synchronizer = synchronizer; InitialPosition = initialPosition; CurrentPosition = initialPosition; }
public ContentRawWriter(VirtualDriveParameters virtualDriveParameters, DriveAccessSynchronizer synchronizer, long initialPosition) : base(virtualDriveParameters, synchronizer, initialPosition) { }