C# Class TrueLib.SystemDevices

Static wrapper for windows system devices.
Afficher le fichier Open project: nefarius/TrueMount-3

Méthodes publiques

Méthode Description
GetDiskDriveBySignature ( String caption, uint signature ) : System.Management.ManagementObject

Gets a device with given caption and signature.

GetDiskSignatureFromLetter ( String letter, string &caption, uint &signature, uint &partitionNr ) : void

Gets the disk caption, signature and partition number by the drive letter.

GetDriveLetterBySignature ( String caption, uint signature, uint partitionNr ) : String

Gets the drive letter of a logical disk identified by its caption, signature and partition number.

GetLocalDiskPartitions ( ) : List

For debugging: returns identity information about all attached disks.

GetLogicalDisk ( String letter, int drive_type = 3 ) : System.Management.ManagementObject

Gets a logical disk by a drive letter an disk type.

GetPartitionByIndex ( uint DiskIndex, uint Index ) : System.Management.ManagementObject

Gets a partition by its disk index and partition index.

GetPartitionBySignature ( String caption, uint signature, uint partitionNr ) : System.Management.ManagementObject

Gets a partition with a given drive signature and partition index.

GetTCCompatibleDiskPath ( uint index ) : string

Returns a TC compatible path to an encrypted hard disk.

GetTCCompatibleName ( String deviceid ) : String

Converts the device id into a TrueCrypt compatible path.

IsDiskOnline ( string caption, uint signature ) : bool

Checks if a given disk is online.

IsLogicalDiskOnline ( String letter, int type = 2 ) : bool

Checks if logical device is online (=plugged in and mounted with drive letter).

IsPartitionOnline ( string caption, uint signature, uint partitionIndex ) : bool

Checks if a given disk drive partition is online.

IsRemovablePartition ( string deviceId ) : bool

Checks if a partition with given DeviceID is removable.

Private Methods

Méthode Description
ReplaceEvaluator ( Match m ) : string

Contains logic to build a TC compatible device path.

Method Details

GetDiskDriveBySignature() public static méthode

Gets a device with given caption and signature.
public static GetDiskDriveBySignature ( String caption, uint signature ) : System.Management.ManagementObject
caption String Caption (title, name) of the device.
signature uint Signature (10 digit unsigned integer) of the device. May be 0 in some cases.
Résultat System.Management.ManagementObject

GetDiskSignatureFromLetter() public static méthode

Gets the disk caption, signature and partition number by the drive letter.
public static GetDiskSignatureFromLetter ( String letter, string &caption, uint &signature, uint &partitionNr ) : void
letter String Drive letter of the logical disk.
caption string Caption of the disk.
signature uint Signature of the disk.
partitionNr uint Partition number (zero based).
Résultat void

GetDriveLetterBySignature() public static méthode

Gets the drive letter of a logical disk identified by its caption, signature and partition number.
public static GetDriveLetterBySignature ( String caption, uint signature, uint partitionNr ) : String
caption String Caption (title, name) of the disk.
signature uint Signature (10 digit unsigned integer) of the disk.
partitionNr uint Partition number (zero based).
Résultat String

GetLocalDiskPartitions() public static méthode

For debugging: returns identity information about all attached disks.
public static GetLocalDiskPartitions ( ) : List
Résultat List

GetLogicalDisk() public static méthode

Gets a logical disk by a drive letter an disk type.
public static GetLogicalDisk ( String letter, int drive_type = 3 ) : System.Management.ManagementObject
letter String Drive letter of the disk.
drive_type int Optional drive type (3 = local, 2 = removable).
Résultat System.Management.ManagementObject

GetPartitionByIndex() public static méthode

Gets a partition by its disk index and partition index.
public static GetPartitionByIndex ( uint DiskIndex, uint Index ) : System.Management.ManagementObject
DiskIndex uint Disk index (zero based).
Index uint Partition index (zero based).
Résultat System.Management.ManagementObject

GetPartitionBySignature() public static méthode

Gets a partition with a given drive signature and partition index.
public static GetPartitionBySignature ( String caption, uint signature, uint partitionNr ) : System.Management.ManagementObject
caption String The disk drive caption.
signature uint The disk drive signature.
partitionNr uint The zero-based partition number.
Résultat System.Management.ManagementObject

GetTCCompatibleDiskPath() public static méthode

Returns a TC compatible path to an encrypted hard disk.
public static GetTCCompatibleDiskPath ( uint index ) : string
index uint
Résultat string

GetTCCompatibleName() public static méthode

Converts the device id into a TrueCrypt compatible path.
public static GetTCCompatibleName ( String deviceid ) : String
deviceid String Device ID
Résultat String

IsDiskOnline() public static méthode

Checks if a given disk is online.
public static IsDiskOnline ( string caption, uint signature ) : bool
caption string The caption of the disk drive.
signature uint The signature of the disk drive.
Résultat bool

IsLogicalDiskOnline() public static méthode

Checks if logical device is online (=plugged in and mounted with drive letter).
public static IsLogicalDiskOnline ( String letter, int type = 2 ) : bool
letter String Drive letter of the device.
type int
Résultat bool

IsPartitionOnline() public static méthode

Checks if a given disk drive partition is online.
public static IsPartitionOnline ( string caption, uint signature, uint partitionIndex ) : bool
caption string The caption of the disk drive.
signature uint The signature of the disk drive.
partitionIndex uint The zero-based partition index.
Résultat bool

IsRemovablePartition() public static méthode

Checks if a partition with given DeviceID is removable.
public static IsRemovablePartition ( string deviceId ) : bool
deviceId string The disk partition DeviceID.
Résultat bool