Skip to content

Commit

Permalink
fix the full framework build
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsitnik committed Apr 13, 2021
1 parent 29b1223 commit 07cfc75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ internal static unsafe (uint status, IntPtr handle) CreateFile(
}
}

internal static unsafe (uint status, IntPtr handle) CreateFile(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long allocationSize)
internal static unsafe (uint status, IntPtr handle) CreateFile(ReadOnlySpan<char> path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long allocationSize)
=> CreateFile(
path: PathInternal.IsExtended(path) ? path : @"\??\" + Path.GetFullPath(path), // TODO: we might consider getting rid of this managed allocation,
path: path,
rootDirectory: IntPtr.Zero,
createDisposition: GetCreateDisposition(mode),
desiredAccess: GetDesiredAccess(access, mode, options),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@
<Link>Common\Interop\Windows\Kernel32\Interop.CreateFile.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Windows\NtDll\Interop.NtCreateFile.cs">
<Link>Common\Interop\Windows\Kernel32\NtDll\Interop.NtCreateFile.cs</Link>
<Link>Common\Interop\Windows\NtDll\Interop.NtCreateFile.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CriticalSection.cs">
<Link>Common\Interop\Windows\Kernel32\Interop.CriticalSection.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ private static unsafe SafeFileHandle CreateFileOpenHandle(string path, FileMode

if (allocationSize > 0)
{
(uint ntStatus, IntPtr fileHandle) = Interop.NtDll.CreateFile(path, mode, access, share, options, allocationSize);
string prefixedAbsolutePath = PathInternal.IsExtended(path) ? path : @"\??\" + Path.GetFullPath(path); // TODO: we might consider getting rid of this managed allocation,
(uint ntStatus, IntPtr fileHandle) = Interop.NtDll.CreateFile(prefixedAbsolutePath, mode, access, share, options, allocationSize);
if (ntStatus == 0)
{
return ValidateFileHandle(new SafeFileHandle(fileHandle, ownsHandle: true), path, (options & FileOptions.Asynchronous) != 0);
Expand Down

0 comments on commit 07cfc75

Please sign in to comment.