/// <summary>
        /// Create directory. One transport can only create one directory
        /// </summary>
        /// <param name="directoryName">The directory name</param>
        /// <param name="desiredAccess">The desired access</param>
        /// <param name="impersonationLevel">The impersonation level</param>
        /// <param name="fileAttribute">The file attribute, this field is only valid when create file.
        /// </param>
        /// <param name="createDisposition">Defines the action the server MUST take if the file that is
        /// specified in the name field already exists</param>
        /// <param name="createOption">Specifies the options to be applied when creating or opening the file</param>
        /// <exception cref="ArgumentException">
        /// createOption can not contain FILE_NON_DIRECTORY_FILE when creating directory.
        /// </exception>
        /// <exception cref="System.InvalidOperationException">Thrown if there is any error occurred</exception>
        public override void Create(string directoryName,
                                    FsDirectoryDesiredAccess desiredAccess, FsImpersonationLevel impersonationLevel,
                                    FsFileAttribute fileAttribute, FsCreateDisposition createDisposition, FsCreateOption createOption)
        {
            if ((createOption & FsCreateOption.FILE_NON_DIRECTORY_FILE) == FsCreateOption.FILE_NON_DIRECTORY_FILE)
            {
                throw new ArgumentException(
                          "createOption can not contain FILE_NON_DIRECTORY_FILE when creating directory.", "createOption");
            }

            InternalCreate(
                directoryName,
                (NtTransactDesiredAccess)desiredAccess,
                (NtTransactImpersonationLevel)impersonationLevel,
                (SMB_EXT_FILE_ATTR)fileAttribute,
                (NtTransactCreateDisposition)createDisposition,
                (NtTransactCreateOptions)createOption);
        }
 /// <summary>
 /// Create directory. One transport can only create one directory
 /// </summary>
 /// <param name="directoryName">The directory name</param>
 /// <param name="desiredAccess">The desired access</param>
 /// <param name="impersonationLevel">The impersonation level</param>
 /// <param name="fileAttribute">The file attribute, this field is only valid when create file.
 /// </param>
 /// <param name="createDisposition">Defines the action the server MUST take if the file that is
 /// specified in the name field already exists</param>
 /// <param name="createOption">Specifies the options to be applied when creating or opening the file</param>
 /// <exception cref="System.InvalidOperationException">Thrown if there is any error occurred</exception>
 public abstract void Create(string directoryName, FsDirectoryDesiredAccess desiredAccess, FsImpersonationLevel impersonationLevel,
                             FsFileAttribute fileAttribute, FsCreateDisposition createDisposition, FsCreateOption createOption);
        /// <summary>
        /// Create directory. One transport can only create one directory
        /// </summary>
        /// <param name="directoryName">The directory name</param>
        /// <param name="desiredAccess">The desired access</param>
        /// <param name="impersonationLevel">The impersonation level</param>
        /// <param name="fileAttribute">The file attribute, this field is only valid when create file.
        /// </param>
        /// <param name="createDisposition">Defines the action the server MUST take if the file that is
        /// specified in the name field already exists</param>
        /// <param name="createOption">Specifies the options to be applied when creating or opening the file</param>
        /// <exception cref="System.InvalidOperationException">Thrown if there is any error occurred</exception>
        public override void Create(string directoryName, FsDirectoryDesiredAccess desiredAccess, FsImpersonationLevel impersonationLevel,
            FsFileAttribute fileAttribute, FsCreateDisposition createDisposition, FsCreateOption createOption)
        {
            if (createOption.HasFlag(FsCreateOption.FILE_NON_DIRECTORY_FILE))
            {
                throw new ArgumentException("createOption cannot contain FILE_NON_DIRECTORY_FILE when creating Directory.");
            }

            InternalCreate(directoryName, (uint)desiredAccess, impersonationLevel, fileAttribute, createDisposition, createOption);
        }
예제 #4
0
 /// <summary>
 /// Create directory. One transport can only create one directory
 /// </summary>
 /// <param name="directoryName">The directory name</param>
 /// <param name="desiredAccess">The desired access</param>
 /// <param name="impersonationLevel">The impersonation level</param>
 /// <param name="fileAttribute">The file attribute, this field is only valid when create file.
 /// </param>
 /// <param name="createDisposition">Defines the action the server MUST take if the file that is
 /// specified in the name field already exists</param>
 /// <param name="createOption">Specifies the options to be applied when creating or opening the file</param>
 /// <exception cref="System.InvalidOperationException">Thrown if there is any error occurred</exception>
 public override void Create(string directoryName, FsDirectoryDesiredAccess desiredAccess, FsImpersonationLevel impersonationLevel,
                             FsFileAttribute fileAttribute, FsCreateDisposition createDisposition, FsCreateOption createOption)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Create directory. One transport can only create one directory
 /// </summary>
 /// <param name="directoryName">The directory name</param>
 /// <param name="desiredAccess">The desired access</param>
 /// <param name="impersonationLevel">The impersonation level</param>
 /// <param name="fileAttribute">The file attribute, this field is only valid when create file.
 /// </param>
 /// <param name="createDisposition">Defines the action the server MUST take if the file that is
 /// specified in the name field already exists</param>
 /// <param name="createOption">Specifies the options to be applied when creating or opening the file</param>
 /// <exception cref="System.InvalidOperationException">Thrown if there is any error occurred</exception>
 public override void Create(string directoryName, FsDirectoryDesiredAccess desiredAccess, FsImpersonationLevel impersonationLevel,
     FsFileAttribute fileAttribute, FsCreateDisposition createDisposition, FsCreateOption createOption)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Create directory. One transport can only create one directory
 /// </summary>
 /// <param name="directoryName">The directory name</param>
 /// <param name="desiredAccess">The desired access</param>
 /// <param name="impersonationLevel">The impersonation level</param>
 /// <param name="fileAttribute">The file attribute, this field is only valid when create file.
 /// </param>
 /// <param name="createDisposition">Defines the action the server MUST take if the file that is
 /// specified in the name field already exists</param>
 /// <param name="createOption">Specifies the options to be applied when creating or opening the file</param>
 /// <exception cref="System.InvalidOperationException">Thrown if there is any error occurred</exception>
 public abstract void Create(string directoryName, FsDirectoryDesiredAccess desiredAccess, FsImpersonationLevel impersonationLevel,
     FsFileAttribute fileAttribute, FsCreateDisposition createDisposition, FsCreateOption createOption);
        /// <summary>
        /// Create directory. One transport can only create one directory
        /// </summary>
        /// <param name="directoryName">The directory name</param>
        /// <param name="desiredAccess">The desired access</param>
        /// <param name="impersonationLevel">The impersonation level</param>
        /// <param name="fileAttribute">The file attribute, this field is only valid when create file.
        /// </param>
        /// <param name="createDisposition">Defines the action the server MUST take if the file that is
        /// specified in the name field already exists</param>
        /// <param name="createOption">Specifies the options to be applied when creating or opening the file</param>
        /// <exception cref="ArgumentException">
        /// createOption can not contain FILE_NON_DIRECTORY_FILE when creating directory.
        /// </exception>
        /// <exception cref="System.InvalidOperationException">Thrown if there is any error occurred</exception>
        public override void Create(string directoryName,
            FsDirectoryDesiredAccess desiredAccess, FsImpersonationLevel impersonationLevel,
            FsFileAttribute fileAttribute, FsCreateDisposition createDisposition, FsCreateOption createOption)
        {
            if ((createOption & FsCreateOption.FILE_NON_DIRECTORY_FILE) == FsCreateOption.FILE_NON_DIRECTORY_FILE)
            {
                throw new ArgumentException(
                    "createOption can not contain FILE_NON_DIRECTORY_FILE when creating directory.", "createOption");
            }

            InternalCreate(
                directoryName,
                (NtTransactDesiredAccess)desiredAccess,
                (NtTransactImpersonationLevel)impersonationLevel,
                (SMB_EXT_FILE_ATTR)fileAttribute,
                (NtTransactCreateDisposition)createDisposition,
                (NtTransactCreateOptions)createOption);
        }