Initalization error

vbimport

#1

Following problem:

In my program I create an ISOTrack from a directory which I want
to burn.
But when calling NeroBurn I get the error that the initialization failed:

Here is the log:
06 - Setting volume label: pp
06 - Finished creating project
06 - Begin burning process
09 - Progress: 0
09 - Progress: 25
09 - Progress: 75
09 - Progress: 100
09 - Entering phase: Reading directories
09 - AddLogLine: Unexpected exception
00 - 1A21-7543-6787-2748-8730-0229

Windows 2000 5.0
IA32
WinAspi: -
ahead WinASPI: File ‘C:\Programme\Ahead\Nero\Wnaspi32.dll’: Ver=2.0.1.74, size=164112 bytes, created 26/10/2004 17:35:34
Nero API version: 6.6.0.8
Using interface version: 6.3.0.0
Installed in: C:\Programme\Ahead\Nero
Application: k’\©}
Recorder: <HL-DT-ST CD-RW GCE-8481B>Version: 2.03 - HA 1 TA 1 - 6.6.0.8
Adapter driver: <atapi> HA 1
Drive buffer : 2048kB
Bus Type : default (0) -> ATAPI, detected: ATAPI

=== Scsi-Device-Map ===
DiskPeripheral : WDC WD800AB-22CBA1 atapi Port 0 ID 0 DMA: On
CdRomPeripheral : SAMSUNG DVD-ROM SD-616T atapi Port 1 ID 0 DMA: On
CdRomPeripheral : HL-DT-ST CD-RW GCE-8481B atapi Port 1 ID 1 DMA: On

=== CDRom-Device-Map ===
SAMSUNG DVD-ROM SD-616T F: CDRom0
HL-DT-ST CD-RW GCE-8481B G: CDRom1

AutoRun : 1
Excluded drive IDs:
WriteBufferSize: 74448896 (0) Byte
ShowDrvBufStat : 0
BUFE : 0
Physical memory : 511MB (523760kB)
Free physical memory: 216MB (222184kB)
Memory in use : 57 %
Uncached PFiles: 0x0
Use Inquiry : 1
Global Bus Type: default (0)
Check supported media : Disabled (0)

24.3.2005
NeroAPI
15:19:21 #1 Text 0 File Reader.cpp, Line 127
Reader running

15:19:21 #2 Text 0 File AudioCompilationImpl.cpp, Line 842
DRM: StartDrmRecording(RealRec:1, ImageRec:0, Copies:1)
DRM: Beginning burn process.

15:19:21 #3 ISO9660GEN -11 File geniso.cpp, Line 3293
First writeable address = 0 (0x00000000)

15:19:21 #4 Text 0 File Burncd.cpp, Line 5585
Unexpected exception

15:19:21 #5 Text 0 File AudioCompilationImpl.cpp, Line 867
DRM: DRM burn session terminated.

15:19:21 #6 Text 0 File AudioCompilationImpl.cpp, Line 896
DRM: Closing entire DRM handling. Bye.

Existing drivers:

Registry Keys:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\AllocateCDROMs : 0 (Security Option)

and this is the way I call the neroBurn command:


with frmSetupRecorder do
begin
flags := NBF_WRITE or NBF_SPEED_IN_KBS;

      if not chkFinalize.Checked then
         flags := flags or NBF_CLOSE_SESSION;
      if chkUnderrunProt.Checked then
         flags := flags or NBF_BUF_UNDERRUN_PROT;
      if not chkEject.Checked then
         flags := flags or NBF_DISABLE_EJECT;
      if chkVerify.Checked then
         flags := flags or NBF_VERIFY;
      if chkSpeedTest.Checked then
         flags := flags or NBF_SPEED_TEST;
 end;

 // ###############################################
 // #### query a label for the volume
 s := '';
 while s = '' do
       InputQuery(sCapLabel, SQryEnterBackupName, s);

 frmNavigator.DL.LLog( dlInfo, 'Setting volume label: ' + s );

 // ###############################################
 // #### now create the iso track
 NeroIsoTrack := CreateIsoTrackFromDir(path, s);
 frmNavigator.DL.LLog( dlInfo, 'Finished creating project');
 try
    // remember the given label for each archive on this cd
    // this array will be accessed next when the archive flag will be set
    for i := 0 to Length(FNewPositions)-1 do
        if FNewPositions[i] = '' then
           FNewPositions[i] := 'D ' + s;


     // #################################################
     // #### burn the track
     ZeroMemory(@wcd, sizeof(wcd));

     frmNavigator.DL.LLog(dlInfo, 'Begin burning process');
     pDevInfo := @NeroDeviceInfos.nsdisDevInfos[Integer(cboBurner.Items.Objects[cboBurner.ItemIndex]) - 1];
     prog := NeroCreateProgress;
     try
        with prog^ do
        begin
             npUserData := self;
             npProgressCallback := ProgressCallback;
             npAbortedCallback := AbortedCallback;
             npAddLogLineCallback := AddLogLine;
             npSetPhaseCallback := SetPhaseCallback;
             npDisableAbortCallback := nil;
             npSetMajorPhaseCallback := SetMajorPhaseCallback;
        end;

        with wcd do
        begin
             nwcdIsoTrack := NeroIsoTrack;
             nwcdNumTracks := 0;
             nwcdMediaType := NeroCDInfo.ncdiMediaType;
        end;

        ret := NeroBurn(NeroDeviceHandle,
                        NERO_ISO_AUDIO_CD,
                        @wcd,
                        flags,
                        0,//pDevInfo^.nsdiWriteSpeeds.nsiSupportedSpeedsKBs[frmSetupRecorder.cboSpeeds.ItemIndex],
                        prog );

        // examinate the result
        case ret of
          NEROAPI_BURN_UNKNOWN_CD_FORMAT,
          NEROAPI_BURN_INVALID_DRIVE,
          NEROAPI_BURN_FAILED,
          NEROAPI_BURN_FUNCTION_NOT_ALLOWED,
          NEROAPI_BURN_DRIVE_NOT_ALLOWED,
          NEROAPI_BURN_BAD_MESSAGE_FILE:  raise Exception.Create('Failded with ret code: ' + IntToStr(Integer(ret)));
          NEROAPI_BURN_USER_ABORT: raise EUserAbortException.Create('User aborted process');
        else
            frmNavigator.DL.LLog( dlInfo, 'Burn command successfull' );
        end;

any help?

Kind regards
Mike


#2

Even though you did not specify, it looks as if you are developing the application in Delphi using straight NeroAPI. It is rather questionable how compatible Delphi is compared to C/C++ structs, calling conventions, etc. There could be issues of structure member alignment or other incompatibilities. For instance, Application: k’\©} does not look too good. It looks either as if something is not initialized properly or there is an alignment problem. How about your NERO_SETTINGS structure?


#3

I use the Delphi translation of the Nero SDK version 0.40 (found on
sourceforge).

I’ll post here the Delphi definition of the settings struct.
By the way the size of the settings struct is 40 Bytes!

type
tag_NERO_CALLBACK = record
ncCallbackFunction: Pointer; { actually, this is a pointer to one of several different callback functions defined below }
ncUserData: Pointer; { this will be passed to the function as first parameter }
end;
NERO_CALLBACK = tag_NERO_CALLBACK;
PNERO_CALLBACK = ^NERO_CALLBACK;
TNeroCallBack = NERO_CALLBACK;
PNeroCallBack = PNERO_CALLBACK;

// typedef BOOL (NERO_CALLBACK_ATTR *NERO_IDLE_CALLBACK) (void *pUserData);
NERO_IDLE_CALLBACK = function(pUserData: Pointer): BOOL; cdecl; { called regularly during long running activities; return TRUE if this activity shall be aborted }
TNeroIdleCallback = NERO_IDLE_CALLBACK;

Kind regards

Mike

{
// The NeroAPI needs some information:
}
tag_NERO_SETTINGS = record
nstNeroFilesPath: PChar; {* directory name with trailing ‘’ of where to find the additional Nero DLL and text files }

nstVendor: PChar;
nstSoftware: PChar;           { path for registry settings (use "ahead", "Nero - Burning Rom" for Nero application's settings) }
nstLanguageFile: PChar;       { name of the Nero language file; relativ to nstNeroFilesPath (e.g. "Nero.txt") }
nstIdle: NERO_CALLBACK;       { NERO_IDLE_CALLBACK, may be NULL }
nstUserDialog: NERO_CALLBACK; { NERO_USER_DIALOG, must not be NULL, see "NeroUserDialog.h" for details }

{
// overburn settings:
// overburning (writing more than the nominal capacity of a disc) is allowed if:
//  - nstEnableOverburn == TRUE
//  - nstOverburnSize &gt;= amount of required blocks for compilation
// and if
//  - the drive supports it
//  - DAO is used.
// Even then, overburning has to be acknowledged via callback (see DLG_OVERBURN in "NeroUserDialog.h").
}
nstEnableOverburn: BOOL;
nstOverburnSize: DWORD;    { in blocks }

end;
NERO_SETTINGS = tag_NERO_SETTINGS;
PNERO_SETTINGS = ^NERO_SETTINGS;
TNeroSettings = NERO_SETTINGS;
PNeroSettings = PNERO_SETTINGS;


#4

Command back…
I found the error. It was an outdated package which I had to recompile…

Now it works great!

kind regards
Mike