private IEnumerable <CompletionPort> CreateAsync(AsyncMachine <BlockAllocationTable> machine) { dataReader.SetPosition(header.TableOffset); var bat = new uint[header.MaxTableEntries]; for (int block = 0; block < header.MaxTableEntries; block++) { dataReader.BeginReadUInt32(machine.CompletionCallback, null); yield return(CompletionPort.SingleOperation); bat[block] = dataReader.EndReadUInt32(machine.CompletionResult); } machine.ParameterValue = new BlockAllocationTable(header.MaxTableEntries, header.BlockSize, bat); }
private IAsyncResult BeginReadCheckSum(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadUInt32(this.GetFooterOffset() + attribute.Offset, callback, state)); }
private IAsyncResult BeginReadPlatformCode(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadUInt32(offset + attribute.Offset, callback, state)); }
private IAsyncResult BeginReadReserved1(VhdPropertyAttribute attribute, AsyncCallback callback, object state) { return(dataReader.BeginReadUInt32(headerOffset + attribute.Offset, callback, state)); }