StarBurn SDK (Software Development Kit) |
This example allocates CdvdBurnerGrabber object, reads ISO9660 or Joliet file system image to the memory, records it 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; PUCHAR l__PUCHAR__MemoryRegion; LARGE_INTEGER l__LARGE_INTEGER__SizeInUCHARs; // 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 file system image or file and keep in memory. Pointer would be // stored in l__UCHAR__MemoryRegion and memory region size would be stored in // l__LARGE_INTEGER__SizeInUCHARs variable // Try to record the ISO9660 or Joliet file system image in Track-At-Once mode l__EXCEPTION_NUMBER = StarBurn_CdvdBurnerGrabber_TrackAtOnceFromMemory( l__PVOID__CdvdBurnerGrabber, ( PCHAR )( &l__CHAR__ExceptionText ), sizeof( l__CHAR__ExceptionText ), &l__ULONG__SystemError, &l__CDB_FAILURE_INFORMATION, ( PVOID )( l__PUCHAR__MemoryRegion ), l__LARGE_INTEGER__SizeInUCHARs, FALSE, FALSE, FALSE, WRITE_REPORT_DELAY_IN_SECONDS, BUFFER_STATUS_REPORT_DELAY_IN_SECONDS, FALSE // We burn data compilation ); // 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... }