|
StarBurn SDK (Software Development Kit)
|
This example allocates CdvdBurnerGrabber object, gets number of system descriptors and destroys the device object after it's not needed any more.
// Somewhere in the data region
PVOID l__PVOID__CdvdBurnerGrabber = NULL;
LONG l__LONG__NumberOfSystemDescriptors = 0;
PUCHAR l__PUCHAR__SystemStructures = 0;
// 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...
}
// Allocate enough memory for system structures in l__PUCHAR__SystemStructures here...
// Read system structures from the optical disc to l__PUCHAR__SystemStructures buffer here...
// Try to get number of system descriptors
l__LONG__NumberOfSystemDescriptors =
StarBurn_CdvdBurnerGrabber_GetNumberOfSystemDescriptors(
l__PVOID__CdvdBurnerGrabber,
l__PUCHAR__SystemStructures,
SYSTEM_STRUCTURES_SIZE_IN_LOGICAL_BLOCKS
);
// Do something with l__LONG__NumberOfSystemDescriptors 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...
}