private PlatformCode ReadPlaformCode(VhdPropertyAttribute attribute) { return (PlatformCode)dataReader.ReadUInt32(offset + attribute.Offset); }
private uint ReadCheckSum(VhdPropertyAttribute attribute) { return(dataReader.ReadUInt32(headerOffset + attribute.Offset)); }
private IAsyncResult BeginReadDataOffset(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadUInt64(headerOffset + attribute.Offset, callback, state)); }
private IAsyncResult BeginReadRawData(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadBytes(headerOffset + attribute.Offset, attribute.Size, callback, state)); }
private IEnumerable <CompletionPort> CreateParentLocators(AsyncMachine <IList <ParentLocator> > machine, VhdPropertyAttribute attribute) { var parentLocators = new List <ParentLocator>(); var attributeHelper = new AttributeHelper <ParentLocator>(); var entityAttribute = attributeHelper.GetEntityAttribute(); long baseOffset = headerOffset + attribute.Offset; for (int i = 0; i < attribute.Count; i++) { var parentLocatorFactory = new VhdParentLocatorFactory(dataReader, baseOffset); parentLocatorFactory.BeginReadCreate(machine.CompletionCallback, null); yield return(CompletionPort.SingleOperation); ParentLocator parentLocator = parentLocatorFactory.EndReadCreate(machine.CompletionResult); parentLocators.Add(parentLocator); baseOffset += entityAttribute.Size; } machine.ParameterValue = parentLocators; }
private IAsyncResult BeginReadSavedState(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadBoolean(this.GetFooterOffset() + attribute.Offset, callback, state)); }
private IAsyncResult BeginReadVhdCookie(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadBytes(this.GetFooterOffset() + attribute.Offset, attribute.Size, callback, state)); }
private string ReadCreatorApplication(VhdPropertyAttribute attribute) { var creatorApplication = dataReader.ReadBytes(GetFooterOffset() + attribute.Offset, attribute.Size); return(Encoding.ASCII.GetString(creatorApplication)); }
private VhdFeature ReadFeatures(VhdPropertyAttribute attribute) { return((VhdFeature)dataReader.ReadUInt32(GetFooterOffset() + attribute.Offset)); }
private IAsyncResult BeginReadCreatorHostOsType(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadUInt32(this.GetFooterOffset() + attribute.Offset, callback, state)); }
private VhdCreatorVersion ReadCreatorVersion(VhdPropertyAttribute attribute) { var version = dataReader.ReadUInt32(GetFooterOffset() + attribute.Offset); return(new VhdCreatorVersion(version)); }
private HostOsType ReadCreatorHostOsType(VhdPropertyAttribute attribute) { var hostOs = dataReader.ReadUInt32(GetFooterOffset() + attribute.Offset); return((HostOsType)hostOs); }
private IEnumerable <CompletionPort> ReadDiskGeometryAsync(AsyncMachine <DiskGeometry> machine, VhdPropertyAttribute attribute) { long offset = GetFooterOffset() + attribute.Offset; var attributeHelper = new AttributeHelper <DiskGeometry>(); var diskGeometry = new DiskGeometry(); dataReader.BeginReadInt16(offset + attributeHelper.GetAttribute(() => diskGeometry.Cylinder).Offset, machine.CompletionCallback, null); yield return(CompletionPort.SingleOperation); diskGeometry.Cylinder = dataReader.EndReadInt16(machine.CompletionResult); dataReader.BeginReadByte(offset + attributeHelper.GetAttribute(() => diskGeometry.Heads).Offset, machine.CompletionCallback, null); yield return(CompletionPort.SingleOperation); diskGeometry.Heads = dataReader.EndReadByte(machine.CompletionResult); dataReader.BeginReadByte(offset + attributeHelper.GetAttribute(() => diskGeometry.Sectors).Offset, machine.CompletionCallback, null); yield return(CompletionPort.SingleOperation); diskGeometry.Sectors = dataReader.EndReadByte(machine.CompletionResult); machine.ParameterValue = diskGeometry; }
private IAsyncResult BeginReadDiskGeometry(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(AsyncMachine <DiskGeometry> .BeginAsyncMachine(ReadDiskGeometryAsync, attribute, callback, state)); }
private int ReadReserved(VhdPropertyAttribute attribute) { return (int)dataReader.ReadUInt32(offset + attribute.Offset); }
private Guid ReadUniqueId(VhdPropertyAttribute attribute) { return(dataReader.ReadGuid(GetFooterOffset() + attribute.Offset)); }
private long ReadPlatformDataOffset(VhdPropertyAttribute attribute) { return (long)dataReader.ReadUInt64(offset + attribute.Offset); }
private IAsyncResult BeginReadUniqueId(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadGuid(this.GetFooterOffset() + attribute.Offset, callback, state)); }
private VhdCookie ReadVhdCookie(VhdPropertyAttribute attribute) { byte[] value = dataReader.ReadBytes(this.GetFooterOffset() + attribute.Offset, attribute.Size); return(CreateVhdCookie(value)); }
private DateTime ReadTimeStamp(VhdPropertyAttribute attribute) { return(dataReader.ReadDateTime(GetFooterOffset() + attribute.Offset)); }
private byte[] ReadRawData(VhdPropertyAttribute attribute) { return(dataReader.ReadBytes(headerOffset + attribute.Offset, attribute.Size)); }
private IAsyncResult BeginReadTimeStamp(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadDateTime(this.GetFooterOffset() + attribute.Offset, callback, state)); }
private IAsyncResult BeginReadParentLocators(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(AsyncMachine <IList <ParentLocator> > .BeginAsyncMachine(CreateParentLocators, attribute, callback, state)); }
private long ReadHeaderOffset(VhdPropertyAttribute attribute) { return((long)dataReader.ReadUInt64(GetFooterOffset() + attribute.Offset)); }
private uint ReadReserved1(VhdPropertyAttribute attribute) { return(dataReader.ReadUInt32(headerOffset + attribute.Offset)); }
private DiskType ReadDiskType(VhdPropertyAttribute attribute) { var readDiskType = dataReader.ReadUInt32(GetFooterOffset() + attribute.Offset); return(diskTypeFactory.Create(readDiskType)); }
private long ReadDataOffset(VhdPropertyAttribute attribute) { return((long)dataReader.ReadUInt64(headerOffset + attribute.Offset)); }
private long ReadVirtualSize(VhdPropertyAttribute attribute) { return((long)dataReader.ReadUInt64(this.GetFooterOffset() + attribute.Offset)); }
private string ReadParentPath(VhdPropertyAttribute attribute) { var parentNameBytes = dataReader.ReadBytes(headerOffset + attribute.Offset, attribute.Size); return(Encoding.BigEndianUnicode.GetString(parentNameBytes).TrimEnd('\0')); }
private IAsyncResult BeginReadVirtualSize(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadUInt64(this.GetFooterOffset() + attribute.Offset, callback, state)); }
private int ReadPlatformDataLength(VhdPropertyAttribute attribute) { return (int)dataReader.ReadUInt32(offset + attribute.Offset); }
private VhdFileFormatVersion ReadVhdFileFormatVersion(VhdPropertyAttribute attribute) { var version = dataReader.ReadUInt32(this.GetFooterOffset() + attribute.Offset); return(CreateVhdFileFormatVersion(version)); }
private IAsyncResult BeginReadReserved(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return dataReader.BeginReadUInt32(offset + attribute.Offset, callback, state); }
private IAsyncResult BeginReadVhdFileFormatVersion(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadUInt32(this.GetFooterOffset() + attribute.Offset, callback, state)); }
private IAsyncResult BeginReadPlatformDataOffset(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return dataReader.BeginReadUInt64(offset + attribute.Offset, callback, state); }
private bool ReadSavedState(VhdPropertyAttribute attribute) { return(dataReader.ReadBoolean(GetFooterOffset() + attribute.Offset)); }