Nero Multisession DVD Burning fail

Hi,

Introduction:


I am tring to use NeroAPI to burn a multisession DVD, this is: a DVD that is being added files each once in a while.

The Problem:


Burning the first session succeed, tring to add files to the DVD fails: it seems as if the data is actually burnt to the DVD BUT apparently the DVD file tables were not updated, the added files cannot be seen on the DVD…

Following is the code I use:
int _tmain(int argc, _TCHAR* argv[])
{
NERO_SETTINGS NeroSettings;
NERO_PROGRESS NeroProgress;
NERO_ISO_ITEM mniiFile[10];
NERO_SCSI_DEVICE_INFO* nsdiDevice;
NERO_CD_INFO *nci;
NERO_IMPORT_DATA_TRACK_RESULT nidtrResult;
NERO_IMPORT_DATA_TRACK_INFO pInfo;
NERO_ISO_ITEM *niiTemp;
NERO_DEVICEHANDLE ndhDeviceHandle;
NERO_SCSI_DEVICE_INFOS *pNeroDeviceInfos;
NERO_WRITE_CD writeCD;
NEROAPI_INIT_ERROR err;
void *pCDStamp=NULL;
ZeroMemory(mniiFile, sizeof(mniiFile));
ZeroMemory(&NeroSettings, sizeof(NeroSettings));
ZeroMemory(&NeroProgress, sizeof(NeroProgress));

if (!NeroAPIGlueConnect (NULL))
	return -1;

char pNeroFile[128];
char pAhead[128];
char pNeroBurningRom[128];
char pNero_txt[128];
WORD ver1, ver2, ver3, ver4;

NeroGetAPIVersionEx(&ver1,&ver2,&ver3,&ver4,NULL);

strcpy(pNeroFile,		"NeroFiles");
strcpy(pAhead,			"ahead");
strcpy(pNeroBurningRom, "Nero - Burning Rom");
strcpy(pNero_txt,		"Nero.txt");

// use the US-English error message file
NeroSettings.nstNeroFilesPath					= pNeroFile;
NeroSettings.nstVendor							= pAhead;
NeroSettings.nstIdle.ncCallbackFunction			= IdleCallback;      
NeroSettings.nstIdle.ncUserData					= &NeroSettings;
NeroSettings.nstSoftware						= pNeroBurningRom;
NeroSettings.nstUserDialog.ncCallbackFunction	= UserDialog; 
NeroSettings.nstUserDialog.ncUserData			= &NeroSettings;
NeroSettings.nstLanguageFile					= pNero_txt;

// NeroProgress will be used during the burn process
NeroProgress.npAbortedCallback			= AbortedCallback;
NeroProgress.npAddLogLineCallback		= AddLogLine;
NeroProgress.npDisableAbortCallback		= NULL;
NeroProgress.npProgressCallback			= ProgressCallback;
NeroProgress.npSetPhaseCallback			= SetPhaseCallback;
NeroProgress.npUserData					= 0;
NeroProgress.npSetMajorPhaseCallback	= NULL;	
NeroProgress.npSubTaskProgressCallback	= NULL;

err = NeroInit (&NeroSettings, NULL);

writeCD.nwcdpCDStamp=NULL;
writeCD.nwcdArtist=NULL;
writeCD.nwcdTitle=NULL;
writeCD.nwcdCDExtra=FALSE;

// we have no Audio tracks
writeCD.nwcdNumTracks=0;

// we want to write to a CD
writeCD.nwcdMediaType = MEDIA_DVD_M_RW;	
pNeroDeviceInfos = NeroGetAvailableDrivesEx(MEDIA_DVD_M_RW, NULL);
nsdiDevice = pNeroDeviceInfos->nsdisDevInfos + 1;
ndhDeviceHandle = NeroOpenDevice(nsdiDevice);
nci = NeroGetCDInfo(ndhDeviceHandle, NGCDI_READ_CD_TEXT);
niiTemp = NeroImportDataTrack(ndhDeviceHandle, nci->ncdiNumTracks-1, &pCDStamp,&pInfo, NIITEF_IMPORT_ISO_ONLY, &nidtrResult, NULL);
strcpy(mniiFile[0].fileName, argv[1]); 
mniiFile[0].longSourceFilePath = argv[1]; 
mniiFile[0].isDirectory=FALSE;
mniiFile[0].isReference=TRUE;
mniiFile[0].nextItem = niiTemp;
if(0 != ndhDeviceHandle)
{
	writeCD.nwcdIsoTrack = NeroCreateIsoTrackEx(niiTemp, "LABEL", NCITEF_CREATE_ISO_FS|NCITEF_USE_JOLIET);
	int iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_CD, &writeCD, NBF_WRITE | NBF_CLOSE_SESSION, 0, &NeroProgress);
	NeroFreeIsoTrack(writeCD.nwcdIsoTrack);
	NeroCloseDevice(ndhDeviceHandle);
	char* Log = NeroGetErrorLog();
	NeroFreeMem(Log);
}

return 0;

}

Thanks,
Nadav.