EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Creating a folder

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#8088
Posted: 11/06/2008 12:32:09
by Khayralla AL-Athari (Standard support level)
Joined: 09/23/2008
Posts: 75

Please try to test the code (throwing the error).

I appreciate your help.
#8109
Posted: 11/07/2008 03:00:25
by Volodymyr Zinin (EldoS Corp.)

Eugene is right. The ECBFSError exception is caught by the catch section because ECBFSError is a subclass of the Exception class.
Code
{
   ...
   throw new ECBFSError(5);//ERROR_ACCESS_DENIED);
   ...
}
catch (Exception ex)
{  
   log.Write(ex.Message);
}


Quote
Khayralla AL-Athari wrote:
Please try to test the code (throwing the error).

I've checked using the .NET Mapper sample and it works well. The following modification has only been made:
Code
private void CbFsCreateFile(object sender, string FileName, ACCESS_MASK DesiredAccess, uint FileAttributes, uint ShareMode, ref IntPtr FileHandleContext)
{
  ...
  if ((FileAttributes & (uint)CbFsFileAttributes.CBFS_FILE_ATTRIBUTE_DIRECTORY) != 0)
  {
    //DirectoryInfo dirInfo = Directory.CreateDirectory(mRootPath + FileName);
    //sfh = CreateFile(mRootPath + FileName, GENERIC_READ | FILE_WRITE_ATTRIBUTES, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, FILE_FLAG_BACKUP_SEMANTICS, IntPtr.Zero);
    
    throw new ECBFSError(5);
  }
  ...
}

#8116
Posted: 11/07/2008 09:45:50
by Khayralla AL-Athari (Standard support level)
Joined: 09/23/2008
Posts: 75

thanks Eugene, Vladimir

I was testing it in the Debug Mode.
So it raise another error immediatley after throwing the error.

No, It is working very well.
thanks again

Reply

Statistics

Topic viewed 7536 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!