#1 Burning Software

It is currently Thu Dec 19, 2024 3:49 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: StarBurn_ISO9660JolietFileTree_Add problem
PostPosted: Tue Jan 29, 2008 4:51 pm 
Offline

Joined: Tue Jan 29, 2008 4:15 pm
Posts: 5
Hi all,

I am asking help :p
I have some problems using StarBurn_ISO9660JolietFileTree_Add function.

Here is my code :

Code:

void createImageFromDirectory()
{
   EXCEPTION_NUMBER numException = EN_SUCCESS;
   PVOID pFileTree = NULL;
   char exceptionText[1024];
   ULONG nStatus = ERROR_GEN_FAILURE;
   LONG  nTreeNodes = 0;
   PVOID root = NULL;
   PVOID newNode = NULL;

   // on commence par créer la structure d'arbre
    numException =
        StarBurn_ISO9660JolietFileTree_Create(
            &pFileTree,
            ( PCHAR )( &exceptionText ),
            sizeof( exceptionText ),
            &nStatus,
            NULL,
            ( PVOID )( &nTreeNodes ),
            TRUE,
            FALSE,  // No locked files - do not keep all the handles opened all the time
            TRUE,   // Use Level2 for ISO9660 names generation
            FILE_TREE_ISO9660
            );


   // Try to get root here
   root = StarBurn_ISO9660JolietFileTree_GetRoot(pFileTree);

    numException =
        StarBurn_ISO9660JolietFileTree_Add(
            pFileTree,
            ( PCHAR )( &exceptionText ),
            sizeof( exceptionText ),
            &nStatus,
            "C:\\test\\toto.gif",
         NULL,
            FILE_TIME_LAST_WRITE,
            &root,
            &newNode
            );
}



The Create function run good and numException is good.

each time I execute it, I have an access violation "Access violation reading location 0x00000000" on Add function.

I don't understand what is happening. It seems to be good comparing to BuildImage example (which has no problem to execute)

C:\\test\\toto.gif is a correct file which exists
If I execute it with file which does not exist it does not raise Access Violation but exceptionText says "0x0012fa74 "CStarBurn_FileTree::CreateFromRoot(): FindFirstFile( 'C:\test12\toto.gif\*.*' ) failed, status 3!!!"


I have also tested with "C:\\test" folder which exists and it fails with access violation

Finally I tested
NULL, (arg5)
"RootFolder", (arg6)

and Access violation again

It would be nice to have help :p

Thank you very much


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 8:34 am 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
Hello,

I think problem in your call of StarBurn_ISO9660JolietFileTree_Create(..),
you don't set callback function (it's fifth parameter).
In this case when you try to add some node to file tree then StarBurn engine try to call callback function but his address is NULL and you have access violation.

Right code must be something link that:

Code:
VOID
__stdcall
FileTreeCallback(
             IN CALLBACK_NUMBER CallbackNubmer,
             IN PVOID pCallbackContext,
             IN PVOID pCallbackSpecial1,
             IN PVOID pCallbackSpecial2
            )
{
   //Some your code
}

void createImageFromDirectory()
{
   EXCEPTION_NUMBER numException = EN_SUCCESS;
   PVOID pFileTree = NULL;
   char exceptionText[1024];
   ULONG nStatus = ERROR_GEN_FAILURE;
   LONG  nTreeNodes = 0;
   PVOID root = NULL;
   PVOID newNode = NULL;

   // on commence par créer la structure d'arbre
    numException =
        StarBurn_ISO9660JolietFileTree_Create(
            &pFileTree,
            ( PCHAR )( &exceptionText ),
            sizeof( exceptionText ),
            &nStatus,
            (PCALLBACK) (FileTreeCallback),
            ( PVOID )( &nTreeNodes ),
            TRUE,
            FALSE,  // No locked files - do not keep all the handles opened all the time
            TRUE,   // Use Level2 for ISO9660 names generation
            FILE_TREE_ISO9660
            );


   // Try to get root here
   root = StarBurn_ISO9660JolietFileTree_GetRoot(pFileTree);

    numException =
        StarBurn_ISO9660JolietFileTree_Add(
            pFileTree,
            ( PCHAR )( &exceptionText ),
            sizeof( exceptionText ),
            &nStatus,
            "C:\\test\\toto.gif",
         NULL,
            FILE_TIME_LAST_WRITE,
            &root,
            &newNode
            );
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 8:52 am 
Offline

Joined: Tue Jan 29, 2008 4:15 pm
Posts: 5
Thank you very much for your help and your reactivity !

I thought callback could be optional.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 8:57 am 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
sausee wrote:
Thank you very much for your help and your reactivity !

I thought callback could be optional.


Ok, ask if there will be questions :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 30, 2008 9:08 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Actually it's a bug inside StarBurn as we need to do extensive parameter validation (check for NULL pointer passed as callback in our case). We'll fix it :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group