StarBurn SDK (Software Development Kit)
ContentsIndexHome
PreviousUpNext
StarBurn_UDF_CreateEx Function
C++
__stdcall STARBURN_IMPEX_API EXCEPTION_NUMBER StarBurn_UDF_CreateEx(IN PUDF_TREE_ITEM p__PUDF_TREE_ITEM__UDFRoot, IN PUDF_TREE_ITEM p__PUDF_TREE_ITEM__ISO9660UDFBridgeRootVideo, IN PUDF_TREE_ITEM p__PUDF_TREE_ITEM__ISO9660UDFBridgeRootAudio, IN PUDF_CONTROL_BLOCK p__PUDF_CONTROL_BLOCK, OUT PCHAR p__PCHAR__ExceptionText, IN ULONG p__ULONG__ExceptionTextSizeInUCHARs, OUT PULONG p__PULONG__SystemError, IN PCHAR p__PCHAR__VolumeLabel, IN PCHAR p__PCHAR__PublisherPreparerName, IN PCHAR p__PCHAR__ApplicationName, IN LONG p__LONG__Year, IN LONG p__LONG__Month, IN LONG p__LONG__Day, IN LONG p__LONG__Hour, IN LONG p__LONG__Minute, IN LONG p__LONG__Second, IN LONG p__LONG__MilliSecond);
Parameters 
Description 
IN PUDF_TREE_ITEM p__PUDF_TREE_ITEM__UDFRoot 
Pointer to UDF root node.
 
IN PUDF_TREE_ITEM p__PUDF_TREE_ITEM__ISO9660UDFBridgeRootVideo 
Pointer to UDF root node for VIDEO_TS directory.
 
IN PUDF_TREE_ITEM p__PUDF_TREE_ITEM__ISO9660UDFBridgeRootAudio 
Pointer to UDF root node for AUDIO_TS directory.
 
IN PUDF_CONTROL_BLOCK p__PUDF_CONTROL_BLOCK 
Pointer to UDF control block.
 
OUT PCHAR p__PCHAR__ExceptionText 
Pointer to exception text.
 
IN ULONG p__ULONG__ExceptionTextSizeInUCHARs 
Exception text size in UCHARs.
 
OUT PULONG p__PULONG__SystemError 
Pointer to system error.
 
IN PCHAR p__PCHAR__VolumeLabel 
Pointer to volume label for UDF image.
 
IN PCHAR p__PCHAR__PublisherPreparerName 
Pointer to publisher and preparer name.
 
IN PCHAR p__PCHAR__ApplicationName 
Pointer to application name.
 
IN LONG p__LONG__Year 
Year of creation.
 
IN LONG p__LONG__Month 
Month of creation.
 
IN LONG p__LONG__Day 
Day of creation.
 
IN LONG p__LONG__Hour 
Hour of creation.
 
IN LONG p__LONG__Minute 
Minute of creation.
 
IN LONG p__LONG__Second 
Second of creation.
 
IN LONG p__LONG__MilliSecond 
Millisecond of creation. 

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.

This function creates UDF tree from the allocated data buffers.

Please check DVDVideoBuildImage and DVDVideoTrackAtOnceFromTree samples to find out how to use StarBurn_UDF_CreateEx() 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_CONTROL_BLOCK l__UDF_CONTROL_BLOCK;

unsigned char g__UCHAR__FileSystemHead[ ( UDF_HEAD_SIZE_IN_LOGICAL_BLOCKS * UDF_LOGICAL_BLOCK_SIZE_IN_UCHARS ) ];
unsigned char g__UCHAR__FileSystemTail[ ( UDF_TAIL_SIZE_IN_LOGICAL_BLOCKS * UDF_LOGICAL_BLOCK_SIZE_IN_UCHARS ) ];
unsigned char g__UCHAR__FileSystemStructures[ ( 1024 * UDF_LOGICAL_BLOCK_SIZE_IN_UCHARS ) ];

UDF_TREE_ITEM g__UDF_TREE_ITEM__File[ 200 ]; // File[ 0 ] is not used

// 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
l__EXCEPTION_NUMBER =
StarBurn_UDF_CreateEx(
    &l__UDF_TREE_ITEM__Directory[ 1 ], // This is ROOT
    &l__UDF_TREE_ITEM__Directory[ 2 ], // This is VIDEO_TS and not ROOT, for VIDEO_TS listing
    &l__UDF_TREE_ITEM__Directory[ 3 ], // This is AUDIO_TS and not ROOT, for AUDIO_TS listing
    &l__UDF_CONTROL_BLOCK,
    ( CHAR * )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__Status,
    "VolumeLabel",
    "PublisherName",
    "ApplicationName",
    2006,   // Year
    10,     // Month
    20,     // Day,
    12,     // Hour
    10,     // Minute
    0,      // Second
    50      // Millisecond
    );

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

// Do something with the UDF tree here (maybe burn to CdvdBurnerGrabber object)

// Clean up UDF stuff with StarBurn_UDF_CleanUp() here

// 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...
}