├── .gitignore
├── DiscUtils-mono.sln
├── DiscUtils.FxCop
├── DiscUtils.sln
├── Discutils.nuspec
├── Help
├── API Reference.aml
├── Content Layout.content
├── Contents.aml
├── Install_VS2010_Help.bat
├── Introduction.aml
└── Library.shfbproj
├── LICENSE.txt
├── LibraryOnly.sln
├── Settings.StyleCop
├── Version.cs
├── build.ps1
├── changecopyrightyear.ps1
├── common.ps1
├── diag
├── DiscUtils.Diagnostics.csproj
├── NullTextWriter.cs
├── Properties
│ └── AssemblyInfo.cs
├── ReplayReport.cs
├── StreamTraceRecord.cs
├── TracingStream.cs
├── ValidatingFileSystem.cs
├── ValidatingFileSystemException.cs
└── ValidatingFileSystemWrapperStream.cs
├── discutils.sln.props
├── layout.ps1
├── readme.md
├── src
├── AligningStream.cs
├── ApplePartitionMap
│ ├── BlockZero.cs
│ ├── PartitionMap.cs
│ ├── PartitionMapEntry.cs
│ └── PartitionMapFactory.cs
├── BigEndianDataReader.cs
├── BigEndianDataWriter.cs
├── Block.cs
├── BlockCache.cs
├── BlockCacheSettings.cs
├── BlockCacheStatistics.cs
├── BlockCacheStream.cs
├── BootConfig
│ ├── ApplicationImageType.cs
│ ├── ApplicationType.cs
│ ├── BaseStorage.cs
│ ├── BcdObject.cs
│ ├── BooleanElementValue.cs
│ ├── DeviceAndPathRecord.cs
│ ├── DeviceElementValue.cs
│ ├── DeviceRecord.cs
│ ├── DiscUtilsRegistryStorage.cs
│ ├── Element.cs
│ ├── ElementClass.cs
│ ├── ElementFormat.cs
│ ├── ElementValue.cs
│ ├── GuidElementValue.cs
│ ├── GuidListElementValue.cs
│ ├── InheritType.cs
│ ├── IntegerElementValue.cs
│ ├── IntegerListElementValue.cs
│ ├── ObjectType.cs
│ ├── PartitionRecord.cs
│ ├── Store.cs
│ ├── StringElementValue.cs
│ └── WellKnownElement.cs
├── Buffer.cs
├── BufferStream.cs
├── BuilderBufferExtent.cs
├── BuilderBufferExtentSource.cs
├── BuilderBytesExtent.cs
├── BuilderExtent.cs
├── BuilderExtentSource.cs
├── BuilderSparseStreamExtent.cs
├── BuilderStreamExtent.cs
├── BuilderStreamExtentSource.cs
├── BuiltStream.cs
├── ChsAddress.cs
├── ClusterMap.cs
├── Compression
│ ├── Adler32.cs
│ ├── BZip2BlockDecoder.cs
│ ├── BZip2CombinedHuffmanTrees.cs
│ ├── BZip2DecoderStream.cs
│ ├── BZip2Randomizer.cs
│ ├── BZip2RleStream.cs
│ ├── BigEndianBitStream.cs
│ ├── BitStream.cs
│ ├── BlockCompressor.cs
│ ├── CompressionResult.cs
│ ├── DataBlockTransform.cs
│ ├── HuffmanTree.cs
│ ├── InverseBurrowsWheeler.cs
│ ├── MoveToFront.cs
│ └── ZlibStream.cs
├── ConcatStream.cs
├── Crc32.cs
├── Crc32Algorithm.cs
├── Crc32BigEndian.cs
├── Crc32LittleEndian.cs
├── DataReader.cs
├── DataWriter.cs
├── DiscDirectoryInfo.cs
├── DiscFileInfo.cs
├── DiscFileLocator.cs
├── DiscFileSystem.cs
├── DiscFileSystemChecker.cs
├── DiscFileSystemInfo.cs
├── DiscFileSystemOptions.cs
├── DiscUtils.csproj
├── DiskImageBuilder.cs
├── DiskImageFileSpecification.cs
├── Dmg
│ ├── BlkxResource.cs
│ ├── CompressedBlock.cs
│ ├── CompressedRun.cs
│ ├── Disk.cs
│ ├── DiskFactory.cs
│ ├── DiskImageFile.cs
│ ├── GenericResource.cs
│ ├── Resource.cs
│ ├── ResourceFork.cs
│ ├── RunType.cs
│ ├── UdifBuffer.cs
│ ├── UdifChecksum.cs
│ └── UdifResourceFile.cs
├── Ext
│ ├── BlockGroup.cs
│ ├── CompatibleFeatures.cs
│ ├── Context.cs
│ ├── DirEntry.cs
│ ├── Directory.cs
│ ├── DirectoryRecord.cs
│ ├── ExtFileSystem.cs
│ ├── ExtFileSystemOptions.cs
│ ├── Extent.cs
│ ├── ExtentBlock.cs
│ ├── ExtentHeader.cs
│ ├── ExtentIndex.cs
│ ├── ExtentsFileBuffer.cs
│ ├── File.cs
│ ├── FileBuffer.cs
│ ├── FileSystemFactory.cs
│ ├── IncompatibleFeatures.cs
│ ├── Inode.cs
│ ├── InodeFlags.cs
│ ├── ReadOnlyCompatibleFeatures.cs
│ ├── SuperBlock.cs
│ ├── Symlink.cs
│ └── VfsExtFileSystem.cs
├── Fat
│ ├── ClusterReader.cs
│ ├── ClusterStream.cs
│ ├── Directory.cs
│ ├── DirectoryEntry.cs
│ ├── FatAttributes.cs
│ ├── FatBuffer.cs
│ ├── FatFileStream.cs
│ ├── FatFileSystem.cs
│ ├── FatFileSystemOptions.cs
│ ├── FatType.cs
│ ├── FileAllocationTable.cs
│ ├── FileName.cs
│ └── FileSystemFactory.cs
├── FileLocator.cs
├── FileSystemInfo.cs
├── FileSystemManager.cs
├── FileSystemParameters.cs
├── FileTransport.cs
├── FloppyDiskType.cs
├── GenericDiskAdapterType.cs
├── Geometry.cs
├── GeometryTranslation.cs
├── HfsPlus
│ ├── BTree.cs
│ ├── BTreeGenericRecord.cs
│ ├── BTreeHeaderNode.cs
│ ├── BTreeHeaderRecord.cs
│ ├── BTreeIndexNode.cs
│ ├── BTreeIndexRecord.cs
│ ├── BTreeKey.cs
│ ├── BTreeKeyedNode.cs
│ ├── BTreeLeafNode.cs
│ ├── BTreeLeafRecord.cs
│ ├── BTreeNode.cs
│ ├── BTreeNodeDescriptor.cs
│ ├── BTreeNodeKind.cs
│ ├── BTreeNodeRecord.cs
│ ├── BTree_T.cs
│ ├── CatalogDirInfo.cs
│ ├── CatalogFileInfo.cs
│ ├── CatalogKey.cs
│ ├── CatalogNodeId.cs
│ ├── CatalogRecordType.cs
│ ├── CatalogThread.cs
│ ├── CommonCatalogFileInfo.cs
│ ├── Context.cs
│ ├── DirEntry.cs
│ ├── Directory.cs
│ ├── ExtentDescriptor.cs
│ ├── ExtentKey.cs
│ ├── File.cs
│ ├── FileBuffer.cs
│ ├── FileInfo.cs
│ ├── FileSystemFactory.cs
│ ├── FinderFlags.cs
│ ├── ForkData.cs
│ ├── HfsPlusFileSystem.cs
│ ├── HfsPlusFileSystemImpl.cs
│ ├── HfsPlusUtilities.cs
│ ├── Point.cs
│ ├── VolumeAttributes.cs
│ └── VolumeHeader.cs
├── IBuffer.cs
├── IByteArraySerializable.cs
├── IClusterBasedFileSystem.cs
├── IDiagnosticTraceable.cs
├── IFileSystem.cs
├── IMappedBuffer.cs
├── IUnixFileSystem.cs
├── IWindowsFileSystem.cs
├── InvalidFileSystemException.cs
├── Iscsi
│ ├── Authenticator.cs
│ ├── BaseResponse.cs
│ ├── BasicHeaderSegment.cs
│ ├── ChapAuthenticator.cs
│ ├── CommandRequest.cs
│ ├── Connection.cs
│ ├── DataInPacket.cs
│ ├── DataOutPacket.cs
│ ├── Disk.cs
│ ├── DiskStream.cs
│ ├── DiskTransport.cs
│ ├── Initiator.cs
│ ├── InvalidProtocolException.cs
│ ├── IscsiException.cs
│ ├── LoginException.cs
│ ├── LoginRequest.cs
│ ├── LoginResponse.cs
│ ├── LoginStatusClass.cs
│ ├── LogoutRequest.cs
│ ├── LogoutResponse.cs
│ ├── LunCapacity.cs
│ ├── LunInfo.cs
│ ├── NullAuthenticator.cs
│ ├── OpCode.cs
│ ├── ProtocolDataUnit.cs
│ ├── ProtocolKeyAttribute.cs
│ ├── ProtocolKeyValueAttribute.cs
│ ├── ReadyToTransferPacket.cs
│ ├── RejectPacket.cs
│ ├── Response.cs
│ ├── ScsiCommand.cs
│ ├── ScsiCommandException.cs
│ ├── ScsiInquiryCommand.cs
│ ├── ScsiInquiryStandardResponse.cs
│ ├── ScsiRawCommand.cs
│ ├── ScsiReadCapacityCommand.cs
│ ├── ScsiReadCapacityResponse.cs
│ ├── ScsiReadCommand.cs
│ ├── ScsiReportLunsCommand.cs
│ ├── ScsiReportLunsResponse.cs
│ ├── ScsiResponse.cs
│ ├── ScsiStatus.cs
│ ├── ScsiWriteCommand.cs
│ ├── Session.cs
│ ├── TargetAddress.cs
│ ├── TargetInfo.cs
│ ├── TextBuffer.cs
│ ├── TextRequest.cs
│ └── TextResponse.cs
├── Iso9660
│ ├── BaseVolumeDescriptor.cs
│ ├── BootDeviceEmulation.cs
│ ├── BootInitialEntry.cs
│ ├── BootValidationEntry.cs
│ ├── BootVolumeDescriptor.cs
│ ├── BootVolumeDescriptorRegion.cs
│ ├── BuildDirectoryInfo.cs
│ ├── BuildDirectoryMember.cs
│ ├── BuildFileInfo.cs
│ ├── BuildParameters.cs
│ ├── CDBuilder.cs
│ ├── CDReader.cs
│ ├── CommonVolumeDescriptor.cs
│ ├── DirectoryExtent.cs
│ ├── DirectoryRecord.cs
│ ├── ExtentStream.cs
│ ├── File.cs
│ ├── FileExtent.cs
│ ├── Iso9660Variant.cs
│ ├── IsoContext.cs
│ ├── IsoUtilities.cs
│ ├── PathTable.cs
│ ├── PathTableRecord.cs
│ ├── PrimaryVolumeDescriptor.cs
│ ├── PrimaryVolumeDescriptorRegion.cs
│ ├── ReaderDirEntry.cs
│ ├── ReaderDirectory.cs
│ ├── RockRidge
│ │ ├── ChildLinkSystemUseEntry.cs
│ │ ├── FileTimeSystemUseEntry.cs
│ │ ├── PosixFileInfoSystemUseEntry.cs
│ │ ├── PosixNameSystemUseEntry.cs
│ │ └── RockRidgeExtension.cs
│ ├── SupplementaryVolumeDescriptor.cs
│ ├── SupplementaryVolumeDescriptorRegion.cs
│ ├── Susp
│ │ ├── ContinuationSystemUseEntry.cs
│ │ ├── ExtensionSelectSystemUseEntry.cs
│ │ ├── ExtensionSystemUseEntry.cs
│ │ ├── GenericSuspExtension.cs
│ │ ├── GenericSystemUseEntry.cs
│ │ ├── PaddingSystemUseEntry.cs
│ │ ├── SharingProtocolSystemUseEntry.cs
│ │ ├── SuspExtension.cs
│ │ ├── SuspRecords.cs
│ │ ├── SystemUseEntry.cs
│ │ └── TerminatorSystemUseEntry.cs
│ ├── VfsCDReader.cs
│ ├── VolumeDescriptorRegion.cs
│ ├── VolumeDescriptorSetTerminator.cs
│ └── VolumeDescriptorSetTerminatorRegion.cs
├── LittleEndianDataReader.cs
├── LocalFileLocator.cs
├── LogicalDiskManager
│ ├── ComponentRecord.cs
│ ├── Database.cs
│ ├── DatabaseHeader.cs
│ ├── DatabaseRecord.cs
│ ├── DiskGroupRecord.cs
│ ├── DiskRecord.cs
│ ├── DynamicDisk.cs
│ ├── DynamicDiskGroup.cs
│ ├── DynamicDiskManager.cs
│ ├── DynamicDiskManagerFactory.cs
│ ├── DynamicVolume.cs
│ ├── ExtentMergeType.cs
│ ├── ExtentRecord.cs
│ ├── PrivateHeader.cs
│ ├── RecordType.cs
│ ├── TocBlock.cs
│ └── VolumeRecord.cs
├── LogicalVolumeFactory.cs
├── LogicalVolumeFactoryAttribute.cs
├── LogicalVolumeInfo.cs
├── MappedStream.cs
├── MirrorStream.cs
├── NativeFileSystem.cs
├── Net
│ └── Dns
│ │ ├── CanonicalNameRecord.cs
│ │ ├── DnsClient.cs
│ │ ├── Ip4AddressRecord.cs
│ │ ├── Message.cs
│ │ ├── MessageFlags.cs
│ │ ├── MulticastDnsClient.cs
│ │ ├── OpCode.cs
│ │ ├── PacketReader.cs
│ │ ├── PacketWriter.cs
│ │ ├── PointerRecord.cs
│ │ ├── Question.cs
│ │ ├── RecordClass.cs
│ │ ├── RecordType.cs
│ │ ├── ResourceRecord.cs
│ │ ├── ResponseCode.cs
│ │ ├── ServiceDiscoveryClient.cs
│ │ ├── ServiceInstance.cs
│ │ ├── ServiceInstanceEndPoint.cs
│ │ ├── ServiceInstanceFields.cs
│ │ ├── ServiceRecord.cs
│ │ ├── TextRecord.cs
│ │ ├── Transaction.cs
│ │ └── UnicastDnsClient.cs
├── Nfs
│ ├── DiskTransport.cs
│ ├── Nfs3.cs
│ ├── Nfs3AccessPermissions.cs
│ ├── Nfs3AccessResult.cs
│ ├── Nfs3CallResult.cs
│ ├── Nfs3Client.cs
│ ├── Nfs3CreateResult.cs
│ ├── Nfs3DirectoryEntry.cs
│ ├── Nfs3Exception.cs
│ ├── Nfs3Export.cs
│ ├── Nfs3FileAttributes.cs
│ ├── Nfs3FileHandle.cs
│ ├── Nfs3FileStream.cs
│ ├── Nfs3FileSystemInfo.cs
│ ├── Nfs3FileSystemInfoResult.cs
│ ├── Nfs3FileSystemProperties.cs
│ ├── Nfs3FileTime.cs
│ ├── Nfs3FileType.cs
│ ├── Nfs3GetAttributesResult.cs
│ ├── Nfs3LookupResult.cs
│ ├── Nfs3ModifyResult.cs
│ ├── Nfs3Mount.cs
│ ├── Nfs3MountResult.cs
│ ├── Nfs3ReadDirPlusResult.cs
│ ├── Nfs3ReadResult.cs
│ ├── Nfs3RenameResult.cs
│ ├── Nfs3SetAttributes.cs
│ ├── Nfs3WeakCacheConsistency.cs
│ ├── Nfs3WeakCacheConsistencyAttr.cs
│ ├── Nfs3WriteResult.cs
│ ├── NfsFileSystem.cs
│ ├── NfsFileSystemOptions.cs
│ ├── PortMapper.cs
│ ├── RpcAcceptedReplyHeader.cs
│ ├── RpcAuthentication.cs
│ ├── RpcCallHeader.cs
│ ├── RpcClient.cs
│ ├── RpcCredentials.cs
│ ├── RpcException.cs
│ ├── RpcMessageHeader.cs
│ ├── RpcMismatchInfo.cs
│ ├── RpcNullCredentials.cs
│ ├── RpcProgram.cs
│ ├── RpcRejectedReplyHeader.cs
│ ├── RpcReply.cs
│ ├── RpcReplyHeader.cs
│ ├── RpcTcpTransport.cs
│ ├── RpcUnixCredential.cs
│ ├── XdrDataReader.cs
│ └── XdrDataWriter.cs
├── Ntfs
│ ├── AttributeDefinitionRecord.cs
│ ├── AttributeDefinitions.cs
│ ├── AttributeList.cs
│ ├── AttributeListRecord.cs
│ ├── AttributeRecord.cs
│ ├── AttributeReference.cs
│ ├── AttributeType.cs
│ ├── BiosParameterBlock.cs
│ ├── Bitmap.cs
│ ├── ClusterBitmap.cs
│ ├── ClusterStream.cs
│ ├── CompressedClusterStream.cs
│ ├── CookedDataRun.cs
│ ├── CookedDataRuns.cs
│ ├── DataRun.cs
│ ├── Directory.cs
│ ├── DirectoryEntry.cs
│ ├── File.cs
│ ├── FileNameRecord.cs
│ ├── FileRecord.cs
│ ├── FileRecordReference.cs
│ ├── FileSystemFactory.cs
│ ├── FixupRecordBase.cs
│ ├── GenericFixupRecord.cs
│ ├── Index.cs
│ ├── IndexBlock.cs
│ ├── IndexEntry.cs
│ ├── IndexHeader.cs
│ ├── IndexNode.cs
│ ├── IndexRoot.cs
│ ├── IndexView.cs
│ ├── Internals
│ │ ├── AttributeFlags.cs
│ │ ├── AttributeListAttribute.cs
│ │ ├── AttributeListEntry.cs
│ │ ├── EntryState.cs
│ │ ├── EntryStates.cs
│ │ ├── FileNameAttribute.cs
│ │ ├── GenericAttribute.cs
│ │ ├── MasterFileTable.cs
│ │ ├── MasterFileTableAttribute.cs
│ │ ├── MasterFileTableEntry.cs
│ │ ├── MasterFileTableEntryFlags.cs
│ │ ├── MasterFileTableRecord.cs
│ │ ├── MasterFileTableRecordFlags.cs
│ │ ├── MasterFileTableReference.cs
│ │ ├── NtfsFileAttributes.cs
│ │ ├── NtfsNamespace.cs
│ │ ├── StandardInformationAttribute.cs
│ │ └── UnknownAttribute.cs
│ ├── LZNT1.cs
│ ├── LzWindowDictionary.cs
│ ├── MasterFileTable.cs
│ ├── NewFileOptions.cs
│ ├── NonResidentAttributeBuffer.cs
│ ├── NonResidentAttributeRecord.cs
│ ├── NonResidentDataBuffer.cs
│ ├── NtfsAttribute.cs
│ ├── NtfsAttributeBuffer.cs
│ ├── NtfsContext.cs
│ ├── NtfsFileStream.cs
│ ├── NtfsFileSystem.cs
│ ├── NtfsFileSystemChecker.cs
│ ├── NtfsFormatOptions.cs
│ ├── NtfsFormatter.cs
│ ├── NtfsOptions.cs
│ ├── NtfsStream.cs
│ ├── NtfsTransaction.cs
│ ├── ObjectId.cs
│ ├── ObjectIdRecord.cs
│ ├── ObjectIds.cs
│ ├── Quotas.cs
│ ├── RawClusterStream.cs
│ ├── ReparsePointRecord.cs
│ ├── ReparsePoints.cs
│ ├── ResidentAttributeRecord.cs
│ ├── SecurityDescriptor.cs
│ ├── SecurityDescriptorRecord.cs
│ ├── SecurityDescriptors.cs
│ ├── ShortFileNameOption.cs
│ ├── SparseClusterStream.cs
│ ├── StandardInformation.cs
│ ├── StructuredNtfsAttribute.cs
│ ├── UpperCase.cs
│ ├── VolumeInformation.cs
│ ├── VolumeInformationFlags.cs
│ └── VolumeName.cs
├── Numbers.cs
├── ObjectCache.cs
├── Optical
│ ├── Disc.cs
│ ├── DiscFactory.cs
│ ├── DiscImageFile.cs
│ ├── FileSystemFactory.cs
│ ├── Mode2Buffer.cs
│ └── OpticalFormat.cs
├── OpticalDiscSharing
│ ├── Disc.cs
│ ├── DiscContentBuffer.cs
│ ├── DiscImageFile.cs
│ ├── DiscInfo.cs
│ ├── DiscTransport.cs
│ ├── OpticalDiscService.cs
│ └── OpticalDiscServiceClient.cs
├── Ownership.cs
├── Partitions
│ ├── BiosExtendedPartitionTable.cs
│ ├── BiosPartitionInfo.cs
│ ├── BiosPartitionRecord.cs
│ ├── BiosPartitionTable.cs
│ ├── BiosPartitionTypes.cs
│ ├── BiosPartitionedDiskBuilder.cs
│ ├── DefaultPartitionTableFactory.cs
│ ├── GptEntry.cs
│ ├── GptHeader.cs
│ ├── GuidPartitionInfo.cs
│ ├── GuidPartitionTable.cs
│ ├── GuidPartitionTypes.cs
│ ├── PartitionInfo.cs
│ ├── PartitionTable.cs
│ ├── PartitionTableFactory.cs
│ ├── PartitionTableFactoryAttribute.cs
│ └── WellKnownPartitionType.cs
├── PassthroughStreamBuilder.cs
├── PhysicalVolumeInfo.cs
├── Plist.cs
├── Properties
│ └── AssemblyInfo.cs
├── PumpProgressEventArgs.cs
├── Range.cs
├── Raw
│ ├── Disk.cs
│ ├── DiskFactory.cs
│ └── DiskImageFile.cs
├── ReadOnlyDiscFileSystem.cs
├── Registry
│ ├── Bin.cs
│ ├── BinHeader.cs
│ ├── Cell.cs
│ ├── HiveHeader.cs
│ ├── KeyNodeCell.cs
│ ├── ListCell.cs
│ ├── RegistryCorruptException.cs
│ ├── RegistryHive.cs
│ ├── RegistryKey.cs
│ ├── RegistryKeyFlags.cs
│ ├── RegistryValue.cs
│ ├── RegistryValueType.cs
│ ├── SecurityCell.cs
│ ├── SubKeyHashedListCell.cs
│ ├── SubKeyIndirectListCell.cs
│ ├── ValueCell.cs
│ └── ValueFlags.cs
├── ReparsePoint.cs
├── Resources.Designer.cs
├── Resources.resx
├── Resources
│ ├── XVA_ova_base.xml
│ ├── XVA_ova_ref.xml
│ ├── XVA_ova_sr.xml
│ ├── XVA_ova_vbd.xml
│ ├── XVA_ova_vdi.xml
│ └── XVA_ova_vm.xml
├── Sdi
│ ├── FileHeader.cs
│ ├── SdiFile.cs
│ ├── Section.cs
│ └── SectionRecord.cs
├── Sizes.cs
├── SnapshotStream.cs
├── SparseMemoryBuffer.cs
├── SparseMemoryStream.cs
├── SparseStream.cs
├── SquashFs
│ ├── BuilderContext.cs
│ ├── BuilderDirectory.cs
│ ├── BuilderFile.cs
│ ├── BuilderNode.cs
│ ├── Context.cs
│ ├── DeviceInode.cs
│ ├── Directory.cs
│ ├── DirectoryEntry.cs
│ ├── DirectoryHeader.cs
│ ├── DirectoryInode.cs
│ ├── DirectoryRecord.cs
│ ├── ExtendedDirectoryInode.cs
│ ├── File.cs
│ ├── FileContentBuffer.cs
│ ├── FileSystemFactory.cs
│ ├── FragmentRecord.cs
│ ├── FragmentWriter.cs
│ ├── IDirectoryInode.cs
│ ├── IdTableWriter.cs
│ ├── Inode.cs
│ ├── InodeType.cs
│ ├── Metablock.cs
│ ├── MetablockReader.cs
│ ├── MetablockWriter.cs
│ ├── MetadataRef.cs
│ ├── RegularInode.cs
│ ├── SquashFileSystemBuilder.cs
│ ├── SquashFileSystemReader.cs
│ ├── SuperBlock.cs
│ ├── Symlink.cs
│ ├── SymlinkInode.cs
│ └── VfsSquashFileSystemReader.cs
├── StreamBuffer.cs
├── StreamBuilder.cs
├── StreamExtent.cs
├── StreamPump.cs
├── StripedStream.cs
├── SubBuffer.cs
├── SubStream.cs
├── ThreadSafeStream.cs
├── Tuple.cs
├── Tuple_2.cs
├── Tuple_3.cs
├── Udf
│ ├── AnchorVolumeDescriptorPointer.cs
│ ├── ApplicationEntityIdentifier.cs
│ ├── BaseTaggedDescriptor.cs
│ ├── CharacterSetSpecification.cs
│ ├── DescriptorTag.cs
│ ├── Directory.cs
│ ├── DomainEntityIdentifier.cs
│ ├── EntityIdentifier.cs
│ ├── ExtendedAttribute.cs
│ ├── ExtendedAttributeRecord.cs
│ ├── ExtendedFileEntry.cs
│ ├── ExtentAllocationDescriptor.cs
│ ├── ExtentDescriptor.cs
│ ├── File.cs
│ ├── FileContentBuffer.cs
│ ├── FileEntry.cs
│ ├── FileIdentifier.cs
│ ├── FilePermissions.cs
│ ├── FileSetDescriptor.cs
│ ├── FileType.cs
│ ├── ImplementationEntityIdentifier.cs
│ ├── ImplementationUseExtendedAttributeRecord.cs
│ ├── InformationControlBlock.cs
│ ├── LogicalBlockAddress.cs
│ ├── LogicalPartition.cs
│ ├── LogicalVolumeDescriptor.cs
│ ├── LongAllocationDescriptor.cs
│ ├── MetadataPartition.cs
│ ├── MetadataPartitionMap.cs
│ ├── Partition.cs
│ ├── PartitionDescriptor.cs
│ ├── PartitionMap.cs
│ ├── PhysicalPartition.cs
│ ├── PrimaryVolumeDescriptor.cs
│ ├── ShortAllocationDescriptor.cs
│ ├── SparablePartitionMap.cs
│ ├── TaggedDescriptor.cs
│ ├── Type1Partition.cs
│ ├── Type1PartitionMap.cs
│ ├── UdfContext.cs
│ ├── UdfEntityIdentifier.cs
│ ├── UdfReader.cs
│ ├── UdfUtilities.cs
│ ├── UnallocatedSpaceDescriptor.cs
│ └── VirtualPartitionMap.cs
├── UnixFilePermissions.cs
├── UnixFileSystemInfo.cs
├── UnixFileType.cs
├── Utilities.cs
├── Vdi
│ ├── Disk.cs
│ ├── DiskFactory.cs
│ ├── DiskImageFile.cs
│ ├── DiskStream.cs
│ ├── FileVersion.cs
│ ├── GeometryRecord.cs
│ ├── HeaderRecord.cs
│ ├── ImageFlags.cs
│ ├── ImageType.cs
│ └── PreHeaderRecord.cs
├── Vfs
│ ├── IVfsDirectory.cs
│ ├── IVfsFile.cs
│ ├── IVfsSymlink.cs
│ ├── VfsContext.cs
│ ├── VfsDirEntry.cs
│ ├── VfsFileSystem.cs
│ ├── VfsFileSystemFacade.cs
│ ├── VfsFileSystemFactory.cs
│ ├── VfsFileSystemFactoryAttribute.cs
│ ├── VfsFileSystemInfo.cs
│ └── VfsReadOnlyFileSystem.cs
├── Vhd
│ ├── Disk.cs
│ ├── DiskBuilder.cs
│ ├── DiskExtent.cs
│ ├── DiskFactory.cs
│ ├── DiskImageFile.cs
│ ├── DiskImageFileInfo.cs
│ ├── DynamicDiskBuilder.cs
│ ├── DynamicHeader.cs
│ ├── DynamicStream.cs
│ ├── FileChecker.cs
│ ├── FileType.cs
│ ├── Footer.cs
│ ├── Header.cs
│ └── ParentLocator.cs
├── Vhdx
│ ├── BatEntry.cs
│ ├── BlockBitmap.cs
│ ├── Chunk.cs
│ ├── ContentStream.cs
│ ├── Disk.cs
│ ├── DiskExtent.cs
│ ├── DiskFactory.cs
│ ├── DiskImageFile.cs
│ ├── FileHeader.cs
│ ├── FileParameters.cs
│ ├── FileParametersFlags.cs
│ ├── FreeSpaceTable.cs
│ ├── Metadata.cs
│ ├── MetadataEntry.cs
│ ├── MetadataEntryFlags.cs
│ ├── MetadataEntryKey.cs
│ ├── MetadataTable.cs
│ ├── ParentLocator.cs
│ ├── PayloadBlockStatus.cs
│ ├── RegionEntry.cs
│ ├── RegionFlags.cs
│ ├── RegionTable.cs
│ └── VhdxHeader.cs
├── VirtualDisk.cs
├── VirtualDiskClass.cs
├── VirtualDiskExtent.cs
├── VirtualDiskFactory.cs
├── VirtualDiskFactoryAttribute.cs
├── VirtualDiskLayer.cs
├── VirtualDiskParameters.cs
├── VirtualDiskTransport.cs
├── VirtualDiskTransportAttribute.cs
├── VirtualDiskTypeInfo.cs
├── Vmdk
│ ├── CommonSparseExtentHeader.cs
│ ├── CommonSparseExtentStream.cs
│ ├── CompressedGrainHeader.cs
│ ├── DescriptorFile.cs
│ ├── DescriptorFileEntry.cs
│ ├── Disk.cs
│ ├── DiskAdapterType.cs
│ ├── DiskBuilder.cs
│ ├── DiskCreateType.cs
│ ├── DiskExtent.cs
│ ├── DiskFactory.cs
│ ├── DiskImageFile.cs
│ ├── DiskParameters.cs
│ ├── ExtentDescriptor.cs
│ ├── HostedSparseExtentFlags.cs
│ ├── HostedSparseExtentHeader.cs
│ ├── HostedSparseExtentStream.cs
│ ├── MonolithicSparseExtentBuilder.cs
│ ├── ServerSparseExtentHeader.cs
│ ├── ServerSparseExtentStream.cs
│ └── VmfsSparseExtentBuilder.cs
├── VolumeInfo.cs
├── VolumeManager.cs
├── Wim
│ ├── AlternateStreamEntry.cs
│ ├── DirectoryEntry.cs
│ ├── FileHeader.cs
│ ├── FileResourceStream.cs
│ ├── LzxBitStream.cs
│ ├── LzxStream.cs
│ ├── ResourceInfo.cs
│ ├── ShortResourceHeader.cs
│ ├── WimFile.cs
│ ├── WimFileSystem.cs
│ ├── XpressBitStream.cs
│ └── XpressStream.cs
├── WindowsFileInformation.cs
├── WrappingMappedStream.cs
├── WrappingStream.cs
├── Xva
│ ├── BuildFileRecord.cs
│ ├── ChecksumStream.cs
│ ├── Disk.cs
│ ├── DiskFactory.cs
│ ├── DiskLayer.cs
│ ├── DiskStream.cs
│ ├── FileRecord.cs
│ ├── HashStream.cs
│ ├── TarFile.cs
│ ├── TarFileBuilder.cs
│ ├── TarHeader.cs
│ ├── TarHeaderExtent.cs
│ ├── VirtualMachine.cs
│ └── VirtualMachineBuilder.cs
└── ZeroStream.cs
├── unittests
├── LibraryTests.nunit
├── LibraryTests
│ ├── BlockCacheStreamTest.cs
│ ├── BlockCacheTest.cs
│ ├── BootConfig
│ │ ├── BcdObjectTest.cs
│ │ ├── ElementTest.cs
│ │ ├── ElementValueTest.cs
│ │ └── StoreTest.cs
│ ├── ChsAddressTest.cs
│ ├── Combined
│ │ └── CombinedTest.cs
│ ├── Compression
│ │ ├── BZip2DecoderStreamTest.cs
│ │ └── ZlibStreamTest.cs
│ ├── DiscFileSystemDirectoryTest.cs
│ ├── DiscFileSystemFileTest.cs
│ ├── DiskBuilderFileSystem.cs
│ ├── Fat
│ │ └── FatFileSystemTest.cs
│ ├── FileSystemManagerTest.cs
│ ├── FileSystemSource.cs
│ ├── GeometryTest.cs
│ ├── InMemoryFileSystem.cs
│ ├── Iso9660
│ │ ├── BuilderTest.cs
│ │ ├── IsoDirectoryInfoTest.cs
│ │ ├── IsoFileInfoTest.cs
│ │ └── IsoFileSystemTest.cs
│ ├── LibraryTests.csproj
│ ├── Ntfs
│ │ ├── LZNT1Test.cs
│ │ └── NtfsFileSystemTest.cs
│ ├── Partitions
│ │ ├── BiosPartitionTableTest.cs
│ │ ├── BiosPartitionedDiskBuilderTest.cs
│ │ └── GuidPartitionTableTest.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Registry
│ │ ├── RegistryHiveTest.cs
│ │ └── RegistryKeyTest.cs
│ ├── SquashFs
│ │ ├── SquashFileSystemBuilderTest.cs
│ │ └── SquashFileSystemReaderTest.cs
│ ├── StreamExtentTest.cs
│ ├── ThreadSafeStreamTest.cs
│ ├── Vdi
│ │ ├── DiskTest.cs
│ │ └── StreamTest.cs
│ ├── Vhd
│ │ ├── DiskBuilderTest.cs
│ │ ├── DiskImageFileTest.cs
│ │ ├── DiskTest.cs
│ │ └── DynamicStreamTest.cs
│ ├── VirtualDiskTest.cs
│ ├── Vmdk
│ │ ├── DiskBuilderTest.cs
│ │ ├── DiskTest.cs
│ │ └── DynamicStreamTest.cs
│ └── Xva
│ │ └── VirtualMachineBuilderTest.cs
├── coverage.bat
├── nunit
│ ├── framework
│ │ ├── nunit.framework.dll
│ │ ├── nunit.framework.xml
│ │ └── nunit.mocks.dll
│ ├── lib
│ │ ├── failure.png
│ │ ├── ignored.png
│ │ ├── inconclusive.png
│ │ ├── nunit-console-runner.dll
│ │ ├── nunit-gui-runner.dll
│ │ ├── nunit.core.dll
│ │ ├── nunit.core.interfaces.dll
│ │ ├── nunit.uiexception.dll
│ │ ├── nunit.uikit.dll
│ │ ├── nunit.util.dll
│ │ ├── skipped.png
│ │ └── success.png
│ ├── nunit-agent-x86.exe
│ ├── nunit-agent-x86.exe.config
│ ├── nunit-agent.exe
│ ├── nunit-agent.exe.config
│ ├── nunit-console-x86.exe
│ ├── nunit-console-x86.exe.config
│ ├── nunit-console.exe
│ ├── nunit-console.exe.config
│ ├── nunit-x86.exe
│ ├── nunit-x86.exe.config
│ ├── nunit.exe
│ └── nunit.exe.config
└── pstest.ps1
└── utils
├── BCDDump
├── BCDDump.csproj
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── DiscUtils.Common
├── CommandLineEnumSwitch.cs
├── CommandLineMultiParameter.cs
├── CommandLineParameter.cs
├── CommandLineParser.cs
├── CommandLineSwitch.cs
├── DiscUtils.Common.csproj
├── HexDump.cs
├── ProgramBase.cs
├── Properties
│ └── AssemblyInfo.cs
└── Utilities.cs
├── DiscUtils.PowerShell
├── DiscUtils.Format.ps1xml
├── DiscUtils.PowerShell.csproj
├── DiscUtils.PowerShell.dll-Help.xml
├── DiscUtils.Types.ps1xml
├── DiscUtils.psd1
├── FormatVolumeCommand.cs
├── InitializeVirtualDiskCommand.cs
├── NewVirtualDiskCommand.cs
├── NewVirtualRegistryCommand.cs
├── NewVolumeCommand.cs
├── Properties
│ └── AssemblyInfo.cs
├── README.TXT
├── SnapIn.cs
├── Utilities.cs
├── VirtualDiskProvider
│ ├── ContentEncoding.cs
│ ├── ContentParameters.cs
│ ├── FileContentReaderWriter.cs
│ ├── GetItemParameters.cs
│ ├── NewDriveParameters.cs
│ ├── NewHardLinkDynamicParameters.cs
│ ├── OnDemandVirtualDisk.cs
│ ├── Provider.cs
│ └── VirtualDiskPSDriveInfo.cs
└── VirtualRegistryProvider
│ ├── NewDriveParameters.cs
│ ├── Provider.cs
│ └── VirtualRegistryPSDriveInfo.cs
├── DiskClone
├── Disk.cs
├── DiskClone.csproj
├── DiskStream.cs
├── NativeMethods.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── UnbufferedNativeStream.cs
├── Volume.cs
├── VolumeStream.cs
├── VssAsync.cs
├── VssBackupComponents.cs
├── VssSnapshotProperties.cs
├── Win32Wrapper.cs
├── app.config
└── app.manifest
├── DiskDump
├── DiskDump.csproj
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── ExternalFileSystem
├── ExternalFileSystem.csproj
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── app.config
├── FileExtract
├── FileExtract.csproj
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── FileRecover
├── FileRecover.csproj
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── app.config
├── ISOCreate
├── ISOCreate.csproj
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── MSBuildTask
├── CreateIso.cs
├── CreateSquashFileSystem.cs
├── MSBuildTask.csproj
├── Properties
│ └── AssemblyInfo.cs
├── TaskTest.bat
└── Test.proj
├── NTFSDump
├── NTFSDump.csproj
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── ODSBrowse
├── ODSBrowse.csproj
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── OSClone
├── OSClone.csproj
├── Program.cs
└── Properties
│ └── AssemblyInfo.cs
├── VHDCreate
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── VHDCreate.csproj
├── VHDDump
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── VHDDump.csproj
├── VirtualDiskConvert
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── VirtualDiskConvert.csproj
├── VolInfo
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── VolInfo.csproj
└── iSCSIBrowse
├── Program.cs
├── Properties
└── AssemblyInfo.cs
└── iSCSIBrowse.csproj
/.gitignore:
--------------------------------------------------------------------------------
1 | *.suo
2 | *.wixpdb
3 | *.msi
4 | *.user
5 | *.sdf
6 | *.opensdf
7 | *.nupkg
8 | output
9 | intermediate
10 | obj
11 | bin
12 | _Resharper*
13 | *.ReSharper
14 | ipch
15 | *.InstallLog
16 | packages
17 | *.patch
18 | *.snk
19 | *.suo
20 | DiscUtilsWorking.sln
21 | src/DiscUtils.dll.xml
22 | unittests/results.xml
23 | layout
24 | Help/Output
25 | scratch
26 | *StyleCop.Cache
27 | DiscUtilsScratch.sln
28 | */bin/
29 | *.pidb
30 | *.resources
31 | *.userprefs
32 | unittests/quicktest.ps1
33 | .hg*
34 |
--------------------------------------------------------------------------------
/Help/API Reference.aml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | This section includes full documentation for the DiscUtils class library.
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Help/Content Layout.content:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Help/Contents.aml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | DiscUtils is a .NET library to read and write ISO files and Virtual Machine
7 | disk files (VHD, VDI, XVA, VMDK, etc). This documentation describes the
8 | status of the DiscUtils library and provides API documentation for the
9 | DiscUtils class library.
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Introduction
18 |
19 |
20 | API Reference
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Help/Install_VS2010_Help.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | echo Instructions
4 | echo ------------
5 | echo.
6 | echo 1. Run this batch file as Administrator
7 | echo 2. Select 'Install content from disk'
8 | echo 3. Select the file 'HelpContentSetup.msha' from this folder
9 | echo 4. Select 'Add' for 'DiscUtils Class Library'
10 | echo 5. Click 'Update'
11 | echo 6. Confirm you want to proceed
12 |
13 |
14 | "%ProgramFiles%\Microsoft Help Viewer\v1.0\HelpLibManager.exe" /product "VS" /version "100" /locale en-us
15 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2011, Kenneth Bell
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a
4 | copy of this software and associated documentation files (the "Software"),
5 | to deal in the Software without restriction, including without limitation
6 | the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 | and/or sell copies of the Software, and to permit persons to whom the
8 | Software is furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19 | DEALINGS IN THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/LibraryOnly.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual C# Express 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscUtils", "src\DiscUtils.csproj", "{DBB340F9-2386-43C2-A473-FA496CBE07A4}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {DBB340F9-2386-43C2-A473-FA496CBE07A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {DBB340F9-2386-43C2-A473-FA496CBE07A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {DBB340F9-2386-43C2-A473-FA496CBE07A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {DBB340F9-2386-43C2-A473-FA496CBE07A4}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/Version.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/Version.cs
--------------------------------------------------------------------------------
/changecopyrightyear.ps1:
--------------------------------------------------------------------------------
1 | $old = "2008-2010"
2 | $new = "2008-2011"
3 |
4 | foreach ($file in Get-ChildItem .\* -include *.cs -recurse)
5 | {
6 | $lines = Get-Content $file;
7 | $lines | Foreach-Object { $_ -replace $old, $new } | Set-Content $file;
8 | }
9 |
10 |
11 | $lines = Get-Content "Help\Library.shfbproj"
12 | $lines | Foreach-Object { $_ -replace $old, $new} | Set-Content "Help\Library.shfbproj"
13 |
--------------------------------------------------------------------------------
/common.ps1:
--------------------------------------------------------------------------------
1 | $ver = "0.11"
2 | $fullver = "${ver}.0.0"
3 |
4 | $basedir = "$pwd"
5 | $utilsdir = "C:\utils"
6 | $hg = "C:\Program Files\TortoiseHg\hg.exe"
7 | $msbuild = "c:\windows\Microsoft.NET\Framework\v3.5\msbuild.exe"
8 | $vcsexpress = "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\VCSExpress.exe"
9 | $signingkey = "${pwd}\DiscUtilsSigningKey.snk"
10 | $zip = "${utilsdir}\7za.exe"
11 | $fxcop = "C:\Program Files\Microsoft FXCop 10.0\fxcopcmd.exe"
12 |
--------------------------------------------------------------------------------
/diag/NullTextWriter.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System.Globalization;
24 | using System.IO;
25 | using System.Text;
26 |
27 | namespace DiscUtils.Diagnostics
28 | {
29 | internal sealed class NullTextWriter : TextWriter
30 | {
31 | public NullTextWriter()
32 | : base(CultureInfo.InvariantCulture)
33 | {
34 | }
35 |
36 | public override Encoding Encoding
37 | {
38 | get { return Encoding.Unicode; }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/diag/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("DiscUtils.Diagnostics")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("DiscUtils")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 | [assembly: CLSCompliant(true)]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("7fcbeb6f-63db-43d2-9710-daa94ae602e0")]
23 |
--------------------------------------------------------------------------------
/discutils.sln.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | v4.0
6 |
7 | $(SolutionDir)output\$(TargetFrameworkVersion.Replace(".",""))\$(Platform)\$(Configuration)\bin\
8 | $(SolutionDir)intermediate\$(TargetFrameworkVersion.Replace(".",""))\$(Platform)\$(Configuration)\$(AssemblyName)\
9 | $(BaseIntermediateOutputPath)
10 | $(OutputPath)$(AssemblyName).XML
11 | 1591 1574 1570 0419
12 | true
13 | FRAMEWORK$(TargetFrameworkVersion.Replace(".",""))
14 |
15 |
--------------------------------------------------------------------------------
/src/Block.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | internal class Block
26 | {
27 | public Block()
28 | {
29 | }
30 |
31 | public long Position { get; set; }
32 |
33 | public byte[] Data { get; set; }
34 |
35 | public int Available { get; set; }
36 |
37 | public bool Equals(Block other)
38 | {
39 | return Position == other.Position;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/BootConfig/StringElementValue.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.BootConfig
24 | {
25 | internal class StringElementValue : ElementValue
26 | {
27 | private string _value;
28 |
29 | public StringElementValue(string value)
30 | {
31 | _value = value;
32 | }
33 |
34 | public override ElementFormat Format
35 | {
36 | get { return ElementFormat.String; }
37 | }
38 |
39 | public override string ToString()
40 | {
41 | return _value;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/BuilderBufferExtentSource.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | internal class BuilderBufferExtentSource : BuilderExtentSource
26 | {
27 | private byte[] _buffer;
28 |
29 | public BuilderBufferExtentSource(byte[] buffer)
30 | {
31 | _buffer = buffer;
32 | }
33 |
34 | public override BuilderExtent Fix(long pos)
35 | {
36 | return new BuilderBufferExtent(pos, _buffer);
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/BuilderExtentSource.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | internal abstract class BuilderExtentSource
26 | {
27 | public abstract BuilderExtent Fix(long pos);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/BuilderStreamExtentSource.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | using System.IO;
26 |
27 | internal class BuilderStreamExtentSource : BuilderExtentSource
28 | {
29 | private Stream _stream;
30 |
31 | public BuilderStreamExtentSource(Stream stream)
32 | {
33 | _stream = stream;
34 | }
35 |
36 | public override BuilderExtent Fix(long pos)
37 | {
38 | return new BuilderStreamExtent(pos, _stream);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Crc32.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | internal abstract class Crc32
26 | {
27 | protected readonly uint[] Table;
28 | protected uint _value;
29 |
30 | protected Crc32(uint[] table)
31 | {
32 | Table = table;
33 | _value = 0xFFFFFFFF;
34 | }
35 |
36 | public uint Value
37 | {
38 | get { return _value ^ 0xFFFFFFFF; }
39 | }
40 |
41 | public abstract void Process(byte[] buffer, int offset, int count);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Dmg/BlkxResource.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Dmg
24 | {
25 | using System.Collections.Generic;
26 |
27 | internal class BlkxResource : Resource
28 | {
29 | private CompressedBlock _block;
30 |
31 | internal BlkxResource(Dictionary parts)
32 | : base("blkx", parts)
33 | {
34 | _block = Utilities.ToStruct(parts["Data"] as byte[], 0);
35 | }
36 |
37 | public CompressedBlock Block
38 | {
39 | get { return _block; }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Dmg/GenericResource.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Dmg
24 | {
25 | using System.Collections.Generic;
26 |
27 | internal class GenericResource : Resource
28 | {
29 | internal GenericResource(string type, Dictionary parts)
30 | : base(type, parts)
31 | {
32 | Data = parts["Data"] as byte[];
33 | }
34 |
35 | public byte[] Data { get; set; }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Dmg/RunType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Dmg
24 | {
25 | internal enum RunType : uint
26 | {
27 | None = 0x00000000,
28 | Raw = 0x00000001,
29 | Zeros = 0x00000002,
30 | AdcCompressed = 0x80000004,
31 | ZlibCompressed = 0x80000005,
32 | BZlibCompressed = 0x80000006,
33 | Comment = 0x7FFFFFFE,
34 | Terminator = 0xFFFFFFFF
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Ext/Context.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Ext
24 | {
25 | using System.IO;
26 | using DiscUtils.Vfs;
27 |
28 | internal class Context : VfsContext
29 | {
30 | public Stream RawStream { get; set; }
31 |
32 | public SuperBlock SuperBlock { get; set; }
33 |
34 | public ExtFileSystemOptions Options { get; set; }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Fat/FatAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Fat
24 | {
25 | using System;
26 |
27 | [Flags()]
28 | internal enum FatAttributes : byte
29 | {
30 | ReadOnly = 0x01,
31 | Hidden = 0x02,
32 | System = 0x04,
33 | VolumeId = 0x08,
34 | Directory = 0x10,
35 | Archive = 0x20,
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/FloppyDiskType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | ///
26 | /// The supported Floppy Disk logical formats.
27 | ///
28 | public enum FloppyDiskType
29 | {
30 | ///
31 | /// 720KiB capacity disk.
32 | ///
33 | DoubleDensity = 0,
34 |
35 | ///
36 | /// 1440KiB capacity disk.
37 | ///
38 | HighDensity = 1,
39 |
40 | ///
41 | /// 2880KiB capacity disk.
42 | ///
43 | Extended = 2
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/GenericDiskAdapterType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | ///
26 | /// Well known hard disk adaptor types.
27 | ///
28 | public enum GenericDiskAdapterType
29 | {
30 | ///
31 | /// IDE adaptor.
32 | ///
33 | Ide = 0,
34 |
35 | ///
36 | /// SCSI adaptor.
37 | ///
38 | Scsi = 1
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/HfsPlus/BTree.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | internal delegate int BTreeVisitor(Key key, byte[] data)
26 | where Key : BTreeKey;
27 |
28 | internal abstract class BTree
29 | {
30 | internal abstract int NodeSize { get; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/HfsPlus/BTreeKey.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | using System;
26 |
27 | internal abstract class BTreeKey : IByteArraySerializable, IComparable
28 | {
29 | public abstract int Size
30 | {
31 | get;
32 | }
33 |
34 | public abstract int ReadFrom(byte[] buffer, int offset);
35 |
36 | public abstract void WriteTo(byte[] buffer, int offset);
37 |
38 | public abstract int CompareTo(BTreeKey other);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/HfsPlus/BTreeKeyedNode.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | internal abstract class BTreeKeyedNode : BTreeNode
26 | where TKey : BTreeKey
27 | {
28 | public BTreeKeyedNode(BTree tree, BTreeNodeDescriptor descriptor)
29 | : base(tree, descriptor)
30 | {
31 | }
32 |
33 | public abstract byte[] FindKey(TKey key);
34 |
35 | public abstract void VisitRange(BTreeVisitor visitor);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/HfsPlus/BTreeNodeKind.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | internal enum BTreeNodeKind : sbyte
26 | {
27 | LeafNode = -1,
28 | IndexNode = 0,
29 | HeaderNode = 1,
30 | MapNode = 2
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/HfsPlus/BTreeNodeRecord.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | using System;
26 |
27 | internal abstract class BTreeNodeRecord : IByteArraySerializable
28 | {
29 | public abstract int Size
30 | {
31 | get;
32 | }
33 |
34 | public abstract int ReadFrom(byte[] buffer, int offset);
35 |
36 | public abstract void WriteTo(byte[] buffer, int offset);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/HfsPlus/CatalogRecordType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | internal enum CatalogRecordType : short
26 | {
27 | None = 0x0000,
28 | FolderRecord = 0x0001,
29 | FileRecord = 0x0002,
30 | FolderThreadRecord = 0x0003,
31 | FileThreadRecord = 0x0004,
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/HfsPlus/Context.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | using System.IO;
26 | using DiscUtils.Vfs;
27 |
28 | internal sealed class Context : VfsContext
29 | {
30 | public Stream VolumeStream { get; set; }
31 |
32 | public BTree Catalog { get; set; }
33 |
34 | public BTree ExtentsOverflow { get; set; }
35 |
36 | public VolumeHeader VolumeHeader { get; set; }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/HfsPlus/FinderFlags.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum FinderFlags : ushort
29 | {
30 | None = 0x0000,
31 | IsOnDesk = 0x0001,
32 | Color = 0x000E,
33 | IsShared = 0x0040,
34 | HasNoInits = 0x0080,
35 | HasBeenInitied = 0x0100,
36 | HasCustomIcon = 0x0400,
37 | IsStationary = 0x0800,
38 | NameLocked = 0x1000,
39 | HasBundle = 0x2000,
40 | IsInvisible = 0x4000,
41 | IsAlias = 0x8000,
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/HfsPlus/VolumeAttributes.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.HfsPlus
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum VolumeAttributes : uint
29 | {
30 | None = 0,
31 | VolumeHardwareLock = 0x00000080,
32 | VolumeUnmounted = 0x00000100,
33 | VolumeSparedBlocks = 0x00000200,
34 | VolumeNoCacheRequired = 0x00000400,
35 | BootVolumeInconsistent = 0x00000800,
36 | CatalogNodeIdsReused = 0x00001000,
37 | VolumeJournaled = 0x00002000,
38 | VolumeSoftwareLock = 0x00008000,
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/IDiagnosticTraceable.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | using System.IO;
26 |
27 | ///
28 | /// Interface exposed by objects that can provide a structured trace of their content.
29 | ///
30 | public interface IDiagnosticTraceable
31 | {
32 | ///
33 | /// Writes a diagnostic report about the state of the object to a writer.
34 | ///
35 | /// The writer to send the report to
36 | /// The prefix to place at the start of each line
37 | void Dump(TextWriter writer, string linePrefix);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/IMappedBuffer.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | internal interface IMappedBuffer : IBuffer
26 | {
27 | long MapPosition(long position);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/IUnixFileSystem.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | ///
26 | /// Provides the base class for all file systems that support Unix semantics.
27 | ///
28 | public interface IUnixFileSystem : IFileSystem
29 | {
30 | ///
31 | /// Retrieves Unix-specific information about a file or directory.
32 | ///
33 | /// Path to the file or directory
34 | /// Information about the owner, group, permissions and type of the
35 | /// file or directory.
36 | UnixFileSystemInfo GetUnixFileInfo(string path);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Iscsi/Authenticator.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iscsi
24 | {
25 | internal abstract class Authenticator
26 | {
27 | public abstract string Identifier
28 | {
29 | get;
30 | }
31 |
32 | public abstract bool GetParameters(TextBuffer textBuffer);
33 |
34 | public abstract void SetParameters(TextBuffer textBuffer);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Iscsi/BaseResponse.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iscsi
24 | {
25 | internal abstract class BaseResponse
26 | {
27 | public bool StatusPresent;
28 | public uint StatusSequenceNumber;
29 | public uint ExpectedCommandSequenceNumber;
30 | public uint MaxCommandSequenceNumber;
31 |
32 | public abstract void Parse(ProtocolDataUnit pdu);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Iscsi/NullAuthenticator.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iscsi
24 | {
25 | internal class NullAuthenticator : Authenticator
26 | {
27 | public override string Identifier
28 | {
29 | get { return "None"; }
30 | }
31 |
32 | public override bool GetParameters(TextBuffer textBuffer)
33 | {
34 | return true;
35 | }
36 |
37 | public override void SetParameters(TextBuffer textBuffer)
38 | {
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Iscsi/ProtocolKeyValueAttribute.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iscsi
24 | {
25 | using System;
26 |
27 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
28 | internal sealed class ProtocolKeyValueAttribute : Attribute
29 | {
30 | private string _name;
31 |
32 | public ProtocolKeyValueAttribute(string name)
33 | {
34 | _name = name;
35 | }
36 |
37 | public string Name
38 | {
39 | get { return _name; }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Iscsi/ScsiResponse.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iscsi
24 | {
25 | internal abstract class ScsiResponse
26 | {
27 | public abstract bool Truncated
28 | {
29 | get;
30 | }
31 |
32 | public abstract uint NeededDataLength
33 | {
34 | get;
35 | }
36 |
37 | public abstract void ReadFrom(byte[] buffer, int offset, int count);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Iso9660/BuildParameters.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | internal class BuildParameters
26 | {
27 | public BuildParameters()
28 | {
29 | VolumeIdentifier = string.Empty;
30 | UseJoliet = true;
31 | }
32 |
33 | public bool UseJoliet
34 | {
35 | get;
36 | set;
37 | }
38 |
39 | public string VolumeIdentifier
40 | {
41 | get;
42 | set;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/Iso9660/IsoContext.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | using System.Collections.Generic;
26 | using System.IO;
27 | using DiscUtils.Vfs;
28 |
29 | internal class IsoContext : VfsContext
30 | {
31 | public CommonVolumeDescriptor VolumeDescriptor { get; set; }
32 |
33 | public Stream DataStream { get; set; }
34 |
35 | public bool SuspDetected { get; set; }
36 |
37 | public List SuspExtensions { get; set; }
38 |
39 | public int SuspSkipBytes { get; set; }
40 |
41 | public string RockRidgeIdentifier { get; set; }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Iso9660/RockRidge/PosixNameSystemUseEntry.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | internal sealed class PosixNameSystemUseEntry : SystemUseEntry
26 | {
27 | public byte Flags;
28 | public string NameData;
29 |
30 | public PosixNameSystemUseEntry(byte[] data, int offset)
31 | {
32 | byte len = data[offset + 2];
33 |
34 | Name = "NM";
35 | Version = data[offset + 3];
36 |
37 | CheckLengthAndVersion(len, 5, 1);
38 |
39 | Flags = data[offset + 4];
40 | NameData = Utilities.BytesToString(data, offset + 5, len - 5);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Iso9660/Susp/ExtensionSelectSystemUseEntry.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | internal sealed class ExtensionSelectSystemUseEntry : SystemUseEntry
26 | {
27 | public byte SelectedExtension;
28 |
29 | public ExtensionSelectSystemUseEntry(byte[] data, int offset)
30 | {
31 | byte len = data[offset + 2];
32 |
33 | Name = "ES";
34 | Version = data[offset + 3];
35 |
36 | CheckLengthAndVersion(len, 5, 1);
37 |
38 | SelectedExtension = data[offset + 4];
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Iso9660/Susp/GenericSystemUseEntry.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | using System;
26 |
27 | internal sealed class GenericSystemUseEntry : SystemUseEntry
28 | {
29 | public byte[] Data;
30 |
31 | public GenericSystemUseEntry(byte[] data, int offset)
32 | {
33 | byte len = data[offset + 2];
34 |
35 | Name = Utilities.BytesToString(data, offset, 2);
36 | Version = data[offset + 3];
37 |
38 | CheckLengthAndVersion(len, 4, 1);
39 |
40 | Data = new byte[len - 4];
41 | Array.Copy(data, offset + 4, Data, 0, len - 4);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Iso9660/Susp/PaddingSystemUseEntry.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | internal sealed class PaddingSystemUseEntry : SystemUseEntry
26 | {
27 | public PaddingSystemUseEntry(byte[] data, int offset)
28 | {
29 | byte len = data[offset + 2];
30 |
31 | Name = "PD";
32 | Version = data[offset + 3];
33 |
34 | CheckLengthAndVersion(len, 4, 1);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Iso9660/Susp/SuspExtension.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | using System.Text;
26 |
27 | internal abstract class SuspExtension
28 | {
29 | public abstract string Identifier { get; }
30 |
31 | public abstract SystemUseEntry Parse(string name, byte[] data, int offset, int length, Encoding encoding);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Iso9660/Susp/TerminatorSystemUseEntry.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | internal sealed class TerminatorSystemUseEntry : SystemUseEntry
26 | {
27 | public TerminatorSystemUseEntry(byte[] data, int offset)
28 | {
29 | byte len = data[offset + 2];
30 |
31 | Name = "ST";
32 | Version = data[offset + 3];
33 |
34 | CheckLengthAndVersion(len, 4, 1);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Iso9660/VolumeDescriptorSetTerminator.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Iso9660
24 | {
25 | internal class VolumeDescriptorSetTerminator : BaseVolumeDescriptor
26 | {
27 | public VolumeDescriptorSetTerminator()
28 | : base(VolumeDescriptorType.SetTerminator, 1)
29 | {
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/LogicalDiskManager/DiskRecord.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.LogicalDiskManager
24 | {
25 | internal sealed class DiskRecord : DatabaseRecord
26 | {
27 | public string DiskGuidString;
28 |
29 | protected override void DoReadFrom(byte[] buffer, int offset)
30 | {
31 | base.DoReadFrom(buffer, offset);
32 |
33 | int pos = offset + 0x18;
34 |
35 | Id = ReadVarULong(buffer, ref pos);
36 | Name = ReadVarString(buffer, ref pos);
37 | DiskGuidString = ReadVarString(buffer, ref pos);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/LogicalDiskManager/ExtentMergeType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.LogicalDiskManager
24 | {
25 | internal enum ExtentMergeType : byte
26 | {
27 | None = 0,
28 | Interleaved = 1,
29 | Concatenated = 2
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/LogicalDiskManager/RecordType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.LogicalDiskManager
24 | {
25 | internal enum RecordType : byte
26 | {
27 | None = 0,
28 | Volume = 1,
29 | Component = 2,
30 | Extent = 3,
31 | Disk = 4,
32 | DiskGroup = 5
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/LogicalVolumeFactory.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | using System.Collections.Generic;
26 |
27 | internal abstract class LogicalVolumeFactory
28 | {
29 | public abstract bool HandlesPhysicalVolume(PhysicalVolumeInfo volume);
30 |
31 | public abstract void MapDisks(IEnumerable disks, Dictionary result);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/LogicalVolumeFactoryAttribute.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | using System;
26 |
27 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
28 | internal sealed class LogicalVolumeFactoryAttribute : Attribute
29 | {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Net/Dns/OpCode.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Net.Dns
24 | {
25 | internal enum OpCode : byte
26 | {
27 | Query = 0,
28 | InverseQuery = 1,
29 | StatusRequest = 2
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Net/Dns/ResponseCode.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Net.Dns
24 | {
25 | internal enum ResponseCode : byte
26 | {
27 | Success = 0,
28 | FormatError = 1,
29 | ServerFailure = 2,
30 | NameError = 3,
31 | NotImplemented = 4,
32 | Refused = 5,
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3AccessPermissions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum Nfs3AccessPermissions
29 | {
30 | None = 0x00,
31 | Read = 0x01,
32 | Lookup = 0x02,
33 | Modify = 0x04,
34 | Extend = 0x08,
35 | Delete = 0x10,
36 | Execute = 0x20,
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3AccessResult.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | internal class Nfs3AccessResult : Nfs3CallResult
26 | {
27 | public Nfs3AccessResult(XdrDataReader reader)
28 | {
29 | Status = (Nfs3Status)reader.ReadInt32();
30 | if (reader.ReadBool())
31 | {
32 | ObjectAttributes = new Nfs3FileAttributes(reader);
33 | }
34 |
35 | Access = (Nfs3AccessPermissions)reader.ReadInt32();
36 | }
37 |
38 | public Nfs3FileAttributes ObjectAttributes { get; set; }
39 |
40 | public Nfs3AccessPermissions Access { get; set; }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3CallResult.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | ///
26 | /// Base class for all NFS result structures.
27 | ///
28 | internal abstract class Nfs3CallResult
29 | {
30 | public Nfs3Status Status { get; set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3FileSystemProperties.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum Nfs3FileSystemProperties
29 | {
30 | None = 0,
31 | HardLinks = 1,
32 | SymbolicLinks = 2,
33 | Homogeneous = 4,
34 | SetTime = 8
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3FileType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | internal enum Nfs3FileType
26 | {
27 | None = 0,
28 | File = 1,
29 | Directory = 2,
30 | BlockDevice = 3,
31 | CharacterDevice = 4,
32 | SymbolicLink = 5,
33 | Socket = 6,
34 | NamedPipe = 7
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3GetAttributesResult.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | internal class Nfs3GetAttributesResult : Nfs3CallResult
26 | {
27 | public Nfs3GetAttributesResult(XdrDataReader reader)
28 | {
29 | Status = (Nfs3Status)reader.ReadInt32();
30 | Attributes = new Nfs3FileAttributes(reader);
31 | }
32 |
33 | public Nfs3FileAttributes Attributes { get; set; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3ModifyResult.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | internal sealed class Nfs3ModifyResult : Nfs3CallResult
26 | {
27 | public Nfs3ModifyResult(XdrDataReader reader)
28 | {
29 | Status = (Nfs3Status)reader.ReadInt32();
30 | CacheConsistency = new Nfs3WeakCacheConsistency(reader);
31 | }
32 |
33 | public Nfs3WeakCacheConsistency CacheConsistency { get; set; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3RenameResult.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | internal sealed class Nfs3RenameResult : Nfs3CallResult
26 | {
27 | public Nfs3RenameResult(XdrDataReader reader)
28 | {
29 | Status = (Nfs3Status)reader.ReadInt32();
30 | FromDirCacheConsistency = new Nfs3WeakCacheConsistency(reader);
31 | ToDirCacheConsistency = new Nfs3WeakCacheConsistency(reader);
32 | }
33 |
34 | public Nfs3WeakCacheConsistency FromDirCacheConsistency { get; set; }
35 |
36 | public Nfs3WeakCacheConsistency ToDirCacheConsistency { get; set; }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Nfs/Nfs3WeakCacheConsistencyAttr.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | internal sealed class Nfs3WeakCacheConsistencyAttr
26 | {
27 | public Nfs3WeakCacheConsistencyAttr(XdrDataReader reader)
28 | {
29 | Size = reader.ReadInt64();
30 | ModifyTime = new Nfs3FileTime(reader);
31 | ChangeTime = new Nfs3FileTime(reader);
32 | }
33 |
34 | public long Size { get; set; }
35 |
36 | public Nfs3FileTime ModifyTime { get; set; }
37 |
38 | public Nfs3FileTime ChangeTime { get; set; }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Nfs/RpcCredentials.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | ///
26 | /// Base class for all RPC credentials.
27 | ///
28 | public abstract class RpcCredentials
29 | {
30 | internal RpcCredentials()
31 | {
32 | }
33 |
34 | internal abstract RpcAuthFlavour AuthFlavour { get; }
35 |
36 | internal abstract void Write(XdrDataWriter writer);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Nfs/RpcMismatchInfo.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | internal class RpcMismatchInfo
26 | {
27 | public uint Low;
28 | public uint High;
29 |
30 | public RpcMismatchInfo(XdrDataReader reader)
31 | {
32 | Low = reader.ReadUInt32();
33 | High = reader.ReadUInt32();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Nfs/RpcNullCredentials.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | ///
26 | /// Null RPC credentials, for use with anonymous services / procedures.
27 | ///
28 | public sealed class RpcNullCredentials : RpcCredentials
29 | {
30 | internal override RpcAuthFlavour AuthFlavour
31 | {
32 | get { return RpcAuthFlavour.Null; }
33 | }
34 |
35 | internal override void Write(XdrDataWriter writer)
36 | {
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Nfs/RpcReply.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Nfs
24 | {
25 | internal class RpcReply
26 | {
27 | public RpcMessageHeader Header { get; set; }
28 |
29 | public XdrDataReader BodyReader { get; set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Ntfs/Internals/MasterFileTableAttribute.cs:
--------------------------------------------------------------------------------
1 | namespace DiscUtils.Ntfs.Internals
2 | {
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | public sealed class MasterFileTableAttribute
8 | {
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Ntfs/Internals/MasterFileTableRecordFlags.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Ntfs.Internals
24 | {
25 | using System;
26 |
27 | [Flags]
28 | public enum MasterFileTableRecordFlags : int
29 | {
30 | None = 0x0000,
31 | InUse = 0x0001,
32 | IsDirectory = 0x0002,
33 | IsMetaFile = 0x0004,
34 | HasViewIndex = 0x0008
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Ntfs/Internals/UnknownAttribute.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Ntfs.Internals
24 | {
25 | internal sealed class UnknownAttribute : GenericAttribute
26 | {
27 | public UnknownAttribute(INtfsContext context, AttributeRecord record)
28 | : base(context, record)
29 | {
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Ntfs/VolumeInformationFlags.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Ntfs
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum VolumeInformationFlags : ushort
29 | {
30 | None = 0x00,
31 | Dirty = 0x01,
32 | ResizeLogFile = 0x02,
33 | UpgradeOnMount = 0x04,
34 | MountedOnNT4 = 0x08,
35 | DeleteUSNUnderway = 0x10,
36 | RepairObjectIds = 0x20,
37 | DisableShortNameCreation = 0x80,
38 | ModifiedByChkDsk = 0x8000
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Ownership.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | using System;
26 | using System.Collections.Generic;
27 | using System.Text;
28 |
29 | ///
30 | /// Enumeration used to indicate transfer of disposable objects.
31 | ///
32 | public enum Ownership
33 | {
34 | ///
35 | /// Indicates there is no transfer of ownership.
36 | ///
37 | None,
38 |
39 | ///
40 | /// Indicates ownership of the stream is transfered, the owner should dispose of the stream when appropriate.
41 | ///
42 | Dispose
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Partitions/BiosPartitionTypes.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/src/Partitions/BiosPartitionTypes.cs
--------------------------------------------------------------------------------
/src/Partitions/PartitionTableFactory.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Partitions
24 | {
25 | using System.IO;
26 |
27 | internal abstract class PartitionTableFactory
28 | {
29 | public abstract bool DetectIsPartitioned(Stream s);
30 |
31 | public abstract PartitionTable DetectPartitionTable(VirtualDisk disk);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Partitions/PartitionTableFactoryAttribute.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Partitions
24 | {
25 | using System;
26 |
27 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
28 | internal sealed class PartitionTableFactoryAttribute : Attribute
29 | {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Resources/XVA_ova_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | version
5 |
6 |
7 |
8 | hostname
9 | cheesy-2
10 |
11 |
12 | date
13 | 2008-11-08
14 |
15 |
16 | product_version
17 | 1.0.0
18 |
19 |
20 | product_brand
21 | DiscUtils .NET
22 |
23 |
24 | build_number
25 | 0
26 |
27 |
28 | xapi_major
29 | 1
30 |
31 |
32 | xapi_minor
33 | 2
34 |
35 |
36 | export_vsn
37 | 2
38 |
39 |
40 |
41 |
42 |
43 | objects
44 |
45 |
46 |
47 | {0}
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/Resources/XVA_ova_ref.xml:
--------------------------------------------------------------------------------
1 | {0}
2 |
--------------------------------------------------------------------------------
/src/Sizes.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | internal static class Sizes
26 | {
27 | public const long OneKiB = 1024;
28 | public const long OneMiB = 1024 * OneKiB;
29 | public const long OneGiB = 1024 * OneMiB;
30 |
31 | public const int Sector = 512;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/SquashFs/DeviceInode.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.SquashFs
24 | {
25 | internal sealed class DeviceInode : Inode
26 | {
27 | public uint DeviceId { get; set; }
28 |
29 | public override int Size
30 | {
31 | get { return 24; }
32 | }
33 |
34 | public override int ReadFrom(byte[] buffer, int offset)
35 | {
36 | base.ReadFrom(buffer, offset);
37 |
38 | NumLinks = Utilities.ToInt32LittleEndian(buffer, offset + 16);
39 | DeviceId = Utilities.ToUInt32LittleEndian(buffer, offset + 20);
40 |
41 | return 24;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/SquashFs/IDirectoryInode.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.SquashFs
24 | {
25 | internal interface IDirectoryInode
26 | {
27 | long FileSize { get; }
28 |
29 | uint StartBlock { get; }
30 |
31 | uint ParentInode { get; }
32 |
33 | ushort Offset { get; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/SquashFs/InodeType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.SquashFs
24 | {
25 | internal enum InodeType : ushort
26 | {
27 | Directory = 1,
28 | File = 2,
29 | Symlink = 3,
30 | BlockDevice = 4,
31 | CharacterDevice = 5,
32 | Fifo = 6,
33 | Socket = 7,
34 | ExtendedDirectory = 8,
35 | ExtendedFile = 9,
36 | ExtendedSymlink = 10,
37 | ExtendedBlockDevice = 11,
38 | ExtendedCharacterDevice = 12,
39 | ExtendedFifo = 13,
40 | ExtendedSocket = 14
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/SquashFs/Metablock.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.SquashFs
24 | {
25 | internal sealed class Metablock : Block
26 | {
27 | public long NextBlockStart { get; set; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/SquashFs/Symlink.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.SquashFs
24 | {
25 | using System;
26 | using DiscUtils.Vfs;
27 |
28 | internal class Symlink : File, IVfsSymlink
29 | {
30 | public Symlink(Context context, Inode inode, MetadataRef inodeRef)
31 | : base(context, inode, inodeRef)
32 | {
33 | }
34 |
35 | public string TargetPath
36 | {
37 | get { throw new NotImplementedException(); }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/SquashFs/SymlinkInode.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.SquashFs
24 | {
25 | internal class SymlinkInode : Inode
26 | {
27 | public uint SymlinkSize;
28 |
29 | public override int Size
30 | {
31 | get { return 24; }
32 | }
33 |
34 | public override int ReadFrom(byte[] buffer, int offset)
35 | {
36 | base.ReadFrom(buffer, offset);
37 |
38 | NumLinks = Utilities.ToInt32LittleEndian(buffer, offset + 16);
39 | SymlinkSize = Utilities.ToUInt32LittleEndian(buffer, offset + 20);
40 |
41 | return 24;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Tuple.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | using System;
26 |
27 | internal abstract class Tuple
28 | {
29 | public abstract object this[int i]
30 | {
31 | get;
32 | }
33 |
34 | protected static bool Equals(V a, V b)
35 | {
36 | if (a == null && b == null)
37 | {
38 | return true;
39 | }
40 | else if (a == null)
41 | {
42 | return false;
43 | }
44 | else
45 | {
46 | return a.Equals(b);
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Udf/ApplicationEntityIdentifier.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Udf
24 | {
25 | internal class ApplicationEntityIdentifier : EntityIdentifier
26 | {
27 | public override string ToString()
28 | {
29 | return Identifier;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Udf/ImplementationEntityIdentifier.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Udf
24 | {
25 | using System.Globalization;
26 |
27 | internal class ImplementationEntityIdentifier : EntityIdentifier
28 | {
29 | public override string ToString()
30 | {
31 | OSClass osClass = (OSClass)Suffix[0];
32 | OSIdentifier osId = (OSIdentifier)Utilities.ToUInt16BigEndian(Suffix, 0);
33 | return string.Format(CultureInfo.InvariantCulture, "{0} [OS {1} {2}]", Identifier, osClass, osId);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Udf/Partition.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Udf
24 | {
25 | using System;
26 | using System.Collections.Generic;
27 | using System.Text;
28 |
29 | internal abstract class Partition
30 | {
31 | public abstract IBuffer Content { get; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Udf/Type1PartitionMap.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Udf
24 | {
25 | internal sealed class Type1PartitionMap : PartitionMap
26 | {
27 | public ushort VolumeSequenceNumber;
28 | public ushort PartitionNumber;
29 |
30 | public override int Size
31 | {
32 | get { return 6; }
33 | }
34 |
35 | protected override int Parse(byte[] buffer, int offset)
36 | {
37 | VolumeSequenceNumber = Utilities.ToUInt16LittleEndian(buffer, offset + 2);
38 | PartitionNumber = Utilities.ToUInt16LittleEndian(buffer, offset + 4);
39 | return 6;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Udf/UdfContext.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Udf
24 | {
25 | using System;
26 | using System.Collections.Generic;
27 | using System.Text;
28 | using DiscUtils.Vfs;
29 |
30 | internal class UdfContext : VfsContext
31 | {
32 | public Dictionary PhysicalPartitions;
33 | public int PhysicalSectorSize;
34 |
35 | public List LogicalPartitions;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Udf/VirtualPartitionMap.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Udf
24 | {
25 | internal sealed class VirtualPartitionMap : PartitionMap
26 | {
27 | public ushort VolumeSequenceNumber;
28 | public ushort PartitionNumber;
29 |
30 | public override int Size
31 | {
32 | get { return 64; }
33 | }
34 |
35 | protected override int Parse(byte[] buffer, int offset)
36 | {
37 | VolumeSequenceNumber = Utilities.ToUInt16LittleEndian(buffer, offset + 36);
38 | PartitionNumber = Utilities.ToUInt16LittleEndian(buffer, offset + 38);
39 | return 64;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Utilities.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/src/Utilities.cs
--------------------------------------------------------------------------------
/src/Vdi/FileVersion.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vdi
24 | {
25 | internal struct FileVersion
26 | {
27 | private uint _value;
28 |
29 | public FileVersion(uint value)
30 | {
31 | _value = value;
32 | }
33 |
34 | public int Major
35 | {
36 | get { return (int)(_value >> 16); }
37 | }
38 |
39 | public int Minor
40 | {
41 | get { return (int)(_value & 0xFFFF); }
42 | }
43 |
44 | public uint Value
45 | {
46 | get { return _value; }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Vdi/ImageFlags.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vdi
24 | {
25 | internal enum ImageFlags : uint
26 | {
27 | None = 0x00000000,
28 | Split2G = 0x00000001,
29 | ZeroExpand = 0x00000002
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Vdi/ImageType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vdi
24 | {
25 | internal enum ImageType : uint
26 | {
27 | Dynamic = 1,
28 | Fixed = 2,
29 | Undo = 3,
30 | Differencing = 4,
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Vfs/IVfsSymlink.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vfs
24 | {
25 | ///
26 | /// Interface implemented by classes representing a directory.
27 | ///
28 | /// Concrete type representing directory entries.
29 | /// Concrete type representing files.
30 | public interface IVfsSymlink : IVfsFile
31 | where TDirEntry : VfsDirEntry
32 | where TFile : IVfsFile
33 | {
34 | ///
35 | /// Gets the target path for this symlink.
36 | ///
37 | string TargetPath { get; }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Vfs/VfsContext.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vfs
24 | {
25 | ///
26 | /// Base class for a context object that holds global state for file system implementations.
27 | ///
28 | public abstract class VfsContext
29 | {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Vfs/VfsFileSystemFactoryAttribute.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vfs
24 | {
25 | using System;
26 | using System.Collections.Generic;
27 | using System.Text;
28 |
29 | ///
30 | /// Attribute identifying file system factory classes.
31 | ///
32 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
33 | public sealed class VfsFileSystemFactoryAttribute : Attribute
34 | {
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Vhdx/FileParametersFlags.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2012, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vhdx
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum FileParametersFlags : uint
29 | {
30 | None = 0x00,
31 | LeaveBlocksAllocated = 0x01,
32 | HasParent = 0x02,
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Vhdx/MetadataEntryFlags.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2012, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vhdx
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum MetadataEntryFlags : uint
29 | {
30 | None = 0x00,
31 | IsUser = 0x01,
32 | IsVirtualDisk = 0x02,
33 | IsRequired = 0x04,
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Vhdx/PayloadBlockStatus.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2012, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vhdx
24 | {
25 | internal enum PayloadBlockStatus : ulong
26 | {
27 | NotPresent = 0,
28 | Undefined = 1,
29 | Zero = 2,
30 | Unmapped = 3,
31 | FullyPresent = 6,
32 | PartiallyPresent = 7,
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Vhdx/RegionFlags.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2012, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vhdx
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum RegionFlags : uint
29 | {
30 | None = 0x00,
31 | Required = 0x01,
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/VirtualDiskTransportAttribute.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils
24 | {
25 | using System;
26 |
27 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
28 | internal sealed class VirtualDiskTransportAttribute : Attribute
29 | {
30 | private string _scheme;
31 |
32 | public VirtualDiskTransportAttribute(string scheme)
33 | {
34 | _scheme = scheme;
35 | }
36 |
37 | public string Scheme
38 | {
39 | get { return _scheme; }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Vmdk/CommonSparseExtentHeader.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vmdk
24 | {
25 | using System;
26 | using System.Collections.Generic;
27 | using System.Text;
28 |
29 | internal class CommonSparseExtentHeader
30 | {
31 | public uint MagicNumber;
32 | public uint Version;
33 | public long Capacity;
34 | public long GrainSize;
35 | public long GdOffset;
36 | public uint NumGTEsPerGT;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Vmdk/CompressedGrainHeader.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vmdk
24 | {
25 | internal class CompressedGrainHeader
26 | {
27 | public const int Size = 12;
28 |
29 | public long LogicalBlockAddress;
30 | public int DataSize;
31 |
32 | public void Read(byte[] buffer, int offset)
33 | {
34 | LogicalBlockAddress = Utilities.ToInt64LittleEndian(buffer, offset + 0);
35 | DataSize = Utilities.ToInt32LittleEndian(buffer, offset + 8);
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Vmdk/HostedSparseExtentFlags.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Vmdk
24 | {
25 | using System;
26 |
27 | [Flags]
28 | internal enum HostedSparseExtentFlags : uint
29 | {
30 | None = 0x00000000,
31 | ValidLineDetectionTest = 0x00000001,
32 | RedundantGrainTable = 0x00000002,
33 | CompressedGrains = 0x00010000,
34 | MarkersInUse = 0x00020000
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Xva/FileRecord.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | namespace DiscUtils.Xva
24 | {
25 | internal class FileRecord
26 | {
27 | public string Name;
28 | public long Start;
29 | public long Length;
30 |
31 | public FileRecord(string name, long start, long length)
32 | {
33 | Name = name;
34 | Start = start;
35 | Length = length;
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/unittests/LibraryTests.nunit:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/unittests/LibraryTests/Program.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System;
24 | using System.Reflection;
25 | using System.Runtime.Remoting;
26 |
27 | namespace LibraryTests
28 | {
29 | public class Program
30 | {
31 | [STAThread]
32 | static void Main(string[] args)
33 | {
34 | NUnit.Gui.AppEntry.Main(new string[] { typeof(Program).Assembly.Location });
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/unittests/LibraryTests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("LibraryTests")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("LibraryTests")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("41eaf177-7d35-42bf-aaca-43501ee9de6f")]
22 |
--------------------------------------------------------------------------------
/unittests/coverage.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | "C:\Program Files\Gubka Bob\PartCover .NET 2.3\PartCover.exe" --target .\LibraryTests\bin\Release\LibraryTests.exe --output results.xml --include [DiscUtils]*
3 |
--------------------------------------------------------------------------------
/unittests/nunit/framework/nunit.framework.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/framework/nunit.framework.dll
--------------------------------------------------------------------------------
/unittests/nunit/framework/nunit.mocks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/framework/nunit.mocks.dll
--------------------------------------------------------------------------------
/unittests/nunit/lib/failure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/failure.png
--------------------------------------------------------------------------------
/unittests/nunit/lib/ignored.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/ignored.png
--------------------------------------------------------------------------------
/unittests/nunit/lib/inconclusive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/inconclusive.png
--------------------------------------------------------------------------------
/unittests/nunit/lib/nunit-console-runner.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/nunit-console-runner.dll
--------------------------------------------------------------------------------
/unittests/nunit/lib/nunit-gui-runner.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/nunit-gui-runner.dll
--------------------------------------------------------------------------------
/unittests/nunit/lib/nunit.core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/nunit.core.dll
--------------------------------------------------------------------------------
/unittests/nunit/lib/nunit.core.interfaces.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/nunit.core.interfaces.dll
--------------------------------------------------------------------------------
/unittests/nunit/lib/nunit.uiexception.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/nunit.uiexception.dll
--------------------------------------------------------------------------------
/unittests/nunit/lib/nunit.uikit.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/nunit.uikit.dll
--------------------------------------------------------------------------------
/unittests/nunit/lib/nunit.util.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/nunit.util.dll
--------------------------------------------------------------------------------
/unittests/nunit/lib/skipped.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/skipped.png
--------------------------------------------------------------------------------
/unittests/nunit/lib/success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/lib/success.png
--------------------------------------------------------------------------------
/unittests/nunit/nunit-agent-x86.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/nunit-agent-x86.exe
--------------------------------------------------------------------------------
/unittests/nunit/nunit-agent.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/nunit-agent.exe
--------------------------------------------------------------------------------
/unittests/nunit/nunit-console-x86.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/nunit-console-x86.exe
--------------------------------------------------------------------------------
/unittests/nunit/nunit-console.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/nunit-console.exe
--------------------------------------------------------------------------------
/unittests/nunit/nunit-x86.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/nunit-x86.exe
--------------------------------------------------------------------------------
/unittests/nunit/nunit.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/perpetual-motion/discutils/18375718b6b803432d2b066901dda8fbb0bc7e7a/unittests/nunit/nunit.exe
--------------------------------------------------------------------------------
/utils/BCDDump/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("BCDDump")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("BCDDump")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("f776635f-7a6b-4810-9e31-b8ceb19c34cd")]
22 |
--------------------------------------------------------------------------------
/utils/DiscUtils.Common/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("DiscUtils.Common")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("DiscUtils.Common")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("a1598ea2-95c5-42ef-939b-8af5e6013788")]
22 |
--------------------------------------------------------------------------------
/utils/DiscUtils.PowerShell/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("DiscUtils.PowerShell")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("DiscUtils")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("a21e05a6-9bfe-4102-b7ea-be7d70701fff")]
22 |
--------------------------------------------------------------------------------
/utils/DiscUtils.PowerShell/README.TXT:
--------------------------------------------------------------------------------
1 | .NET DiscUtils PowerShell Module
2 | ================================
3 |
4 | Copyright (c) 2008-2010, Kenneth Bell.
5 |
6 |
7 |
8 | This folder contains the .NET DiscUtils PowerShell module. To use this module,
9 | use this command:
10 |
11 | C:\PS> Import-Module DiscUtils.psd1
12 |
13 |
14 | The module includes two providers, 'virtualdisk' and 'virtualregistry' as well
15 | as a number of commands.
16 |
17 |
18 | To mount a virtual disk as a PowerShell drive do this:
19 | C:\PS> New-PSDrive newdrive -PSProvider virtualdisk -Root C:\disk.vhd [-ReadWrite]
20 |
21 | To mount a registry hive as a PowerShell drive do this:
22 | C:\PS> New-PSDrive regdrive -PSProvider virtualregistry -Root newdrive:\Windows\System32\config\SOFTWARE [-ReadWrite]
23 |
24 | (in this example, we're mounting a registry hive contained in the virtual
25 | disk)
26 |
27 |
28 | The virtualdisk and virtualregistry providers are intended to mimic the
29 | built-in FileSystem and Registry providers.
30 |
31 |
32 | In addition to the providers, these commands are provided:
33 |
34 | New-VirtualDisk
35 | Creates a new virtual disk file.
36 |
37 | Initialize-VirtualDisk
38 | Initializes the partition table on a virtual disk.
39 |
40 | New-Volume
41 | Creates a new volume (aka partition) on a virtual disk.
42 |
43 | Format-Volume
44 | Formats a volume (aka partition) on a virtual disk.
45 |
46 | For more details on these providers, use the Get-Help command.
47 |
--------------------------------------------------------------------------------
/utils/DiscUtils.PowerShell/VirtualDiskProvider/ContentEncoding.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System;
24 | using System.Collections.Generic;
25 | using System.Text;
26 |
27 | namespace DiscUtils.PowerShell.VirtualDiskProvider
28 | {
29 | public enum ContentEncoding
30 | {
31 | Unknown,
32 | String,
33 | Unicode,
34 | Byte,
35 | BigEndianUnicode,
36 | UTF8,
37 | UTF7,
38 | Ascii
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/utils/DiscUtils.PowerShell/VirtualDiskProvider/ContentParameters.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System.Management.Automation;
24 |
25 | namespace DiscUtils.PowerShell.VirtualDiskProvider
26 | {
27 | public class ContentParameters
28 | {
29 | [Parameter]
30 | public ContentEncoding Encoding { get; set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/utils/DiscUtils.PowerShell/VirtualDiskProvider/GetItemParameters.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System.Management.Automation;
24 |
25 | namespace DiscUtils.PowerShell.VirtualDiskProvider
26 | {
27 | public class GetItemParameters
28 | {
29 | [Parameter]
30 | public SwitchParameter ReadWrite
31 | {
32 | get;
33 | set;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/utils/DiscUtils.PowerShell/VirtualDiskProvider/NewDriveParameters.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System.Management.Automation;
24 |
25 | namespace DiscUtils.PowerShell.VirtualDiskProvider
26 | {
27 | public class NewDriveParameters
28 | {
29 | [Parameter]
30 | public SwitchParameter ReadWrite
31 | {
32 | get; set;
33 | }
34 |
35 | [Parameter]
36 | public string DiskType
37 | {
38 | get; set;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/utils/DiscUtils.PowerShell/VirtualDiskProvider/NewHardLinkDynamicParameters.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System.Management.Automation;
24 |
25 | namespace DiscUtils.PowerShell.VirtualDiskProvider
26 | {
27 | public class NewHardLinkDynamicParameters
28 | {
29 | [Parameter]
30 | public string SourcePath
31 | {
32 | get;
33 | set;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/utils/DiscUtils.PowerShell/VirtualRegistryProvider/NewDriveParameters.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System.Management.Automation;
24 |
25 | namespace DiscUtils.PowerShell.VirtualRegistryProvider
26 | {
27 | public class NewDriveParameters
28 | {
29 | [Parameter]
30 | public SwitchParameter ReadWrite
31 | {
32 | get; set;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/utils/DiskClone/DiskStream.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using Microsoft.Win32.SafeHandles;
24 |
25 | namespace DiskClone
26 | {
27 | internal sealed class DiskStream : UnbufferedNativeStream
28 | {
29 | private long _length;
30 |
31 | public DiskStream(SafeFileHandle handle)
32 | : base(handle)
33 | {
34 | _length = Win32Wrapper.GetDiskCapacity(handle);
35 | }
36 |
37 |
38 | public override long Length
39 | {
40 | get { return _length; }
41 | }
42 |
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/utils/DiskClone/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("DiskClone")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("DiskClone")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("abbdc54c-919a-442a-be97-b5b2fe4dec6b")]
22 |
23 |
--------------------------------------------------------------------------------
/utils/DiskClone/VolumeStream.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using Microsoft.Win32.SafeHandles;
24 |
25 | namespace DiskClone
26 | {
27 | internal sealed class VolumeStream : UnbufferedNativeStream
28 | {
29 | private long _length;
30 |
31 | public VolumeStream(SafeFileHandle handle)
32 | : base(handle)
33 | {
34 | var volInfo = Win32Wrapper.GetNtfsVolumeData(handle);
35 | _length = volInfo.TotalClusters * volInfo.BytesPerCluster;
36 | }
37 |
38 |
39 | public override long Length
40 | {
41 | get { return _length; }
42 | }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/utils/DiskClone/VssAsync.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2008-2011, Kenneth Bell
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a
5 | // copy of this software and associated documentation files (the "Software"),
6 | // to deal in the Software without restriction, including without limitation
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 | // and/or sell copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 | // DEALINGS IN THE SOFTWARE.
21 | //
22 |
23 | using System;
24 | using System.Runtime.InteropServices;
25 |
26 | namespace DiskClone
27 | {
28 | [ComImport]
29 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
30 | [Guid("507C37B4-CF5B-4e95-B0AF-14EB9767467E")]
31 | public interface IVssAsync
32 | {
33 | void Cancel();
34 | void Wait(uint millis);
35 | void QueryStatus(out uint hrResult, ref int pReserved);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/utils/DiskClone/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/utils/DiskDump/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("DiskDump")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("DiskDump")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("818b306a-9a03-40aa-9e4c-43798065cdfd")]
22 |
--------------------------------------------------------------------------------
/utils/ExternalFileSystem/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ExternalFileSystem")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("ExternalFileSystem")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("d6e54f59-2e04-49bf-86f8-d328f5c0deb5")]
22 |
--------------------------------------------------------------------------------
/utils/ExternalFileSystem/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/utils/FileExtract/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FileExtract")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("FileExtract")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("51accc87-e2f2-4ca3-be0c-960f2764fddc")]
22 |
--------------------------------------------------------------------------------
/utils/FileRecover/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FileRecover")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("FileRecover")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("9ee5c8d9-027f-4919-aa8d-87f4c19bd815")]
22 |
--------------------------------------------------------------------------------
/utils/FileRecover/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/utils/ISOCreate/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ISOCreate")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("ISOCreate")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("7d222d5e-9060-4bc1-b974-de8f9fdc2f07")]
22 |
--------------------------------------------------------------------------------
/utils/MSBuildTask/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MSBuildTask")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("MSBuildTask")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("4615a7b5-a000-4c0a-b64a-b57ed110fcf2")]
22 |
--------------------------------------------------------------------------------
/utils/MSBuildTask/TaskTest.bat:
--------------------------------------------------------------------------------
1 | call "%VS100COMNTOOLS%\vsvars32.bat"
2 | msbuild /target:RunMyTask Test.proj
3 |
--------------------------------------------------------------------------------
/utils/MSBuildTask/Test.proj:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/utils/NTFSDump/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NTFSDump")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("NTFSDump")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("867f59a3-cec7-4e58-aa6e-d45ba6313788")]
22 |
--------------------------------------------------------------------------------
/utils/ODSBrowse/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ODSBrowse")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("ODSBrowse")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("147a7ae4-d747-44e5-a7a9-512e005a24f7")]
22 |
--------------------------------------------------------------------------------
/utils/OSClone/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OSClone")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("OSClone")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("6514622a-5125-4aee-84ef-347b5ebc27b0")]
22 |
--------------------------------------------------------------------------------
/utils/VHDCreate/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("VHDCreate")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("VHDCreate")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("b2b3871b-8621-4528-8719-b05653595cce")]
22 |
--------------------------------------------------------------------------------
/utils/VHDDump/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("VHDDump")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("VHDDump")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("16af79b5-cecf-44d2-b1af-5bddf898212b")]
22 |
--------------------------------------------------------------------------------
/utils/VirtualDiskConvert/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("VirtualDiskConvert")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("VirtualDiskConvert")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("3bcbb25c-82b8-4f52-8969-ef52c3592c68")]
22 |
--------------------------------------------------------------------------------
/utils/VolInfo/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("VolInfo")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("VolInfo")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("8957cd93-138c-48eb-94f6-2f0e8ef65998")]
22 |
--------------------------------------------------------------------------------
/utils/iSCSIBrowse/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("iSCSIBrowse")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("iSCSIBrowse")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // Setting ComVisible to false makes the types in this assembly not visible
16 | // to COM components. If you need to access a type in this assembly from
17 | // COM, set the ComVisible attribute to true on that type.
18 | [assembly: ComVisible(false)]
19 |
20 | // The following GUID is for the ID of the typelib if this project is exposed to COM
21 | [assembly: Guid("29e0bf8f-f570-44b2-a199-8314f3ff2ea9")]
22 |
--------------------------------------------------------------------------------