StarBurn SDK (Software Development Kit) |
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... }