StarBurn SDK (Software Development Kit) |
__stdcall STARBURN_IMPEX_API void StarBurn_UDF_CleanUp(PUDF_TREE_ITEM p__PUDF_TREE_ITEM, unsigned long p__ULONG__NumberOfTreeItems);
Parameters | Description |
PUDF_TREE_ITEM p__PUDF_TREE_ITEM | Pointer to allocated and formatted as file UDF tree root node. |
unsigned long p__ULONG__NumberOfTreeItems | Number of tree items to process. |
Nothing. This function cannot fail.
This function removes created UDF tree from the pointed UDF tree node sequentially. Processes file formatted UDF nodes and either closes file handles or frees memory (non-cached vs. cached content).
Please check DVDVideoBuildImage and DVDVideoTrackAtOnceFromTree samples to find out how to use StarBurn_UDF_CleanUp() in the right way.
This example allocates CdvdBurnerGrabber object, creates and destroys UDF tree 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; CDB_FAILURE_INFORMATION l__CDB_FAILURE_INFORMATION; UDF_TREE_ITEM l__UDF_TREE_ITEM__Directory[ 10 ]; UDF_TREE_ITEM l__UDF_TREE_ITEM__File[ 10 ]; UDF_CONTROL_BLOCK l__UDF_CONTROL_BLOCK; // 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... } // Add nodes with StarBurn_UDF_FormatTreeItemAsXxx here // Create UDF tree with StarBurn_UDF_CreateEx() here // Do something with the UDF tree here (maybe burn to CdvdBurnerGrabber object) // Clean up UDF stuff StarBurn_UDF_CleanUp( &l__UDF_TREE_ITEN__File[ 0 ], 10 ); // Destroy UDF tree from the root StarBurn_UDF_Destroy( &l__UDF_TREE_ITEM__Directory[ 0 ], &l__UDF_CONTROL_BLOCK ); // Destroy the CdvdBurnerGrabber StarBurn_Destroy( &l__PVOID__CdvdBurnerGrabber ); // Just check for pointer (paranoid?) if ( l__PVOID__CdvdBurnerGrabber != NULL ) { // Handle error here... }