StarBurn SDK (Software Development Kit)
ContentsIndexHome
PreviousUpNext
StarBurn_ISO9660JolietFileTree_GetSizeInUCHARs Function
C++
__stdcall STARBURN_IMPEX_API LONG StarBurn_ISO9660JolietFileTree_GetSizeInUCHARs(IN PVOID p__PVOID__ISO9660JolietFileTree, OUT PLONG p__PLONG__HighPartSizeInUCHARs);
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 and StarBurn_ISO9660JolietFileTree_BuildImage was applied to later.
 
p__PULONG__HighPartSizeInUCHARs 
Pointer to the 32-bit unsigned long that will receive high part of 64-bit image size. 

Built ISO9660 or Joliet file system image size in UCHARs. This function cannot fail.

This function returns ISO9660 or Joliet built file system image size in UCHARs.

Used to determine the size of the built file system image so it will be clear will it fit on the CD/DVD/Blu-Ray/HD-DVD media (if burning) or on hard disk (if storing file system image as file on the disk) or not.

This example allocates Joliet file tree from the directory, builds file system image, gets file system image size in UCHARs, checks for compatibility and destroys the file 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 ];
LARGE_INTEGER l__LARGE_INTEGER__FileSystemImageSizeInUCHARs;

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

// Try to build the image, start with LBA 0 and include up to 8 levels into the image 
l__EXCEPTION_NUMBER =
StarBurn_ISO9660JolietFileTree_BuildImage(
    l__PVOID__FileTree,
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__SystemError,
    0,
    8,
    FALSE,
    "Volume",
    "Publisher",
    "Application"
    );

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

// Get file system image size in UCHARs
l__LARGE_INTEGER__FileSystemImageSizeInUCHARs.LowPart =
StarBurn_ISO9660JolietFileTree_GetSizeInUCHARs(
    l__PVOID__FileTree,
    &l__LARGE_INTEGER__FileSystemImageSizeInUCHARs.HighPart
    );

// Check for enough space on the media here (either hard disk or CD/DVD/Blu-Ray/HD-DVD)
if ( l__LARGE_INTEGER__FileSystemImageSizeInUCHAR.QuadPart < ... )
{
// 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...
}