#nullable enable
using Microsoft.Win32.SafeHandles;
+using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
FileMode dwCreationDisposition,
ref Kernel32.CREATEFILE2_EXTENDED_PARAMETERS pCreateExParams)
{
- lpFileName = PathInternal.EnsureExtendedPrefixOverMaxPath(lpFileName);
- return CreateFile2Private(lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, ref pCreateExParams);
+ string? lpFileNameWithPrefix = PathInternal.EnsureExtendedPrefixIfNeeded(lpFileName);
+ Debug.Assert(lpFileNameWithPrefix != null, "null not expected when non-null passed"); // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/26761
+ return CreateFile2Private(lpFileNameWithPrefix, dwDesiredAccess, dwShareMode, dwCreationDisposition, ref pCreateExParams);
}
}
}
#nullable enable
using Microsoft.Win32.SafeHandles;
+using System.Diagnostics;
using System.Runtime.InteropServices;
namespace System.IO
using (DisableMediaInsertionPrompt.Create())
{
+ Debug.Assert(_path != null);
return ValidateFileHandle(Interop.Kernel32.CreateFile2(
lpFileName: _path,
dwDesiredAccess: access,