StarBurn SDK (Software Development Kit)
ContentsIndexHome
PreviousUpNext
StarBurn_ISO9660JolietFileTree_SetNames Function
C++
__stdcall STARBURN_IMPEX_API BOOLEAN StarBurn_ISO9660JolietFileTree_SetNames(IN PVOID p__PVOID__ISO9660JolietFileTree, IN PVOID p__PVOID__ISO9660JolietFileTreeNode, IN PCHAR p__PCHAR__AbsoluteName, IN PCHAR p__PCHAR__LongName, IN PCHAR p__PCHAR__ShortName);
Parameters 
Description 
IN PVOID p__PVOID__ISO9660JolietFileTree 
Pointer to the ISO9660 or Joliet file tree object that toolkit allocated during call to StarBurn_ISO9660JolietFileTree_Create().
 
IN PVOID p__PVOID__ISO9660JolietFileTreeNode 
Pointer to the ISO9660 or Joliet file tree node object that is either result of previous tree node kids enumeration with StarBurn_ISO9660JolietFileTree_GetFirstKid() and StarBurn_ISO9660JolietFileTree_GetNextKid() or the result of call to StarBurn_ISO9660JolietFileTree_GetRoot().
 
IN PCHAR p__PCHAR__AbsoluteName 
Pointer to the array of CHARs MAX_PATH in size that will be passed as absolute name.
 
IN PCHAR p__PCHAR__LongName 
Pointer to the array of CHARs MAX_PATH in size that will be passed as long name.
 
IN PCHAR p__PCHAR__ShortName 
Pointer to the array of CHARs MAX_PATH in size that will be passed as short name. 

Nothing. Passed buffers will be copied to the internal file tree node. This function cannot fail. Attention! For now only long file name can be changed (short and absolute file names will be ignored).

This function sets ISO9660 or Joliet file tree node names (long, short and absolute).

Names can be used to build correct tree to visualise enumeration of all the kids and walk down the tree. Changing the names can allow to store the files or directories under different names.

This example allocates Joliet file tree, get root node, gets names, sets new ones and destroys it (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__RootNode;
CHAR l__CHAR__AbsoluteName[ MAX_PATH ];
CHAR l__CHAR__LongName[ MAX_PATH ];
CHAR l__CHAR__ShortName[ MAX_PATH ];
INT l__INT__NameSizeInUCHARs;

// 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 )( StarBurn_Callback ),
    ( PVOID )( &l__LONG__TreeNodes ),
    TRUE,
    FALSE,
    FILE_TREE_JOLIET
    );

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

// Add directories or files with the help of the StarBurn_ISO9660JolietFileTree_Add here...

// Get root node here
l__PVOID__RootNode =
StarBurn_ISO9660JolietFileTree_GetRoot( l__PVOID__FileTree );

// Check for correct response
if ( l__PVOID__RootNode == NULL )
{
// Handle error here...
}

// Get names here
StarBurn_ISO9660JolietFileTree_GetNames(
    l__PVOID__FileTree,
    l__PVOID__RootNode,
    ( PCHAR )( &l__CHAR__AbsoluteName ),
    ( PCHAR )( &l__CHAR__LongName ),
    ( PCHAR )( &l__CHAR__ShortName )
    );

// Change long name

l__INT__NameSizeInUCHARs = strlen( l__CHAR__LongName );

RtlZeroMemory(
&l__CHAR__LongName,
sizeof( l__CHAR__LongName )
);

strncpy(
l__CHAR__LongName,
"New name",
l__INT__NameSizeInUCHARs
);

// Set names here
StarBurn_ISO9660JolietFileTree_SetNames(
    l__PVOID__FileTree,
    l__PVOID__RootNode,
    ( PCHAR )( &l__CHAR__AbsoluteName ),
    ( PCHAR )( &l__CHAR__LongName ),
    ( PCHAR )( &l__CHAR__ShortName )
    );

// Do something with Joliet file tree root node here...

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

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