#1 Burning Software

It is currently Thu Mar 28, 2024 4:13 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Problem initializing ISO9660JolietFileTree root folder
PostPosted: Wed Dec 26, 2007 1:50 pm 
Offline

Joined: Wed Dec 19, 2007 7:00 am
Posts: 5
I'm trying to run the code below and I keep getting this error:

// >Unhandled exception at 0x005a8ddd in CppBurnerTest.exe:
// >0xC0000005: Access violation reading location 0xffffffff.

When StarBurn_ISO9660JolietFileTree_Add is called.

What is wrong? It seems like I'm doing exactly then same as in the c++ "DataBurmer" sample.

#include "stdafx.h"
#include "DeviceFinder.h"
#include "StarBurnKey.h"


// DEFINES ////////////////////////////////////////////////////////////////////////////////////////

#define STORE_PACKET_SIZE_IN_UCHARS 65536

// GLOBALS ////////////////////////////////////////////////////////////////////////////////////////

LONG g_treeNodes = 0;
LARGE_INTEGER g_LARGE_INTEGER_LastWrittenPercent;
LARGE_INTEGER g_LARGE_INTEGER_FileSizeInLBs;
LARGE_INTEGER g_LARGE_INTEGER_FileSizeInUCHARs;
LARGE_INTEGER g_LARGE_INTEGER_LBsWritten;
LARGE_INTEGER g_LARGE_INTEGER_CurrentPercent;
ULONG g_waitTimeInMs = 0;
PNAME_COLLISION_INFO g_PNAME_COLLISION_INFO = NULL;
ULONG g_trackPaddingSizeInLBs = 0;
ULONG g_trackPaddingLeftInLBs = 0;

LONG g_treeLevel = 0;
PVOID g_ISO9660JolietFileTree = NULL;
PVOID g_burnerGrabber = NULL;
ULONG g_status = ERROR_GEN_FAILURE;
CHAR g_exceptionText[1024];
EXCEPTION_NUMBER g_EXCEPTION_NUMBER = EN_SUCCESS;
CDB_FAILURE_INFORMATION g_CDB_FAILURE_INFORMATION;
STARBURN_TRACK_INFORMATION g_STARBURN_TRACK_INFORMATION;
STARBURN_DISC_INFORMATION g_STARBURN_DISC_INFORMATION;
CHAR g_vendorID[1024];
CHAR g_productID[1024];
CHAR g_productRevisionLevel[1024];
ULONG g_bufferSizeInUCHARs = 0;
BOOLEAN g_isBUPEnabled = FALSE;
BOOLEAN g_isBUPSupported = FALSE;
ULONG g_currentReadSpeed = 0;
ULONG g_maximumReadSpeed = 0;
ULONG g_currentWriteSpeed = 0;
ULONG g_maximumWriteSpeed = 0;
BOOLEAN g_isSendOPCSuccessful = FALSE;
CHAR g_newRootName[MAX_PATH];
INT g_iNT_ScanIndex = 0;
DISC_TYPE g_DISC_TYPE = DISC_TYPE_UNKNOWN;
PVOID g_rootNode = NULL;
PVOID g_newNode = NULL;
BOOLEAN g_isTrackAtOnce = FALSE;
BOOLEAN g_isSessionAtOnce = FALSE;
BOOLEAN g_isDiscAtOncePQ = FALSE;
BOOLEAN g_isDiscAtOnceRawPW = FALSE;
UCHAR g_trackNumber = 0;
UCHAR g_lastTrack = 0;

BOOL g_findAspi;
CArray<CDDVDINFO, CDDVDINFO&>* g_aspiDevicesFound = NULL;
CArray<CDDVDINFO, CDDVDINFO&>* g_sptiDevicesFound = NULL;
CDeviceFinder g_aspiDeviceFinder;
CDeviceFinder g_sptiDeviceFinder;

// CALLBACKS //////////////////////////////////////////////////////////////////////////////////////

VOID _cdecl Callback(IN CALLBACK_NUMBER p_CALLBACK_NUMBER, IN PVOID p_CallbackContext, IN PVOID p_CallbackSpecial1, IN PVOID p_CallbackSpecial2)
{
}

// INTERNAL METHODS ///////////////////////////////////////////////////////////////////////////////

bool Initialize()
{
g_EXCEPTION_NUMBER = StarBurn_UpStartEx((PVOID)(&g__UCHAR__RegistrationKey), sizeof(g__UCHAR__RegistrationKey));
return (g_EXCEPTION_NUMBER == EN_SUCCESS);
}

bool AddFile(const char* sourcefilepath, const char* destinationfilepath)
{
g_EXCEPTION_NUMBER = StarBurn_ISO9660JolietFileTree_Add(g_ISO9660JolietFileTree,
( PCHAR )( &g_exceptionText ), sizeof( g_exceptionText ),
&g_status, (PCHAR)sourcefilepath, (PCHAR)destinationfilepath,
FILE_TIME_LAST_WRITE, &g_rootNode, &g_newNode);

// >Unhandled exception at 0x005a8ddd in CppBurnerTest.exe:
// >0xC0000005: Access violation reading location 0xffffffff.

if (g_EXCEPTION_NUMBER != EN_SUCCESS)
{
return false;
}

g_EXCEPTION_NUMBER = StarBurn_ISO9660JolietFileTree_Add(g_ISO9660JolietFileTree, (PCHAR)(&g_exceptionText), sizeof(g_exceptionText), &g_status, (PCHAR)sourcefilepath, (PCHAR)destinationfilepath, FILE_TIME_LAST_WRITE, &g_rootNode, NULL);
return (g_EXCEPTION_NUMBER == EN_SUCCESS);
}

bool CreateRootNode(bool isnewdisc, const char* rootfoldername)
{
if (g_ISO9660JolietFileTree != NULL)
{
StarBurn_Destroy(&g_ISO9660JolietFileTree);
g_ISO9660JolietFileTree = NULL;
}

g_EXCEPTION_NUMBER = StarBurn_ISO9660JolietFileTree_Create(
&g_ISO9660JolietFileTree, (PCHAR)(&g_exceptionText), sizeof(g_exceptionText),
&g_status, (PCALLBACK)(Callback), (PVOID)(&g_treeNodes),
TRUE, FALSE, TRUE, FILE_TREE_JOLIET);

if (g_EXCEPTION_NUMBER != EN_SUCCESS)
{
return false;
}

if (isnewdisc)
{
AddFile(NULL, rootfoldername);
}
else
{
g_EXCEPTION_NUMBER = StarBurn_ISO9660JolietFileTree_ImportTrack(g_burnerGrabber, g_rootNode, 1, FALSE, (PCHAR)(&g_exceptionText), sizeof(g_exceptionText), &g_status);
if (g_EXCEPTION_NUMBER != EN_SUCCESS)
{
return false;
}
}

g_rootNode = StarBurn_ISO9660JolietFileTree_GetRoot(g_ISO9660JolietFileTree);
if (g_rootNode == NULL)
{
return false;
}

return true;
}

int _tmain(int argc, _TCHAR* argv[])
{
bool initOk = Initialize();
bool createRootNodeOk = CreateRootNode(true, "RootFolder");

return 0;
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 26, 2007 3:33 pm 
Offline

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

Please send to me whole your project and StarBurn.log with this error.
How to generate StarBurn.log you can read in StarBurn SDK F.A.Q. document on page 3.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 26, 2007 3:54 pm 
Offline

Joined: Wed Dec 19, 2007 7:00 am
Posts: 5
Hi,

Changed _cdecl to __stdcall in the Callback.

VOID _cdecl Callback(IN CALLBACK_NUMBER p_CALLBACK_NUMBER, IN PVOID p_CallbackContext, IN PVOID p_CallbackSpecial1, IN PVOID p_CallbackSpecial2)
{
}

to

VOID ___stdcall Callback(IN CALLBACK_NUMBER p_CALLBACK_NUMBER, IN PVOID p_CallbackContext, IN PVOID p_CallbackSpecial1, IN PVOID p_CallbackSpecial2)
{
}

Yikes, that one was hard to spot.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 26, 2007 5:19 pm 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
janus79fo wrote:
Hi,

Changed _cdecl to __stdcall in the Callback.

VOID _cdecl Callback(IN CALLBACK_NUMBER p_CALLBACK_NUMBER, IN PVOID p_CallbackContext, IN PVOID p_CallbackSpecial1, IN PVOID p_CallbackSpecial2)
{
}

to

VOID ___stdcall Callback(IN CALLBACK_NUMBER p_CALLBACK_NUMBER, IN PVOID p_CallbackContext, IN PVOID p_CallbackSpecial1, IN PVOID p_CallbackSpecial2)
{
}

Yikes, that one was hard to spot.


Hello,

It's good! Your problem is resolved?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 26, 2007 5:31 pm 
Offline

Joined: Wed Dec 19, 2007 7:00 am
Posts: 5
Yes problem solved :D


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 7:19 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
We *LOVE* self-supporting customers :)

janus79fo wrote:
Yes problem solved :D


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 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