Log line: Access is denied

vbimport

#1

Hi,
I created the folder structure without files.
When NeroBurn is called, i receive an error: “log line: access is denied”, and my folders are listed there. The application crashes.

Thanks in advance.


#2

I assume you are using NeroAPI. Can you show the code where you build the tree? Are you allocating NERO_ISO_ITEMs using NeroCreateIsoItem()?


#3

Thanks for your reply
Everything seems ok on debugging…but doesn’t work
Here is the function

void CTestDlg::AddFolder(CString folderName, int level, NERO_ISO_ITEM **item)
{
//itemul vine creat de instanta anterioara
CFileFind finder;
int numFolders=0;
int first=1;
bool isFile=false;

static NERO_ISO_ITEM* firstTimeItem=*item;

NERO_ISO_ITEM *firstItem,*itItem;
//cauta folderul
//=0 daca nu-l gaseste
//>0 daca il gaseste
// build a string with wildcards
CString strWildcard(folderName);
strWildcard += _T("\\*.*");

// start working for files
BOOL bWorking = finder.FindFile(strWildcard);
CString str;
//adaug prima serie
while (bWorking)
{
	bWorking = finder.FindNextFile();
	
	// skip . and .. files; otherwise, we'd
	// recur infinitely!
	
	if (finder.IsDots())
	{
		continue;
	}
	
	// if it's a directory, recursively search it
	
	//cauta toate folderele de aici si adauga-le pe aceeasi ramura
	
	if (finder.IsDirectory())
	{
		
		isFile=false;
		str = finder.GetFilePath();
		
		//item->
		
		//AppendString(finder.GetFileName()+ "---"+finder.GetFilePath());		 
		CString s;
		s.Format("Path: %s , level %d ",finder.GetFilePath(),level);
		AppendString(s);		 
		
		
		
		NERO_ISO_ITEM* newItem=NeroCreateIsoItem();
		strcpy(newItem->sourceFilePath,finder.GetFilePath());
		strcpy(newItem->fileName,finder.GetFileName());
		
		
		if(first)
		{	
			*item=newItem;
			itItem=newItem;
			firstItem=*item;
			first=0;
			
			
			
		}
		else
		{
			//(*item)->nextItem=newItem;
			isFile=false;
			itItem->nextItem=newItem;
			itItem=newItem;
			//aici adaug fisierele din folder
			CFileFind f1;
			CString wildcardStr=finder.GetFilePath()+"\\*.*";
			int ok=f1.FindFile(wildcardStr);
			while(ok)
			{
				ok=f1.FindNextFile();
				if (f1.IsDots())
					continue;
				
				if(!f1.IsDirectory())
				{
					AppendString("----->ADAUGAT:"+f1.GetFileName());
					NERO_ISO_ITEM* fileItem=NeroCreateIsoItem();
					strcpy(fileItem->sourceFilePath,f1.GetFilePath());
					strcpy(fileItem->fileName,f1.GetFileName());
					itItem->nextItem=fileItem;
					itItem=fileItem;
					
					
				};
			};
			
			
		}
		folders[numFolders]=finder.GetFilePath();
		fullpathfolders[numFolders]=finder.GetFileName();
		
		numFolders++;
		isFile=false;
	}
	else
	{
	//daca nu e folder, repet operatiunea
	isFile=true;
	NERO_ISO_ITEM* newItem=NeroCreateIsoItem();
	strcpy(newItem->sourceFilePath,finder.GetFilePath());
	strcpy(newItem->fileName,finder.GetFileName());
	
		
	if(first)
	{	
			*item=newItem;
			itItem=newItem;
			firstItem=*item;
			first=0;

			
			
	}
		else
		{
			//(*item)->nextItem=newItem;
			itItem->nextItem=newItem;
			itItem=newItem;
			//aici adaug fisierele din folder
			CFileFind f1;
			CString wildcardStr=finder.GetFilePath()+"\\*.*";
			int ok=f1.FindFile(wildcardStr);
			while(ok)
			{
				ok=f1.FindNextFile();
				if (f1.IsDots())
					continue;

				if(!f1.IsDirectory())
				{
					AppendString("----->ADAUGAT:"+f1.GetFileName());
					NERO_ISO_ITEM* fileItem=NeroCreateIsoItem();
					strcpy(fileItem->sourceFilePath,f1.GetFilePath());
					strcpy(fileItem->fileName,f1.GetFileName());
					itItem->nextItem=fileItem;
					itItem=fileItem;


				};
			};


		}
	folders[numFolders]=finder.GetFilePath();
	fullpathfolders[numFolders]=finder.GetFileName();

	numFolders++;
	//isFile=false;
		
	}

}

finder.Close();

NERO_ISO_ITEM *iItem=NeroCreateIsoItem();
iItem=firstItem;
//mniiFile=firstTimeItem;
for(int i=0;i<numFolders;i++)
{
//AddFolder(folders[i],0,item);
AddFolder(folders[i],0,&iItem->subDirFirstItem); //aici
if(!isFile)
{
iItem=iItem->nextItem;
}

}

}

Here is the main function


		mniiFile1=NeroCreateIsoItem();				
		mniiFile=mniiFile1;
		//mniiFile0=NeroCreateIsoItem();				
		//creez itemul initial 
		//item=firstItem=NeroCreateIsoItem();
		mniiFile1-&gt;longFileName="temp";
		mniiFile1-&gt;longSourceFilePath="d:\	emp";
		mniiFile1-&gt;isDirectory=TRUE;
		mniiFile1-&gt;isReference=FALSE;
		mniiFile1-&gt;nextItem=NULL;
		AddFolder("d:\	emp",0, &mniiFile1-&gt;subDirFirstItem);
		
		mniiFile=mniiFile1;//-&gt;subDirFirstItem;
		
		
		//			return;
		
		
		
		
		
		writeCD.nwcdpCDStamp=NULL;
		writeCD.nwcdArtist=NULL;
		writeCD.nwcdTitle=NULL;
		writeCD.nwcdCDExtra=FALSE;
		writeCD.nwcdNumTracks=0;
		writeCD.nwcdMediaType = MEDIA_CD;
		int i = mcbxDevices.GetCurSel();
		NERO_SCSI_DEVICE_INFO* nsdiDevice = (NERO_SCSI_DEVICE_INFO*)mcbxDevices.GetItemDataPtr(i);
		//open device
		ndhDeviceHandle = NeroOpenDevice(nsdiDevice);
		if (!ndhDeviceHandle)
		{
			AppendString("Device could not be opened: "+(CString)nsdiDevice-&gt;nsdiDeviceName);
		}
		else
		{
			
			//import session
			//ImportSession();
			
			mbtnAbort.EnableWindow(true);
			mCancel.EnableWindow(false);
			mOK.EnableWindow(false);
			mcbxDevices.EnableWindow(false);
			mbtnBrowse.EnableWindow(false);
			mbtnBurn.EnableWindow(false);
			mpgsProgress.SetRange(0,100);
			int iRes;
			//------------------------------------------------------------------------------------------------------
			//MessageBox("1");
			writeCD.nwcdIsoTrack = NeroCreateIsoTrackEx(mniiFile, "BurnerTest", NCITEF_CREATE_ISO_FS|NCITEF_USE_JOLIET);
			//MessageBox("2");
			//iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_CD, &writeCD, NBF_WRITE|NBF_DAO|NBF_DISABLE_ABORT|NBF_DETECT_NON_EMPTY_CDRW|NBF_SPEED_IN_KBS|NBF_CLOSE_SESSION|NBF_BUF_UNDERRUN_PROT|NBF_DISABLE_EJECT, 0, &npProgress);
			//eject disabled
			//iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_CD, &writeCD, NBF_WRITE|NBF_DAO|NBF_DISABLE_ABORT|NBF_DETECT_NON_EMPTY_CDRW|NBF_SPEED_IN_KBS|NBF_CLOSE_SESSION|NBF_BUF_UNDERRUN_PROT|NBF_DISABLE_EJECT, 0, &npProgress);
			//eject enabled
			iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_CD, &writeCD, NBF_WRITE|NBF_DAO|NBF_DISABLE_ABORT|NBF_DETECT_NON_EMPTY_CDRW|NBF_SPEED_IN_KBS|NBF_CLOSE_SESSION|NBF_BUF_UNDERRUN_PROT, 0, &npProgress);
			//MessageBox("3");