SDK creates ISO too big for specified media

I’m working with NeroCOM in a VB.Net application. When creating ISO image files using the Image Recorder virtual device, the SDK seems to allow writing an image that is too big to fit on the specified media. For example:

  • I create a NeroISOTrack and add 823MB file (too big for a CD)
  • I invoke the BurnIsoAudioCD method specifying CD media
    The method call will go ahead and create a 823MB image file without raising the OnWaitCD event with a NERO_WAITCD_NOTENOUGHSPACE parameter.

Then I try this:

  • I create a NeroISOTrack and add 823MB file and a 130MB file (even bigger)
  • I invoke the BurnIsoAudioCD method specifying CD media
    This time, the burn fails after raising the OnWaitCD event with NERO_WAITCD_NOTENOUGHSPACE, as I would expect.

In both cases, the size of the resulting image file would be greater than the capacity of CD media, so why does the image file get created without complaining about insufficient space in the first example but not in the second?

See source code below.

Thanks in advance for any replies.

Imports NEROLib
Imports System.io

Public Class Form1

Private WithEvents m_nero As Nero
Private m_devices As NeroDrives
Private WithEvents m_drive As NeroDrive
Private m_isoTrack As New NeroISOTrack

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    m_nero = New NeroClass
    m_devices = m_nero.GetDrives(NERO_MEDIA_TYPE.NERO_MEDIA_CD)
    m_drive = m_devices.Item(1) ' the "Image Recorder" device
    m_drive.InitImageRecorder("C:

eroimage.iso", NERO_MEDIA_TYPE.NERO_MEDIA_CD)
End Sub

Private Sub AddFile(ByRef isoTrack As NeroISOTrack, ByVal theFileName As String)
    ' Add the specified file to the specified ISOTrack.

    Dim file As New NeroFile
    file.SourceFilePath = theFileName
    file.Name = Path.GetFileName(theFileName)
    file.EntryTime = Directory.GetLastWriteTime(theFileName)

    isoTrack.RootFolder.Files.Add(file)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim isoTrack As New NeroISOTrack

    AddFile(isoTrack, "C:\hancock\jams.mdb")    ' the 823MB file
    AddFile(isoTrack, "C:\hancock\jams.zip")    ' the 130MB file

    m_drive.BurnIsoAudioCD("", "", False, isoTrack, Nothing, Nothing, _
              NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE + _
              NERO_BURN_OPTIONS.NERO_BURN_OPTION_CREATE_ISO_FS + _
              NERO_BURN_OPTIONS.NERO_BURN_OPTION_USE_JOLIET, _
              0, NERO_MEDIA_TYPE.NERO_MEDIA_CDR)
End Sub

Private Sub m_drive_OnDoneEstimateTrackSize(ByVal bOk As Boolean, ByVal BlockSize As Integer) Handles m_drive.OnDoneEstimateTrackSize
    MessageBox.Show("m_drive_OnDoneEstimateTrackSize")
End Sub

Private Sub m_nero_OnWaitCD(ByRef WaitCD As NEROLib.NERO_WAITCD_TYPE, ByRef WaitCDLocalizedText As String) Handles m_nero.OnWaitCD
    MessageBox.Show("m_nero_OnWaitCD: " & WaitCD.ToString)
End Sub

Private Sub m_nero_OnWaitCDDone() Handles m_nero.OnWaitCDDone
    MessageBox.Show("m_nero_OnWaitCDDone")
End Sub

Private Sub m_nero_OnDriveStatusChanged(ByVal hostID As Integer, ByVal targetID As Integer, ByVal driveStatus As NEROLib.NERO_DRIVECHANGE_RESULT) Handles m_nero.OnDriveStatusChanged
    MessageBox.Show("m_nero_OnDriveStatusChanged")
End Sub

Private Sub m_drive_OnMajorPhase(ByRef phase As NEROLib.NERO_MAJOR_PHASE) Handles m_drive.OnMajorPhase
    MessageBox.Show("m_drive_OnMajorPhase: " & phase.ToString)
End Sub

Private Sub m_drive_OnDoneBurn(ByRef StatusCode As NEROLib.NERO_BURN_ERROR) Handles m_drive.OnDoneBurn
    MessageBox.Show("m_drive_OnDoneBurn: " & StatusCode.ToString)
End Sub

Private Sub m_drive_OnDoneWaitForMedia(ByRef Success As Boolean) Handles m_drive.OnDoneWaitForMedia
    MessageBox.Show("m_drive_OnDoneWaitForMedia: " & Success.ToString)
End Sub

Private Sub m_drive_OnDriveStatusChanged(ByVal driveStatus As NEROLib.NERO_DRIVESTATUS_RESULT) Handles m_drive.OnDriveStatusChanged
    MessageBox.Show("m_drive_OnDriveStatusChanged: " & driveStatus.ToString)
End Sub

Private Sub m_drive_OnSetPhase(ByRef Text As String) Handles m_drive.OnSetPhase
    MessageBox.Show("m_drive_OnSetPhase: " & Text)
End Sub

End Class