StarBurn SDK (Software Development Kit)
ContentsIndexHome
Example

This example allocates Joliet file tree with required time for root node and destroys the tree after it's not needed any more. 

 

// Somewhere in the data region
PVOID l__PVOID__FileTree;
EXCEPTION_NUMBER l__EXCEPTION_NUMBER;
ULONG l__ULONG__TreeNodes;
ULONG l__ULONG__SystemError;
CHAR l__CHAR__ExceptionText[ 1024 ];
PVOID l__PVOID__Root;
SYSTEMTIME l__SYSTEMTIME;
FILETIME l__FILETIME;

// Prepare exception text buffer
RtlZeroMemory(
    &l__CHAR__ExceptionText,
    sizeof( l__CHAR__ExceptionText )
    );

// Try to create Joliet file tree
l__EXCEPTION_NUMBER =
StarBurn_ISO9660JolietFileTree_Create(
    &l__PVOID__FileTree,
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__Status,
    ( PCALLBACK )( Callback ),
    ( PVOID )( &l__LONG__TreeNodes ),
    TRUE,
    FALSE,
    FILE_TREE_JOLIET
    );

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

// Try to get root here
l__PVOID__Root =
StarBurn_ISO9660JolietFileTree_GetRoot( l__PVOID__FileTree );

// Check for correct reply
if ( l__PVOID__Root == NULL )
{
// Handle error here, keep in mind that root CAN be NULL if nothing was added to tree before...
}

// Format system time here

ZeroMemory(
    &l__SYSTEMTIME,
    sizeof( l__SYSTEMTIME )
    );

l__SYSTEMTIME.wYear = 1991;
    
l__SYSTEMTIME.wMonth = 3;
    
l__SYSTEMTIME.wDayOfWeek = 1;

l__SYSTEMTIME.wDay = 1;

l__SYSTEMTIME.wHour = 2;
    
l__SYSTEMTIME.wMinute = 30;

l__SYSTEMTIME.wSecond = 40;

l__SYSTEMTIME.wMilliseconds = 10;

// Covert system time to file time
SystemTimeToFileTime(
    &l__SYSTEMTIME,
    &l__FILETIME
    );

// Try to add all from the root directory of the drive D: to already created Joliet file tree
l__EXCEPTION_NUMBER =
StarBurn_ISO9660JolietFileTree_AddEx(
    l__PVOID__FileTree,
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__Status,
    "D:\",
    NULL,
    FILE_TIME_LAST_WRITE,
    &l__FILETIME,
    &l__PVOID__Root,
    &l__PVOID__NewNode
    );

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

// Perform actions with Joliet tree here...

// Destroy the Joliet file tree
StarBurn_Destroy( &l__PVOID__FileTree );

// Just check for pointer (paranoid?)
if ( l__PVOID__FileTree != NULL )
{
// Handle error here...
}