#1 Burning Software

It is currently Mon Apr 29, 2024 4:40 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Problem Reading Track
PostPosted: Thu Jul 23, 2009 3:35 pm 
Offline

Joined: Mon Jun 15, 2009 6:35 pm
Posts: 28
I sent this in to support a couple of days ago. I''m guessing that my email got caught in a spam filter. If not, I apologize for duplicate post.

I am using Vista x64 and Delphi 2007. I have been able the samples working correctly, in particular DataBurner and DeviceInfo. However, I am having difficulty getting them implemented in my program. I am writing a backup utility for my application. I zip the database and assorted configuration files into one file which is uniquely named (Example: "MYBACKUP 20090620 104254.zip" The numbers are just the date and time). It is then copied to the CD/DVD and the session is closed. So, overtime the CD has many files in multiple sessions. I need to be able to present that list to user and allow them to restore from any of the files stored on that backup.

I am able to get StarBurn initialized and read the device info. It matches what the DeviceInfo sample provides. I created a CD with files via the DataBurner sample and am trying to use ImportTrack function to read those files. However, I am getting an EAccessViolation with at address 00000000. Read of address 00000000.

I am sure it is something obvious, but cannot find my problem. I cannot see any difference between this and the DataBurner demo. I have prepared a sample that generates my error. I would appreciate any insight that you can give.

*** THE CODE ***
procedure ZeroMemory(Destination: Pointer; Length: DWORD);
begin
FillChar(Destination^, Length, 0);
end;

procedure TForm2.btnReadClick(Sender: TObject);
var
FsbException: EXCEPTION_NUMBER;
FExceptionText: packed array[1..1024] of char;
FSystemError: DWORD;
FCDBFailureInformation: CDB_FAILURE_INFORMATION;
FsbTreeNodes: LongInt;
sDrive: String;
FFileTree: pointer;
iTrackNumber: Integer;
begin
LogClear;
sDrive := edtDrive.Text;
iTrackNumber := StrToInt( edtTrack.Text );;

// Initialize StarBurn
FsbException := StarBurn_UpStartEx( @g__UCHAR__RegistrationKey[1], SizeOf(g__UCHAR__RegistrationKey) );
if FsbException = EN_SUCCESS then
begin
LogMessage( 'StarBurn Initialized' );
end
else
begin
LogMessage( 'StarBurn Initialization Failed' );
end;

// Create Device Object
ZeroMemory(@FExceptionText, SizeOf( FExceptionText ) );
ZeroMemory(@FCDBFailureInformation, SizeOf( FCDBFailureInformation ) );
FsbException := StarBurn_CdvdBurnerGrabber_CreateEx(
FDevicePointer,
PChar(@FExceptionText[1]),
SizeOf(FExceptionText),
FSystemError,
@FCDBFailureInformation,
nil,
nil,
PAnsichar( sDrive ),
STARBURN_CACHE_SIZE_READ_ONLY);
if FsbException = EN_SUCCESS then
begin
LogMessage( 'Device Object Created' );
end
else
begin
LogMessage( 'Unable to Create Device Object' );
end;

// Create Joliet File Tree
ZeroMemory(@FExceptionText, SizeOf( FExceptionText ) );
FsbException := StarBurn_ISO9660JolietFileTree_Create(
FFileTree,
PChar(@FExceptionText[1]), SizeOf(FExceptionText), FSystemError,
nil, // @GlobalCallBack,
@FsbTreeNodes,
True,
False,
True,
FILE_TREE_JOLIET );
if ( FsbException = EN_SUCCESS) then
begin
LogMessage( 'Joliet File Tree Created' );
end
else
begin
LogMessage( '--- Error Creating Joliet File Tree ---' );
LogMessage( 'Exception ' + IntToStr( Integer( FsbException ) ) );
LogMessage( 'Status ' + IntToStr( FSystemError ) );
LogMessage( 'Error ' + PAnsiChar( @FExceptionText[ 1 ] ) );
LogMessage( '---------------------------------------' );
end;

// Import Track
ZeroMemory(@FExceptionText, SizeOf( FExceptionText ) );
FsbException := StarBurn_ISO9660JolietFileTree_ImportTrack(
FDevicePointer,
FFileTree,
iTrackNumber,
True, // (FileSystem.SystemType = fstISO9660Joilet),
PChar(@FExceptionText[1]), SizeOf(FExceptionText), FSystemError );

if ( FsbException = EN_SUCCESS) then
begin
LogMessage( 'Track 1 Imported' );
end
else
begin
LogMessage( '--- Error Import Track ---' );
LogMessage( 'Exception ' + IntToStr( Integer( FsbException ) ) );
LogMessage( 'Status ' + IntToStr( FSystemError ) );
LogMessage( 'Error ' + PAnsiChar( @FExceptionText[ 1 ] ) );
LogMessage( '--------------------------' );
end;

// Destroy Joliet File Tree
if FFileTree <> nil then begin
StarBurn_Destroy( FFileTree );
LogMessage( 'Joliet File Tree Destroyed' );
end;

// Destroy Device Object
if FDevicePointer <> nil then begin
StarBurn_Destroy( FDevicePointer );
LogMessage( 'Device Object Destroyed' );
end;

// Shut Down StarBurn
FsbException := StarBurn_DownShut;
if FsbException = EN_SUCCESS then
begin
LogMessage( 'StarBurn Shut Down' );
end
else
begin
LogMessage( 'StarBurn Failed To Shut Down' );
end;
end;


Top
 Profile  
 
 Post subject: Re: Problem Reading Track
PostPosted: Thu Jul 23, 2009 9:10 pm 
Offline

Joined: Fri Jan 26, 2007 4:31 pm
Posts: 452
This exception can be thrown when you create ISO9660JolietFileTree object by calling StarBurn_ISO9660JolietFileTree_Create(..) without callback parameter and then call StarBurn_ISO9660JolietFileTree_ImportTrack(..) for this ISO9660JolietFileTree object.

Please try to set callback parameter in StarBurn_ISO9660JolietFileTree_Create() when you create ISO9660JolietFileTree object.


Top
 Profile  
 
 Post subject: Re: Problem Reading Track
PostPosted: Fri Jul 24, 2009 8:09 pm 
Offline

Joined: Mon Jun 15, 2009 6:35 pm
Posts: 28
That solved my problem. Thanks.

Luke


Top
 Profile  
 
 Post subject: Re: Problem Reading Track
PostPosted: Fri Jul 24, 2009 9:09 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Good.


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

All times are UTC


Who is online

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