C# Class SharpBoot.DriveAccess

Inheritance: IDisposable
Exibir arquivo Open project: zdimension/SharpBoot

Public Properties

Property Type Description
driveStream System.IO.FileStream

Protected Properties

Property Type Description
driveGeometry DriveGeometry
driveHandle SafeFileHandle

Public Methods

Method Description
Dispose ( ) : void
DriveAccess ( string Path ) : System
GetAllDrives ( string DeviceName ) : List

Returns a list of all Drives on the mahine

ReadSectors ( System.UInt64 startSector, System.UInt64 sectorCount, byte Buffer, int offset ) : int

Reads a number of sectors from the opened drive

WriteSectors ( System.UInt64 startSector, System.UInt64 sectorCount, byte Buffer, int offset ) : void

Writes a number of sectors on the opened drive (Untested!!!)

Private Methods

Method Description
CreateFile ( string lpFileName, UInt32 dwDesiredAccess, UInt32 dwShareMode, IntPtr pSecurityAttributes, UInt32 dwCreationDisposition, UInt32 dwFlagsAndAttributes, IntPtr hTemplateFile ) : SafeFileHandle
DeviceIoControl ( IntPtr hDevice, uint dwIoControlCode, IntPtr lpInBuffer, uint nInBufferSize, IntPtr lpOutBuffer, uint nOutBufferSize, uint &lpBytesReturned, IntPtr lpOverlapped ) : bool
QueryDosDevice ( string DeviceName, IntPtr TargetPath, UInt32 ucchMax ) : UInt32

Method Details

Dispose() public method

public Dispose ( ) : void
return void

DriveAccess() public method

public DriveAccess ( string Path ) : System
Path string
return System

GetAllDrives() public static method

Returns a list of all Drives on the mahine
public static GetAllDrives ( string DeviceName ) : List
DeviceName string Can be null
return List

ReadSectors() public method

Reads a number of sectors from the opened drive
public ReadSectors ( System.UInt64 startSector, System.UInt64 sectorCount, byte Buffer, int offset ) : int
startSector System.UInt64 Address of the start sector
sectorCount System.UInt64 Number of sectors to read
Buffer byte The buffer to put data in
offset int Offset of data ub the buffer
return int

WriteSectors() public method

Writes a number of sectors on the opened drive (Untested!!!)
public WriteSectors ( System.UInt64 startSector, System.UInt64 sectorCount, byte Buffer, int offset ) : void
startSector System.UInt64 Address of the start sector
sectorCount System.UInt64 Number of sectors to write
Buffer byte The buffer the data is taken from
offset int Offset of data in the buffer
return void

Property Details

driveGeometry protected_oe property

protected DriveGeometry driveGeometry
return DriveGeometry

driveHandle protected_oe property

protected SafeFileHandle driveHandle
return SafeFileHandle

driveStream public_oe property

public FileStream,System.IO driveStream
return System.IO.FileStream