Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -697,22 +697,37 @@
<Link>Interop\Windows\Kernel32\IoControlTransferType.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\Kernel32\Kernel32.cs">
<Link>Common\Interop\Windows\Kernel32\Kernel32.cs</Link>
<Link>Interop\Windows\Kernel32\Kernel32.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\Interop.FILE_FULL_EA_INFORMATION.cs">
<Link>Interop\Windows\NtDll\Interop.FILE_FULL_EA_INFORMATION.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\CreateDisposition.cs">
<Link>Interop\Windows\NtDll\Interop\Windows\NtDll\CreateDisposition.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\Interop.IO_STATUS_BLOCK.cs">
<Link>Interop\Windows\NtDll\Interop.IO_STATUS_BLOCK.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\CreateOptions.cs">
<Link>Interop\Windows\NtDll\Interop\Windows\NtDll\CreateOptions.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\Interop.NtCreateFile.cs">
<Link>Interop\Windows\NtDll\Interop.NtCreateFile.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\DesiredAccess.cs">
<Link>Interop\Windows\NtDll\Interop\Windows\NtDll\DesiredAccess.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\Interop.RtlNtStatusToDosError.cs">
<Link>Interop\Windows\NtDll\Interop.RtlNtStatusToDosError.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\FileFullEaInformation.cs">
<Link>Interop\Windows\NtDll\Interop\Windows\NtDll\FileFullEaInformation.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\Interop.SecurityQualityOfService.cs">
<Link>Interop\Windows\NtDll\Interop.SecurityQualityOfService.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\ImpersonationLevel.cs">
<Link>Interop\Windows\NtDll\ImpersonaltionLevel.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\IoStatusBlock.cs">
<Link>Interop\Windows\NtDll\IoStatusBlock.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\NtDll.cs">
<Link>Interop\Windows\NtDll\Interop\Windows\NtDll\NtDll.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\ObjectAttributeFlags.cs">
<Link>Interop\Windows\NtDll\Interop\Windows\NtDll\ObjectAttributes.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\ObjectAttributes.cs">
<Link>Interop\Windows\NtDll\Interop\Windows\NtDll\ObjectAttributes.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\SecurityQualityOfService.cs">
<Link>Interop\Windows\NtDll\Interop\Windows\NtDll\SecurityQualityOfService.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\SChannel\Interop.SecPkgContext_ApplicationProtocol.netcore.cs">
<Link>Interop\Windows\SChannel\Interop.SecPkgContext_ApplicationProtocol.netcore.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,35 @@
<Compile Include="$(CommonSourceRoot)Interop\Windows\Interop.Libraries.cs">
<Link>Interop\Interop.Libraries.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Interop\Windows\NtDll\Interop.FILE_FULL_EA_INFORMATION.cs">
<Link>Interop\NtDll\Interop.FILE_FULL_EA_INFORMATION.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\CreateDisposition.cs">
<Link>Common\Interop\Windows\NtDll\Interop\Windows\NtDll\CreateDisposition.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Interop\Windows\NtDll\Interop.IO_STATUS_BLOCK.cs">
<Link>Interop\NtDll\Interop.IO_STATUS_BLOCK.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\CreateOptions.cs">
<Link>Common\Interop\Windows\NtDll\Interop\Windows\NtDll\CreateOptions.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Interop\Windows\NtDll\Interop.NtCreateFile.cs">
<Link>Interop\NtDll\Interop.NtCreateFile.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\DesiredAccess.cs">
<Link>Common\Interop\Windows\NtDll\Interop\Windows\NtDll\DesiredAccess.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Interop\Windows\NtDll\Interop.RtlNtStatusToDosError.cs">
<Link>Interop\NtDll\Interop.RtlNtStatusToDosError.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\FileFullEaInformation.cs">
<Link>Common\Interop\Windows\NtDll\Interop\Windows\NtDll\FileFullEaInformation.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Interop\Windows\NtDll\Interop.SecurityQualityOfService.cs">
<Link>Interop\NtDll\Interop.SecurityQualityOfService.cs</Link>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\ImpersonationLevel.cs">
<Link>Common\Interop\Windows\NtDll\ImpersonaltionLevel.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Interop\Windows\NtDll\IoStatusBlock.cs">
<Link>Interop\NtDll\IoStatusBlock.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\NtDll.cs">
<Link>Common\Interop\Windows\NtDll\Interop\Windows\NtDll\NtDll.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\ObjectAttributeFlags.cs">
<Link>Common\Interop\Windows\NtDll\Interop\Windows\NtDll\ObjectAttributes.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\ObjectAttributes.cs">
<Link>Common\Interop\Windows\NtDll\Interop\Windows\NtDll\ObjecAttributes.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)\Interop\Windows\NtDll\SecurityQualityOfService.cs">
<Link>Common\Interop\Windows\NtDll\Interop\Windows\NtDll\SecurityQualityOfService.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Interop\Windows\UnicodeString.cs">
<Link>Interop\UnicodeString.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Interop_TEMP.Windows.NtDll
{
/// <summary>
/// File creation disposition when calling directly to NT APIs.
/// </summary>
internal enum CreateDisposition : uint
{
/// <summary>
/// Default. Replace or create. Deletes existing file instead of overwriting.
/// </summary>
/// <remarks>
/// As this potentially deletes it requires that DesiredAccess must include Delete.
/// This has no equivalent in CreateFile.
/// </remarks>
FILE_SUPERSEDE = 0,

/// <summary>
/// Open if the file exists or fail if it doesn't exist. Equivalent to OPEN_EXISTING or
/// <see cref="System.IO.FileMode.Open"/>.
/// </summary>
/// <remarks>
/// TruncateExisting also uses Open and then manually truncates the file
/// by calling NtSetInformationFile with FileAllocationInformation and an
/// allocation size of 0.
/// </remarks>
FILE_OPEN = 1,

/// <summary>
/// Create if the file doesn't exist or fail if it does exist. Equivalent to CREATE_NEW
/// or <see cref="System.IO.FileMode.CreateNew"/>.
/// </summary>
FILE_CREATE = 2,

/// <summary>
/// Open if the file exists or create if it doesn't exist. Equivalent to OPEN_ALWAYS or
/// <see cref="System.IO.FileMode.OpenOrCreate"/>.
/// </summary>
FILE_OPEN_IF = 3,

/// <summary>
/// Open and overwrite if the file exists or fail if it doesn't exist. Equivalent to
/// TRUNCATE_EXISTING or <see cref="System.IO.FileMode.Truncate"/>.
/// </summary>
FILE_OVERWRITE = 4,

/// <summary>
/// Open and overwrite if the file exists or create if it doesn't exist. Equivalent to
/// CREATE_ALWAYS or <see cref="System.IO.FileMode.Create"/>.
/// </summary>
FILE_OVERWRITE_IF = 5
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

namespace Interop_TEMP.Windows.NtDll
{
/// <summary>
/// Options for creating/opening files with NtCreateFile.
/// </summary>
[Flags]
internal enum CreateOptions : uint
{
/// <summary>
/// File being created or opened must be a directory file. Disposition must be FILE_CREATE, FILE_OPEN,
/// or FILE_OPEN_IF.
/// </summary>
/// <remarks>
/// Can only be used with FILE_SYNCHRONOUS_IO_ALERT/NONALERT, FILE_WRITE_THROUGH, FILE_OPEN_FOR_BACKUP_INTENT,
/// and FILE_OPEN_BY_FILE_ID flags.
/// </remarks>
FILE_DIRECTORY_FILE = 0x00000001,

/// <summary>
/// Applications that write data to the file must actually transfer the data into
/// the file before any requested write operation is considered complete. This flag
/// is set automatically if FILE_NO_INTERMEDIATE_BUFFERING is set.
/// </summary>
FILE_WRITE_THROUGH = 0x00000002,

/// <summary>
/// All accesses to the file are sequential.
/// </summary>
FILE_SEQUENTIAL_ONLY = 0x00000004,

/// <summary>
/// File cannot be cached in driver buffers. Cannot use with AppendData desired access.
/// </summary>
FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008,

/// <summary>
/// All operations are performed synchronously. Any wait on behalf of the caller is
/// subject to premature termination from alerts.
/// </summary>
/// <remarks>
/// Cannot be used with FILE_SYNCHRONOUS_IO_NONALERT.
/// Synchronous DesiredAccess flag is required. I/O system will maintain file position context.
/// </remarks>
FILE_SYNCHRONOUS_IO_ALERT = 0x00000010,

/// <summary>
/// All operations are performed synchronously. Waits in the system to synchronize I/O queuing
/// and completion are not subject to alerts.
/// </summary>
/// <remarks>
/// Cannot be used with FILE_SYNCHRONOUS_IO_ALERT.
/// Synchronous DesiredAccess flag is required. I/O system will maintain file position context.
/// </remarks>
FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020,

/// <summary>
/// File being created or opened must not be a directory file. Can be a data file, device,
/// or volume.
/// </summary>
FILE_NON_DIRECTORY_FILE = 0x00000040,

/// <summary>
/// Create a tree connection for this file in order to open it over the network.
/// </summary>
/// <remarks>
/// Not used by device and intermediate drivers.
/// </remarks>
FILE_CREATE_TREE_CONNECTION = 0x00000080,

/// <summary>
/// Complete the operation immediately with a success code of STATUS_OPLOCK_BREAK_IN_PROGRESS if
/// the target file is oplocked.
/// </summary>
/// <remarks>
/// Not compatible with ReserveOpfilter or OpenRequiringOplock.
/// Not used by device and intermediate drivers.
/// </remarks>
FILE_COMPLETE_IF_OPLOCKED = 0x00000100,

/// <summary>
/// If the extended attributes on an existing file being opened indicate that the caller must
/// understand extended attributes to properly interpret the file, fail the request.
/// </summary>
/// <remarks>
/// Not used by device and intermediate drivers.
/// </remarks>
FILE_NO_EA_KNOWLEDGE = 0x00000200,

// Behavior undocumented, defined in headers
// FILE_OPEN_REMOTE_INSTANCE = 0x00000400,

/// <summary>
/// Accesses to the file can be random, so no sequential read-ahead operations should be performed
/// on the file by FSDs or the system.
/// </summary>
FILE_RANDOM_ACCESS = 0x00000800,

/// <summary>
/// Delete the file when the last handle to it is passed to NtClose. Requires Delete flag in
/// DesiredAccess parameter.
/// </summary>
FILE_DELETE_ON_CLOSE = 0x00001000,

/// <summary>
/// Open the file by reference number or object ID. The file name that is specified by the ObjectAttributes
/// name parameter includes the 8 or 16 byte file reference number or ID for the file in the ObjectAttributes
/// name field. The device name can optionally be prefixed.
/// </summary>
/// <remarks>
/// NTFS supports both reference numbers and object IDs. 16 byte reference numbers are 8 byte numbers padded
/// with zeros. ReFS only supports reference numbers (not object IDs). 8 byte and 16 byte reference numbers
/// are not related. Note that as the UNICODE_STRING will contain raw byte data, it may not be a "valid" string.
/// Not used by device and intermediate drivers.
/// </remarks>
/// <example>
/// \??\C:\{8 bytes of binary FileID}
/// \device\HardDiskVolume1\{16 bytes of binary ObjectID}
/// {8 bytes of binary FileID}
/// </example>
FILE_OPEN_BY_FILE_ID = 0x00002000,

/// <summary>
/// The file is being opened for backup intent. Therefore, the system should check for certain access rights
/// and grant the caller the appropriate access to the file before checking the DesiredAccess parameter
/// against the file's security descriptor.
/// </summary>
/// <remarks>
/// Not used by device and intermediate drivers.
/// </remarks>
FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000,

/// <summary>
/// When creating a file, specifies that it should not inherit the compression bit from the parent directory.
/// </summary>
FILE_NO_COMPRESSION = 0x00008000,

/// <summary>
/// The file is being opened and an opportunistic lock (oplock) on the file is being requested as a single atomic
/// operation.
/// </summary>
/// <remarks>
/// The file system checks for oplocks before it performs the create operation and will fail the create with a
/// return code of STATUS_CANNOT_BREAK_OPLOCK if the result would be to break an existing oplock.
/// Not compatible with CompleteIfOplocked or ReserveOpFilter. Windows 7 and up.
/// </remarks>
FILE_OPEN_REQUIRING_OPLOCK = 0x00010000,

/// <summary>
/// CreateFile2 uses this flag to prevent opening a file that you don't have access to without specifying
/// FILE_SHARE_READ. (Preventing users that can only read a file from denying access to other readers.)
/// </summary>
/// <remarks>
/// Windows 7 and up.
/// </remarks>
FILE_DISALLOW_EXCLUSIVE = 0x00020000,

/// <summary>
/// The client opening the file or device is session aware and per session access is validated if necessary.
/// </summary>
/// <remarks>
/// Windows 8 and up.
/// </remarks>
FILE_SESSION_AWARE = 0x00040000,

/// <summary>
/// This flag allows an application to request a filter opportunistic lock (oplock) to prevent other applications
/// from getting share violations.
/// </summary>
/// <remarks>
/// Not compatible with CompleteIfOplocked or OpenRequiringOplock.
/// If there are already open handles, the create request will fail with STATUS_OPLOCK_NOT_GRANTED.
/// </remarks>
FILE_RESERVE_OPFILTER = 0x00100000,

/// <summary>
/// Open a file with a reparse point attribute, bypassing the normal reparse point processing.
/// </summary>
FILE_OPEN_REPARSE_POINT = 0x00200000,

/// <summary>
/// Causes files that are marked with the Offline attribute not to be recalled from remote storage.
/// </summary>
/// <remarks>
/// More details can be found in Remote Storage documentation (see Basic Concepts).
/// https://technet.microsoft.com/en-us/library/cc938459.aspx
/// </remarks>
FILE_OPEN_NO_RECALL = 0x00400000

// Behavior undocumented, defined in headers
// FILE_OPEN_FOR_FREE_SPACE_QUERY = 0x00800000
}
}
Loading
Loading