StarBurn SDK (Software Development Kit)
ContentsIndexHome
PreviousUpNext
StarBurn_CdvdBurnerGrabber_DiscAtOnceRawPWFromFile Function
C++
__stdcall STARBURN_IMPEX_API EXCEPTION_NUMBER StarBurn_CdvdBurnerGrabber_DiscAtOnceRawPWFromFile(IN PVOID p__PVOID__CdvdBurnerGrabber, OUT PCHAR p__PCHAR__ExceptionText, IN ULONG p__ULONG__ExceptionTextSizeInUCHARs, OUT PULONG p__PULONG__SystemError, OUT PCDB_FAILURE_INFORMATION p__PCDB_FAILURE_INFORMATION, IN PDAO_DISC_LAYOUT p__PDAO_DISC_LAYOUT, IN BOOLEAN p__BOOLEAN__IsXA, IN BOOLEAN p__BOOLEAN__IsTestWrite, IN BOOLEAN p__BOOLEAN__IsNextSessionAllowed, IN BOOLEAN p__BOOLEAN__IsSubChannelRepairRequired, IN ULONG p__ULONG__WriteReportDelayInSeconds, IN ULONG p__ULONG__BufferStatusReportDelayInSeconds);
Parameters 
Description 
IN PVOID p__PVOID__CdvdBurnerGrabber 
Pointer to the CdvdBurnerGrabber object that toolkit allocated before.
 
OUT PCHAR p__PCHAR__ExceptionText 
Pointer to array of CHARs that will be used to store formatted exception description message.
 
IN ULONG p__ULONG__ExceptionTextSizeInUCHARs 
Size of the array of CHARs used to be formatted exception message storage.
 
OUT PULONG p__PULONG__SystemError 
Pointer to ULONG that will contain the system error (if some will occur).
 
OUT PCDB_FAILURE_INFORMATION p__PCDB_FAILURE_INFORMATION 
Pointer to CDB_FAILURE_INFORMATION that will be filled with apropriate values.
 
IN PDAO_DISC_LAYOUT p__PDAO_DISC_LAYOUT 
Pointer to preinitialized DAO disc layout.
 
IN BOOLEAN p__BOOLEAN__IsXA 
BOOLEAN set to TRUE if this is CDROM XA, FALSE if this is ordinary CDROM/CDDA.
 
IN BOOLEAN p__BOOLEAN__IsTestWrite 
BOOLEAN set to TRUE if this is test write, FALSE if this is a real write.
 
IN BOOLEAN p__BOOLEAN__IsNextSessionAllowed 
BOOLEAN set to TRUE is next session is allowed on this media, FALSE if next session will not be allowed on this media.
p__BOOLEAN__IsSubChannelRepairRequired -- BOOLEAN set to TRUE if you want library to repair broken subchannel in the image and FALSE otherwise (if you want to burn all the data AS IS -- maybe required to keep working "special" software titles).
 
IN ULONG p__ULONG__WriteReportDelayInSeconds 
Write report delay in seconds (time between 2 WRITE_PACKET callbacks).
 
IN ULONG p__ULONG__BufferStatusReportDelayInSeconds 
Buffer status report delay in seconds (time between 2 BUFFER_STATUS callbacks). 

Execution status. EN_SUCCESS if the operation completed successfuly. If the exception number will be EN_SYSTEM_CALL_FAILED, variable that SystemError points to will be filled with system error. If something other then EN_SUCCESS will be returned buffer that ExceptionText will point to will be filled with formatted exception message. If the exception number will be EN_SCSI_CDB_FAILED, CDB_FAILURE_INFORMATION will be filled with apropriate values (CDB that faled, CDB size, SCSI sense data, SCSI sense data size, SCSI transport, device and host adapter status codes).

This function records ISO9660 or Joliet file system image located in a file on the hard disk (also it can be one sound file or full set of sound files if an audio CD is mastered) with current write speed on CD/DVD/Blu-Ray/HD-DVD burner device in Disc-At-Once raw P-W mode.

Please see the DiscAtOnceFromFile sample that will demonstrate how ISO9660 or Joliet file system image (also it can be one sound file or full set of sound files if an audio CD is mastered) can be burn on the CD/DVD/Blu-Ray/HD-DVD media and with the help of StarBurn_CdvdBurnerGrabber_DiscAtOnceRawPWFromFile with currently set write speed and currently set optimum power calibration.

This example allocates CdvdBurnerGrabber object, records the ISO9660 or Joliet file system image to the CD/DVD/Blu-Ray/HD-DVD media and destroys the device object after it's not needed any more. 

 

// Somewhere in the data region
PVOID l__PVOID__CdvdBurnerGrabber;
EXCEPTION_NUMBER l__EXCEPTION_NUMBER;
ULONG l__ULONG__SystemError;
CHAR l__CHAR__ExceptionText[ 1024 ];
CDB_FAILURE_INFORMATION l__CDB_FAILURE_INFORMATION;
DAO_DISC_LAYOUT l__DAO_DISC_LAYOUT;

// Prepare exception text buffer
RtlZeroMemory(
    &l__CHAR__ExceptionText,
    sizeof( l__CHAR__ExceptionText )
    );

// Prepare CDB failure information
RtlZeroMemory(
    &l__CDB_FAILURE_INFORMATION,
    sizeof( l__CDB_FAILURE_INFORMATION )
    );

// Try to create CdvdBurnerGrabber on 0:0:4:0 with 32MB of cache
l__EXCEPTION_NUMBER =
StarBurn_CdvdBurnerGrabber_Create(
    &l__PVOID__CdvdBurnerGrabber,
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__SystemError,
    &l__CDB_FAILURE_INFORMATION,
    ( PCALLBACK )( StarBurn_Callback ),
    0,
    0,
    4,
    0,
    32
    );

// Check for correct reply
if (  l__EXCEPTION_NUMBER != EN_SUCCESS )
{
// Handle error here...
}

// Prepare DAO disc layout
RtlZeroMemory(
    &l__DAO_DISC_LAYOUT,
    sizeof( l__DAO_DISC_LAYOUT )
    );

// Set file name
strcpy(
    l__DAO_DISC_LAYOUT.m__DAO_DISC_LAYOUT_ENTRY.m__CHAR__TrackName,
    "C:\ISO9660.ISO"
    );

// Set number of tracks
l__DAO_DISC_LAYOUT.m__LONG__NumberOfTracks = 1;

// Try to record the ISO9660 or Joliet file system image in Disc-At-Once raw P-W mode
l__EXCEPTION_NUMBER =
StarBurn_CdvdBurnerGrabber_DiscAtOnceRawPWFromFile(
    l__PVOID__CdvdBurnerGrabber,
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__SystemError,
    &l__CDB_FAILURE_INFORMATION,
    &l__DAO_DISC_LAYOUT,
    FALSE, // No XA, just ordinary CDROM
    FALSE, // No test write, real burn
    FALSE, // No next session allowed
    FALSE, // No subchannel repair      
    WRITE_REPORT_DELAY_IN_SECONDS,
    BUFFER_STATUS_REPORT_DELAY_IN_SECONDS
    );
    
// Check for correct reply
if (  l__EXCEPTION_NUMBER != EN_SUCCESS )
{
// Handle error here...
}

// Do something with CdvdBurnerGrabber device object here...        

// Destroy the CdvdBurnerGrabber
StarBurn_Destroy( &l__PVOID__CdvdBurnerGrabber );

// Just check for pointer (paranoid?)
if ( l__PVOID__CdvdBurnerGrabber != NULL )
{
// Handle error here...
}