From 3d6694fd9a58d2ec1df85057dd70e4b1253b88e2 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Fri, 6 Jan 2017 10:56:05 +0200 Subject: [PATCH] Moved NTCreateFile enums --- .../NtCreateFile}/CreateDisposition.cs | 2 +- .../NtCreateFile}/CreateOptions.cs | 41 +++++++++++-------- .../NtCreateFile}/ShareAccess.cs | 2 +- SMBLibrary/SMBLibrary.csproj | 6 +-- 4 files changed, 29 insertions(+), 22 deletions(-) rename SMBLibrary/{SMB1/Enums/NTCreate => Enums/NtCreateFile}/CreateDisposition.cs (95%) rename SMBLibrary/{SMB1/Enums/NTCreate => Enums/NtCreateFile}/CreateOptions.cs (78%) rename SMBLibrary/{SMB1/Enums/NTCreate => Enums/NtCreateFile}/ShareAccess.cs (87%) diff --git a/SMBLibrary/SMB1/Enums/NTCreate/CreateDisposition.cs b/SMBLibrary/Enums/NtCreateFile/CreateDisposition.cs similarity index 95% rename from SMBLibrary/SMB1/Enums/NTCreate/CreateDisposition.cs rename to SMBLibrary/Enums/NtCreateFile/CreateDisposition.cs index 1800d0c..069bd94 100644 --- a/SMBLibrary/SMB1/Enums/NTCreate/CreateDisposition.cs +++ b/SMBLibrary/Enums/NtCreateFile/CreateDisposition.cs @@ -1,5 +1,5 @@ -namespace SMBLibrary.SMB1 +namespace SMBLibrary { public enum CreateDisposition : uint { diff --git a/SMBLibrary/SMB1/Enums/NTCreate/CreateOptions.cs b/SMBLibrary/Enums/NtCreateFile/CreateOptions.cs similarity index 78% rename from SMBLibrary/SMB1/Enums/NTCreate/CreateOptions.cs rename to SMBLibrary/Enums/NtCreateFile/CreateOptions.cs index e53333c..a20cfe8 100644 --- a/SMBLibrary/SMB1/Enums/NTCreate/CreateOptions.cs +++ b/SMBLibrary/Enums/NtCreateFile/CreateOptions.cs @@ -1,6 +1,6 @@ using System; -namespace SMBLibrary.SMB1 +namespace SMBLibrary { [Flags] public enum CreateOptions : uint @@ -9,67 +9,70 @@ namespace SMBLibrary.SMB1 /// The file being created or opened is a directory file. /// With this option, the CreateDisposition field MUST be set to FILE_CREATE, FILE_OPEN, or FILE_OPEN_IF. /// - FILE_DIRECTORY_FILE = 0x0001, + FILE_DIRECTORY_FILE = 0x00000001, /// /// Applications that write data to the file MUST actually transfer the data into the file before any write request is considered complete. /// If FILE_NO_INTERMEDIATE_BUFFERING is set, the server MUST perform as if FILE_WRITE_THROUGH is set in the create request. /// - FILE_WRITE_THROUGH = 0x0002, + FILE_WRITE_THROUGH = 0x00000002, /// /// This option indicates that access to the file can be sequential. /// The server can use this information to influence its caching and read-ahead strategy for this file. /// The file MAY in fact be accessed randomly, but the server can optimize its caching and read-ahead policy for sequential access. /// - FILE_SEQUENTIAL_ONLY = 0x0004, + FILE_SEQUENTIAL_ONLY = 0x00000004, /// /// The file SHOULD NOT be cached or buffered in an internal buffer by the server. /// This option is incompatible when the FILE_APPEND_DATA bit field is set in the DesiredAccess field. /// - FILE_NO_INTERMEDIATE_BUFFERING = 0x0008, + FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008, - FILE_SYNCHRONOUS_IO_ALERT = 0x0010, + FILE_SYNCHRONOUS_IO_ALERT = 0x00000010, - FILE_SYNCHRONOUS_IO_NONALERT = 0x0020, + FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020, /// /// If the file being opened is a directory, the server MUST fail the request with STATUS_FILE_IS_A_DIRECTORY /// - FILE_NON_DIRECTORY_FILE = 0x0040, + FILE_NON_DIRECTORY_FILE = 0x00000040, - FILE_CREATE_TREE_CONNECTION = 0x0080, + FILE_CREATE_TREE_CONNECTION = 0x00000080, - FILE_COMPLETE_IF_OPLOCKED = 0x0100, + FILE_COMPLETE_IF_OPLOCKED = 0x00000100, /// /// The application that initiated the client's request does not support extended attributes (EAs). /// 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. /// - FILE_NO_EA_KNOWLEDGE = 0x0200, + FILE_NO_EA_KNOWLEDGE = 0x00000200, - FILE_OPEN_FOR_RECOVERY = 0x0400, + /// + /// formerly known as FILE_OPEN_FOR_RECOVERY + /// + FILE_OPEN_REMOTE_INSTANCE = 0x00000400, /// /// Indicates that access to the file can be random. /// The server MAY use this information to influence its caching and read-ahead strategy for this file. /// This is a hint to the server that sequential read-ahead operations might not be appropriate on the file. /// - FILE_RANDOM_ACCESS = 0x0800, + FILE_RANDOM_ACCESS = 0x00000800, /// /// The file SHOULD be automatically deleted when the last open request on this file is closed. /// When this option is set, the DesiredAccess field MUST include the DELETE flag. /// This option is often used for temporary files. /// - FILE_DELETE_ON_CLOSE = 0x1000, + FILE_DELETE_ON_CLOSE = 0x00001000, /// /// Opens a file based on the FileId. /// 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. /// - FILE_OPEN_BY_FILE_ID = 0x2000, + FILE_OPEN_BY_FILE_ID = 0x00002000, /// /// The file is being opened or created for the purposes of either a backup or a restore operation. @@ -77,13 +80,17 @@ namespace SMBLibrary.SMB1 /// whatever security checks have been placed on the file to allow a backup or restore operation to occur. /// The server can check for certain access rights to the file before checking the DesiredAccess field. /// - FILE_OPEN_FOR_BACKUP_INTENT = 0x4000, + FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000, /// /// When a new file is created, the file MUST NOT be compressed, even if it is on a compressed volume. /// The flag MUST be ignored when opening an existing file. /// - FILE_NO_COMPRESSION = 0x8000, + FILE_NO_COMPRESSION = 0x00008000, + + FILE_OPEN_REQUIRING_OPLOCK = 0x00010000, + + FILE_DISALLOW_EXCLUSIVE = 0x00020000, FILE_RESERVE_OPFILTER = 0x00100000, diff --git a/SMBLibrary/SMB1/Enums/NTCreate/ShareAccess.cs b/SMBLibrary/Enums/NtCreateFile/ShareAccess.cs similarity index 87% rename from SMBLibrary/SMB1/Enums/NTCreate/ShareAccess.cs rename to SMBLibrary/Enums/NtCreateFile/ShareAccess.cs index 05e1eed..b29496e 100644 --- a/SMBLibrary/SMB1/Enums/NTCreate/ShareAccess.cs +++ b/SMBLibrary/Enums/NtCreateFile/ShareAccess.cs @@ -1,6 +1,6 @@ using System; -namespace SMBLibrary.SMB1 +namespace SMBLibrary { /// /// No bits set = Prevents the file from being shared diff --git a/SMBLibrary/SMBLibrary.csproj b/SMBLibrary/SMBLibrary.csproj index 8879df6..ee196c3 100644 --- a/SMBLibrary/SMBLibrary.csproj +++ b/SMBLibrary/SMBLibrary.csproj @@ -44,6 +44,9 @@ + + + @@ -168,15 +171,12 @@ - - -