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;
|