Detecting verification failure

vbimport

#1

Can anyone tell me which callback I can use to trap NERO_PHASE_VERIFY_END_FAIL? As far as I can tell, it is never passed to MajorPhaseCallback.

The only way I have found is to catch it is to check the text in the AddLogLineCallback or SetPhaseCallback. This is not ideal because it requires string comparison. I am reading the relevant string from Nero.txt, but I would still rather just check for NERO_PHASE_VERIFY_END_FAIL.

Further to this, can I rely on NeroBurn returning NERO_API_BURN_FAILED if verification fails? The code I have inherited suggests that there may be times when verification can fail but NeroBurn reports no errors.

TIA for any help.


#2

I have the same problem. I “solved” it by verifying the copied files all by myself. :frowning:
That is unsatisfying but although I tried hard I could not find a better way.

Find my comparison function (C++) below, it returns TRUE if the value in pbDifferent is reliable:


#define READ_BUFFER_SIZE 2048
BOOL BinaryCompareFiles( LPCTSTR lpszFirst, LPCTSTR lpszSecond, BOOL *pbDifferent )
{
  try
  {
    CFile destFile;
    CFile sourceFile;

    // open the source file for reading
    if ( ! destFile.Open( lpszFirst, CFile::modeRead ) )
      return FALSE;

    if ( ! sourceFile.Open( lpszSecond, CFile::modeRead ) )
      return FALSE;

    BOOL bDifferent = FALSE;
    BYTE bufSrc[READ_BUFFER_SIZE];
    BYTE bufDst[READ_BUFFER_SIZE];
    DWORD dwRead = 0;

    do
    {
      dwRead = sourceFile.Read( bufSrc, READ_BUFFER_SIZE );

      if ( dwRead != destFile.Read( bufDst, READ_BUFFER_SIZE ) )
      {
        bDifferent = TRUE;
        break;
      }

      if ( memcmp( bufSrc, bufDst, dwRead ) != 0 )
      {
        bDifferent = TRUE;
        break;
      }
    } while ( dwRead > 0 );

    if ( pbDifferent )
      *pbDifferent = bDifferent;

  } // try
  catch ( CFileException *e ) 
  {
    e->Delete();
    return FALSE;
  }

  return TRUE;
}

I hope you can make use of this until they fix this problem.

Regards