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

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

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)


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\")    ' the 130MB file

    m_drive.BurnIsoAudioCD("", "", False, isoTrack, Nothing, Nothing, _
End Sub

Private Sub m_drive_OnDoneEstimateTrackSize(ByVal bOk As Boolean, ByVal BlockSize As Integer) Handles 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
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
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