CreateOptions.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using System;
  2. namespace SMBLibrary
  3. {
  4. [Flags]
  5. public enum CreateOptions : uint
  6. {
  7. /// <summary>
  8. /// The file being created or opened is a directory file.
  9. /// With this option, the CreateDisposition field MUST be set to FILE_CREATE, FILE_OPEN, or FILE_OPEN_IF.
  10. /// </summary>
  11. FILE_DIRECTORY_FILE = 0x00000001,
  12. /// <summary>
  13. /// Applications that write data to the file MUST actually transfer the data into the file before any write request is considered complete.
  14. /// If FILE_NO_INTERMEDIATE_BUFFERING is set, the server MUST perform as if FILE_WRITE_THROUGH is set in the create request.
  15. /// </summary>
  16. FILE_WRITE_THROUGH = 0x00000002,
  17. /// <summary>
  18. /// This option indicates that access to the file can be sequential.
  19. /// The server can use this information to influence its caching and read-ahead strategy for this file.
  20. /// The file MAY in fact be accessed randomly, but the server can optimize its caching and read-ahead policy for sequential access.
  21. /// </summary>
  22. FILE_SEQUENTIAL_ONLY = 0x00000004,
  23. /// <summary>
  24. /// The file SHOULD NOT be cached or buffered in an internal buffer by the server.
  25. /// This option is incompatible when the FILE_APPEND_DATA bit field is set in the DesiredAccess field.
  26. /// </summary>
  27. FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008,
  28. FILE_SYNCHRONOUS_IO_ALERT = 0x00000010,
  29. FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020,
  30. /// <summary>
  31. /// If the file being opened is a directory, the server MUST fail the request with STATUS_FILE_IS_A_DIRECTORY
  32. /// </summary>
  33. FILE_NON_DIRECTORY_FILE = 0x00000040,
  34. FILE_CREATE_TREE_CONNECTION = 0x00000080,
  35. FILE_COMPLETE_IF_OPLOCKED = 0x00000100,
  36. /// <summary>
  37. /// The application that initiated the client's request does not support extended attributes (EAs).
  38. /// If the EAs on an existing file being opened indicate that the caller SHOULD support EAs to correctly interpret the file, the server SHOULD fail this request with STATUS_ACCESS_DENIED.
  39. /// </summary>
  40. FILE_NO_EA_KNOWLEDGE = 0x00000200,
  41. /// <summary>
  42. /// formerly known as FILE_OPEN_FOR_RECOVERY
  43. /// </summary>
  44. FILE_OPEN_REMOTE_INSTANCE = 0x00000400,
  45. /// <summary>
  46. /// Indicates that access to the file can be random.
  47. /// The server MAY use this information to influence its caching and read-ahead strategy for this file.
  48. /// This is a hint to the server that sequential read-ahead operations might not be appropriate on the file.
  49. /// </summary>
  50. FILE_RANDOM_ACCESS = 0x00000800,
  51. /// <summary>
  52. /// The file SHOULD be automatically deleted when the last open request on this file is closed.
  53. /// When this option is set, the DesiredAccess field MUST include the DELETE flag.
  54. /// This option is often used for temporary files.
  55. /// </summary>
  56. FILE_DELETE_ON_CLOSE = 0x00001000,
  57. /// <summary>
  58. /// Opens a file based on the FileId.
  59. /// If this option is set, the server MUST fail the request with STATUS_NOT_SUPPORTED in the Status field of the SMB Header in the server response.
  60. /// </summary>
  61. FILE_OPEN_BY_FILE_ID = 0x00002000,
  62. /// <summary>
  63. /// The file is being opened or created for the purposes of either a backup or a restore operation.
  64. /// Thus, the server can make appropriate checks to ensure that the caller is capable of overriding
  65. /// whatever security checks have been placed on the file to allow a backup or restore operation to occur.
  66. /// The server can check for certain access rights to the file before checking the DesiredAccess field.
  67. /// </summary>
  68. FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000,
  69. /// <summary>
  70. /// When a new file is created, the file MUST NOT be compressed, even if it is on a compressed volume.
  71. /// The flag MUST be ignored when opening an existing file.
  72. /// </summary>
  73. FILE_NO_COMPRESSION = 0x00008000,
  74. FILE_OPEN_REQUIRING_OPLOCK = 0x00010000,
  75. FILE_DISALLOW_EXCLUSIVE = 0x00020000,
  76. FILE_RESERVE_OPFILTER = 0x00100000,
  77. FILE_OPEN_REPARSE_POINT = 0x00200000,
  78. /// <summary>
  79. /// In a hierarchical storage management environment, this option requests that the file SHOULD NOT be recalled from tertiary storage such as tape.
  80. /// A file recall can take up to several minutes in a hierarchical storage management environment.
  81. /// The clients can specify this option to avoid such delays.
  82. /// </summary>
  83. FILE_OPEN_NO_RECALL = 0x00400000,
  84. FILE_OPEN_FOR_FREE_SPACE_QUERY = 0x00800000,
  85. }
  86. }