PrimoBurner for .NET  5.0
CD, DVD and Blu-ray Software Development Kit
Loading...
Searching...
No Matches
BlockDevice Class Reference

The BlockDevice interface provides methods for reading and writing data CD and DVD in packet mode. More...

Inherits IDisposable.

Public Member Functions

 BlockDevice ()
 Constructor.
 
bool Close ()
 The Close method closes the block device object.
 
void Dispose ()
 Disposes Device and reclaims the resources used by the object.
 
bool FinalizeDisc (DataFile fileSystemLayout, string volumeLabel, bool closeTrack, bool closeSession, bool closeDisc, bool dismount)
 Writes UDF file system structures at the beginning of the disc which makes it read compatible with all operating systems that support UDF.
 
bool Open ()
 The Open method opens the block device object.
 
bool Open (BlockDeviceOpenFlags openFlags)
 The Open method opens the block device object.
 
bool Open (BlockDeviceOpenFlags openFlags, Int32 startAddress)
 The Open method opens the block device object.
 
bool Write (byte[] data, Int32 dataLength, ref Int32 bytesWritten)
 Obsolete.
 
bool Write (byte[]data, Int32 offset, Int32 dataLength)
 This method writes a specified number of bytes to the block device starting at the current write address.
 

Properties

Device Device [get, set]
 Gets/Sets the Device instance that will be used for burning.
 
ErrorInfo Error [get]
 Returns information about the last error that occurred while using the BlockDevice object.
 
bool IsFinalized [get]
 Indicates whether the disc has been finalized.
 
bool SimulateBurn [get, set]
 Gets/Sets a flag indicating whether a simulated burn should be performed.
 
string TempDiscID [get, set]
 Gets/Sets the temporary disc ID.
 
Int32 WriteAddress [get]
 Gets the current write address.
 

Detailed Description

The BlockDevice interface provides methods for reading and writing data CD and DVD in packet mode.

Version
1.63

Member Function Documentation

◆ Close()

bool Close ( )

The Close method closes the block device object.

Returns
true - Close operation succeeded. false - Close operation failed. Check BlockDevice.Error property for the actual cause

◆ FinalizeDisc()

bool FinalizeDisc ( DataFile  fileSystemLayout,
string  volumeLabel,
bool  closeTrack,
bool  closeSession,
bool  closeDisc,
bool  dismount 
)

Writes UDF file system structures at the beginning of the disc which makes it read compatible with all operating systems that support UDF.

Parameters
fileSystemLayoutThe logical file structure of the image, a tree of files and directories that should be used as a file system layout. The first DataFile item in the directory tree is the root of the file system.
volumeLabelVolume label. The max length allowed for the volume label is 32 characters. Only capital letters from A to Z, digits from 0 to 9, and the special characters _ (underscore) are allowed.
closeTrackIndicates that the track should be closed. This parameter is ignored if closeSession is set to true.
closeSessionIndicates that the session should be closed. This parameter is ignored if closeDisc is set to true.
closeDiscIndicates that the disc should be closed.
dismountIndicates whether the OS should dismount the disc after it is finalized.
Returns
true - Finalizing operation succeeded. false - Finalizing operation failed. CHeck BlockDevice.Error property for the actual cause

◆ Open() [1/3]

bool Open ( )

The Open method opens the block device object.

The medium in the device will be formatted and the device will be prepared for sequential writing.

Returns
true - Open operation succeeded. false - Open operation failed. Check BlockDevice.Error property for the actual cause

References BlockDevice.Open().

Referenced by BlockDevice.Open(), and BlockDevice.Open().

◆ Open() [2/3]

bool Open ( BlockDeviceOpenFlags  openFlags)

The Open method opens the block device object.

Parameters
openFlagsType of access to the object. An application can obtain read-only access, write-only access, or read/write access. The default value of this parameter is a combination of the BlockDeviceOpenFlags.Write and BlockDeviceOpenFlags.Format flags.
Returns
true - Open operation succeeded. false - Open operation failed. Check BlockDevice.Error property for the actual cause

References BlockDevice.Open().

◆ Open() [3/3]

bool Open ( BlockDeviceOpenFlags  openFlags,
Int32  startAddress 
)

The Open method opens the block device object.

Parameters
openFlagsType of access to the object. An application can obtain read-only access, write-only access, or read/write access. The default value of this parameter is a combination of the
BlockDeviceOpenFlags.Write and BlockDeviceOpenFlags.Format flags.
startAddressSets the address where the write operation should start from. This value ot this parameter is used only when the target medium is either MediaProfile.DvdRam, or MediaProfile.DvdPlusRw, or MediaProfile.DvdPlusRwDL, or MediaProfile.DvdMinusRwRo, or MediaProfile.BdRe.
Returns
true - Open operation succeeded. false - Open operation failed. Check BlockDevice.Error property for the actual cause

◆ Write() [1/2]

bool Write ( byte[]  data,
Int32  dataLength,
ref Int32  bytesWritten 
)

Obsolete.

Parameters
data
dataLength
bytesWritten
Returns

References PrimoSoftware.Burner.Write.

◆ Write() [2/2]

bool Write ( byte[]  data,
Int32  offset,
Int32  dataLength 
)

This method writes a specified number of bytes to the block device starting at the current write address.

Parameters
dataA buffer with the data that should be written to the device.
dataLengthNumber of bytes from the input buffer to write to the medium. The value of dataLength should be a multiple of BlockSize.Dvd (2048 bytes).
offsetOffset in the input buffer where begins the data that needs to be written.
Returns
true - Write operation succeeded. false - Write operation failed. CHeck BlockDevice.Error property for the actual cause

Property Documentation

◆ Error

ErrorInfo Error
get

Returns information about the last error that occurred while using the BlockDevice object.

See also
BlockDeviceError

◆ IsFinalized

bool IsFinalized
get

Indicates whether the disc has been finalized.

This property should be used only after the device has been successfully opened with the Open method.

The method returns:

  • true - the disc was not created using BlockDevice.
  • true - the disc was created using BlockDevice and is finalized.
  • false - the disc was created using BlockDevice and has not been finalized.
  • false - the media is DVD+RW or Restricted Overwrite DVD-RW (DVD-RW RO).

◆ SimulateBurn

bool SimulateBurn
getset

Gets/Sets a flag indicating whether a simulated burn should be performed.

The default value is false (no simulation).

◆ TempDiscID

string TempDiscID
getset

Gets/Sets the temporary disc ID.

The temporary disc ID is written to the disc when the Open method is called for the first time on a blank disc. This property must be set before calling the Open method, or otherwise it will be ignored. Setting this property to null or empty string will cause BlockDevice to read the ID from the disc when the Open method is called.

The max length allowed for the disc ID is 32 characters. It is a good practice to use the volume label of a disc as a temporary disc id.

The temporary disc id is written at the beginning of a blank disc. Setting the temporary disc id for a partially written disc has no effect.

To read the temporary disc id call the Open method and specify the Read open flag.

The value of the Temporary Disc ID is undefined after the first finalization.

◆ WriteAddress

Int32 WriteAddress
get

Gets the current write address.

This property should be used only after the device has been successfully opened with the Open method.

The method will return 0xFFFFFFFF if there is an error while trying to get the current write address.