11 instantiations of SafeFileHandle
Microsoft.AspNetCore.Server.HttpSys (1)
Windows.Win32.PInvoke.HTTPAPI.dll.g.cs (1)
161
RequestQueueHandle = new Microsoft.Win32.SafeHandles.
SafeFileHandle
(default, ownsHandle: true);
Microsoft.AspNetCore.Shared.Tests (2)
Windows.Win32.PInvoke.HTTPAPI.dll.g.cs (2)
66
RequestQueueHandle = new Microsoft.Win32.SafeHandles.
SafeFileHandle
(default, ownsHandle: true);
96
RequestQueueHandle = new Microsoft.Win32.SafeHandles.
SafeFileHandle
(default, ownsHandle: true);
System.Console (1)
System\ConsolePal.Unix.cs (1)
68
private static SafeFileHandle OpenStandardHandle(IntPtr fd) => new
SafeFileHandle
(fd, ownsHandle: false);
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (1)
68
: base(new
SafeFileHandle
(initializationData.NestedStream.SafeFileHandle.DangerousGetHandle(), ownsHandle: false), access, bufferSize)
System.IO.MemoryMappedFiles (2)
System\IO\MemoryMappedFiles\MemoryMappedView.Unix.cs (2)
61
fd = new
SafeFileHandle
(new IntPtr(-1), false);
103
new
SafeFileHandle
(new IntPtr(-1), false), // ignore the actual fd even if there was one
System.Private.CoreLib (4)
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (2)
186
SafeFileHandle tempReadHandle =
new
();
187
SafeFileHandle tempWriteHandle =
new
();
src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (1)
46
SafeFileHandle safeHandle = new
SafeFileHandle
(handle, ownsHandle: ownsHandle);
src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (1)
162
creationDeletionLockFileHandle = new AutoReleaseFileLock(new
SafeFileHandle
());
563 references to SafeFileHandle
aspire (3)
Processes\DetachedProcessLauncher.Windows.cs (3)
23
using
var
nulHandle = CreateFileW(
269
private static partial
SafeFileHandle
CreateFileW(
281
SafeFileHandle
hObject,
csc (3)
src\Compilers\Shared\NativeMethods.cs (3)
120
using
var
handle = CreateFileW(
170
private static extern
SafeFileHandle
CreateFileW(
182
SafeFileHandle
hFile,
Microsoft.AspNetCore.InternalTesting (1)
DumpCollector\DumpCollector.Windows.cs (1)
35
public static extern bool MiniDumpWriteDump(IntPtr hProcess, uint ProcessId,
SafeFileHandle
hFile, MINIDUMP_TYPE DumpType, ref MINIDUMP_EXCEPTION_INFORMATION ExceptionParam, IntPtr UserStreamParam, IntPtr CallbackParam);
Microsoft.AspNetCore.Server.HttpSys (2)
NativeInterop\RequestQueue.cs (1)
77
out
var
requestQueueHandle);
Windows.Win32.PInvoke.HTTPAPI.dll.g.cs (1)
155
internal static unsafe uint HttpCreateRequestQueue(winmdroot.Networking.HttpServer.HTTPAPI_VERSION Version, [Optional] string Name, [Optional] winmdroot.Security.SECURITY_ATTRIBUTES? SecurityAttributes, [Optional] uint Flags, out Microsoft.Win32.SafeHandles.
SafeFileHandle
RequestQueueHandle)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
Listener\ServerOnExistingQueueTests.cs (1)
248
out
var
requestQueueHandle);
ServerTests.cs (1)
52
out
var
requestQueueHandle);
Microsoft.AspNetCore.Shared.Tests (2)
Windows.Win32.PInvoke.HTTPAPI.dll.g.cs (2)
63
internal static unsafe uint HttpCreateHttpHandle(out Microsoft.Win32.SafeHandles.
SafeFileHandle
RequestQueueHandle)
90
internal static unsafe uint HttpCreateRequestQueue(winmdroot.Networking.HttpServer.HTTPAPI_VERSION Version, [Optional] string Name, [Optional] winmdroot.Security.SECURITY_ATTRIBUTES? SecurityAttributes, [Optional] uint Flags, out Microsoft.Win32.SafeHandles.
SafeFileHandle
RequestQueueHandle)
Microsoft.Build.Engine.UnitTests (2)
BackEnd\TargetUpToDateChecker_Tests.cs (2)
1013
private static extern bool SetFileTime(
SafeFileHandle
hFile, ref long creationTime,
1042
using (
SafeFileHandle
handle =
Microsoft.Build.Framework (7)
NativeMethods.cs (7)
1219
private static
SafeFileHandle
OpenFileThroughSymlinks(string fullPath)
1244
using (
SafeFileHandle
handle = OpenFileThroughSymlinks(fullPath))
1753
internal static extern bool CreatePipe(out
SafeFileHandle
hReadPipe, out
SafeFileHandle
hWritePipe, SecurityAttributes lpPipeAttributes, int nSize);
1757
internal static extern bool ReadFile(
SafeFileHandle
hFile, byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, IntPtr lpOverlapped);
1777
internal static extern
SafeFileHandle
CreateFile(
1789
SafeFileHandle
hFile,
Microsoft.Build.Tasks.CodeAnalysis (3)
src\Compilers\Shared\NativeMethods.cs (3)
120
using
var
handle = CreateFileW(
170
private static extern
SafeFileHandle
CreateFileW(
182
SafeFileHandle
hFile,
Microsoft.Build.Tasks.CodeAnalysis.Sdk (3)
src\Compilers\Shared\NativeMethods.cs (3)
120
using
var
handle = CreateFileW(
170
private static extern
SafeFileHandle
CreateFileW(
182
SafeFileHandle
hFile,
Microsoft.CodeAnalysis.Test.Utilities (1)
TempFiles\DisposableFile.cs (1)
62
private static extern void SetFileInformationByHandle(
SafeFileHandle
handle, int fileInformationClass, ref uint fileDispositionInfoDeleteFile, int bufferSize);
Microsoft.Extensions.Hosting.Systemd (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
Microsoft.Extensions.Hosting.WindowsServices (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
23
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.
SafeFileHandle
))]
netstandard (1)
netstandard.cs (1)
7
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.
SafeFileHandle
))]
PresentationCore (15)
MS\Internal\FontCache\FontCacheUtil.cs (1)
816
using (
SafeFileHandle
fileHandle = UnsafeNativeMethods.CreateFile(
System\Windows\Media\Imaging\BitmapDecoder.cs (4)
163
SafeFileHandle
safeFilehandle
235
SafeFileHandle
safeFilehandle = null;
995
out
SafeFileHandle
safeFilehandle
1663
private
SafeFileHandle
_safeFilehandle;
System\Windows\Media\Imaging\BitmapDownload.cs (1)
124
SafeFileHandle
fileHandle = MS.Win32.UnsafeNativeMethods.CreateFile(
System\Windows\Media\Imaging\BmpBitmapDecoder.cs (1)
70
SafeFileHandle
safeFilehandle
System\Windows\Media\Imaging\GifBitmapDecoder.cs (1)
70
SafeFileHandle
safeFilehandle
System\Windows\Media\Imaging\IconBitmapDecoder.cs (1)
70
SafeFileHandle
safeFilehandle
System\Windows\Media\Imaging\JpegBitmapDecoder.cs (1)
70
SafeFileHandle
safeFilehandle
System\Windows\Media\Imaging\PngBitmapDecoder.cs (1)
70
SafeFileHandle
safeFilehandle
System\Windows\Media\Imaging\TiffBitmapDecoder.cs (1)
70
SafeFileHandle
safeFilehandle
System\Windows\Media\Imaging\UnknownBitmapDecoder.cs (1)
60
SafeFileHandle
safeFilehandle
System\Windows\Media\Imaging\WmpBitmapDecoder.cs (1)
70
SafeFileHandle
safeFilehandle
System\Windows\Media\UnsafeNativeMethodsMilCoreApi.cs (1)
695
Microsoft.Win32.SafeHandles.
SafeFileHandle
/*ULONG_PTR*/ hFileHandle,
Replay (3)
src\Compilers\Shared\NativeMethods.cs (3)
120
using
var
handle = CreateFileW(
170
private static extern
SafeFileHandle
CreateFileW(
182
SafeFileHandle
hFile,
System.Console (33)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FLock.cs (1)
21
internal static partial int FLock(
SafeFileHandle
fd, LockOperations operation);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetWindowWidth.cs (1)
22
internal static partial int GetWindowSize(
SafeFileHandle
terminalHandle, out WinSize winSize);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.InitializeTerminalAndSignalHandling.cs (1)
16
internal static partial void SetKeypadXmit(
SafeFileHandle
terminalHandle, string terminfoString);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.Open.cs (1)
12
internal static partial
SafeFileHandle
Open(string filename, OpenFlags flags, int mode);
System\Console.cs (6)
659
/// <returns>A <see cref="
SafeFileHandle
"/> representing the standard input handle.</returns>
667
public static
SafeFileHandle
OpenStandardInputHandle()
675
/// <returns>A <see cref="
SafeFileHandle
"/> representing the standard output handle.</returns>
682
public static
SafeFileHandle
OpenStandardOutputHandle()
690
/// <returns>A <see cref="
SafeFileHandle
"/> representing the standard error handle.</returns>
697
public static
SafeFileHandle
OpenStandardErrorHandle()
System\ConsolePal.Unix.ConsoleStream.cs (2)
16
private readonly
SafeFileHandle
_handle;
24
internal UnixConsoleStream(
SafeFileHandle
handle, FileAccess access, bool useReadLine = false)
System\ConsolePal.Unix.cs (10)
40
private static
SafeFileHandle
? s_terminalHandle; // Tracks the handle used for writing to the terminal.
62
public static
SafeFileHandle
OpenStandardInputHandle() => OpenStandardHandle(0);
64
public static
SafeFileHandle
OpenStandardOutputHandle() => OpenStandardHandle(1);
66
public static
SafeFileHandle
OpenStandardErrorHandle() => OpenStandardHandle(2);
68
private static
SafeFileHandle
OpenStandardHandle(IntPtr fd) => new SafeFileHandle(fd, ownsHandle: false);
946
private static unsafe int Read(
SafeFileHandle
fd, Span<byte> buffer)
956
internal static void WriteToTerminal(ReadOnlySpan<byte> buffer,
SafeFileHandle
? handle = null, bool mayChangeCursorPosition = true)
967
internal static unsafe void WriteFromConsoleStream(
SafeFileHandle
fd, ReadOnlySpan<byte> buffer)
981
private static unsafe void Write(
SafeFileHandle
fd, ReadOnlySpan<byte> buffer, bool mayChangeCursorPosition = true)
1125
internal static void WriteTerminalAnsiString(string? value,
SafeFileHandle
? handle = null, bool mayChangeCursorPosition = true)
System\TermInfo.DatabaseFactory.cs (2)
85
private static bool TryOpen(string filePath, [NotNullWhen(true)] out
SafeFileHandle
? fd)
111
SafeFileHandle
? fd;
System.Data.Odbc (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Diagnostics.FileVersionInfo (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Diagnostics.Process (10)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
src\libraries\Common\src\Interop\Unix\System.Native\Interop.InitializeTerminalAndSignalHandling.cs (1)
16
internal static partial void SetKeypadXmit(
SafeFileHandle
terminalHandle, string terminfoString);
System.DirectoryServices.Protocols (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Formats.Tar (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.IO.Compression (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.IO.Compression.Brotli (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.IO.Compression.ZipFile (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.IO.FileSystem (1)
System.IO.FileSystem.cs (1)
4
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.
SafeFileHandle
))]
System.IO.FileSystem.DriveInfo (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.IO.FileSystem.Primitives (1)
System.IO.FileSystem.Primitives.cs (1)
4
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.
SafeFileHandle
))]
System.IO.FileSystem.Watcher (16)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
src\libraries\Common\src\Interop\Linux\System.Native\Interop.INotify.cs (4)
14
internal static partial
SafeFileHandle
INotifyInit();
17
internal static partial int INotifyAddWatch(
SafeFileHandle
fd, string pathName, uint mask);
20
private static partial int INotifyRemoveWatch_private(
SafeFileHandle
fd, int wd);
22
internal static int INotifyRemoveWatch(
SafeFileHandle
fd, int wd)
System\IO\FileSystemWatcher.Linux.cs (3)
133
private readonly
SafeFileHandle
_inotifyHandle;
146
static
SafeFileHandle
CreateINotifyHandle()
148
SafeFileHandle
handle = Interop.Sys.INotifyInit();
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (1)
341
public override
SafeFileHandle
SafeFileHandle
System.IO.MemoryMappedFiles (34)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
Microsoft\Win32\SafeMemoryMappedFileHandle.Unix.cs (2)
14
internal
SafeFileHandle
? _fileStreamHandle;
39
SafeFileHandle
? fileHandle, bool ownsFileHandle, HandleInheritability inheritability,
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FTruncate.cs (1)
12
internal static partial int FTruncate(
SafeFileHandle
fd, long length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.MemfdCreate.cs (1)
13
internal static partial
SafeFileHandle
MemfdCreate(string name, int isReadonly);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.MMap.cs (1)
35
SafeFileHandle
fd, long offset);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.Open.cs (1)
12
internal static partial
SafeFileHandle
Open(string filename, OpenFlags flags, int mode);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ShmOpen.cs (1)
12
internal static partial
SafeFileHandle
ShmOpen(string name, OpenFlags flags, int mode);
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (8)
14
private readonly
SafeFileHandle
? _fileHandle;
28
private MemoryMappedFile(SafeMemoryMappedFileHandle handle,
SafeFileHandle
fileHandle, bool leaveOpen)
127
SafeFileHandle
fileHandle = File.OpenHandle(path, mode, GetFileAccess(access), FileShare.Read, FileOptions.None);
171
/// Creates a memory-mapped file from an existing file using a <see cref="
SafeFileHandle
"/>,
174
/// <param name="fileHandle">The <see cref="
SafeFileHandle
"/> to the existing file. Caller is
208
public static MemoryMappedFile CreateFromFile(
SafeFileHandle
fileHandle, string? mapName, long capacity,
263
SafeFileHandle
fileHandle = fileStream.SafeFileHandle; // access the property only once (it might perform a sys-call)
506
private static void CleanupFile(
SafeFileHandle
fileHandle, bool existed, string path)
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (9)
13
private static void VerifyMemoryMappedFileAccess(MemoryMappedFileAccess access, long capacity,
SafeFileHandle
? fileHandle, long fileSize, out bool isRegularFile)
44
SafeFileHandle
? fileHandle, string? mapName,
157
private static
SafeFileHandle
CreateSharedBackingObject(Interop.Sys.MemoryMappedProtections protections, long capacity, HandleInheritability inheritability)
165
private static
SafeFileHandle
? CreateSharedBackingObjectUsingMemoryShmOpen(
184
SafeFileHandle
fd;
267
private static
SafeFileHandle
CreateSharedBackingObjectUsingMemoryMemfdCreate(
273
SafeFileHandle
fd = Interop.Sys.MemfdCreate(GenerateMapName(), isReadonly);
306
private static
SafeFileHandle
CreateSharedBackingObjectUsingFile(Interop.Sys.MemoryMappedProtections protections, long capacity, HandleInheritability inheritability)
318
SafeFileHandle
fileHandle = File.OpenHandle(path, FileMode.CreateNew, TranslateProtectionsToFileAccess(protections), share);
System\IO\MemoryMappedFiles\MemoryMappedView.Unix.cs (1)
52
SafeFileHandle
fd;
System.IO.Pipes (11)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FLock.cs (1)
21
internal static partial int FLock(
SafeFileHandle
fd, LockOperations operation);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.Open.cs (1)
12
internal static partial
SafeFileHandle
Open(string filename, OpenFlags flags, int mode);
System.IO.Ports (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Net.NameResolution (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Net.NetworkInformation (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Net.Ping (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Net.Primitives (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Net.Quic (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Net.Security (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Net.Sockets (24)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System\Net\Sockets\Socket.cs (1)
4004
private static
SafeFileHandle
? OpenFileHandle(string? name) => string.IsNullOrEmpty(name) ? null : File.OpenHandle(name, FileMode.Open, FileAccess.Read);
System\Net\Sockets\Socket.Unix.cs (1)
209
using (
SafeFileHandle
? fileHandle = OpenFileHandle(fileName))
System\Net\Sockets\SocketAsyncContext.Unix.cs (3)
691
public
SafeFileHandle
FileHandle = null!; // always set when constructed
2128
public SocketError SendFile(
SafeFileHandle
fileHandle, long offset, long count, int timeout, out long bytesSent)
2158
public SocketError SendFileAsync(
SafeFileHandle
fileHandle, long offset, long count, out long bytesSent, Action<long, SocketError> callback, CancellationToken cancellationToken = default)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (3)
248
SafeFileHandle
[] fileHandles = new
SafeFileHandle
[elements.Length];
266
foreach (
SafeFileHandle
s in fileHandles)
System\Net\Sockets\SocketPal.Unix.cs (7)
371
private static long SendFile(SafeSocketHandle socket,
SafeFileHandle
fileHandle, ref long offset, ref long count, out Interop.Error errno)
1036
public static bool TryCompleteSendFile(SafeSocketHandle socket,
SafeFileHandle
handle, ref long offset, ref long count, ref long bytesSent, out SocketError errorCode)
1220
public static SocketError SendFile(SafeSocketHandle handle,
SafeFileHandle
fileHandle)
2070
private static SocketError SendFileAsync(SafeSocketHandle handle,
SafeFileHandle
fileHandle, long offset, long count, CancellationToken cancellationToken, Action<long, SocketError> callback)
2082
Socket socket, TransmitFileOptions options, SendPacketsElement[] elements,
SafeFileHandle
[] fileHandles, CancellationToken cancellationToken, Action<long, SocketError> callback)
2100
SafeFileHandle
fileHandle = fileHandles[i] ?? e.FileStream!.SafeFileHandle;
2140
foreach (
SafeFileHandle
fs in fileHandles)
System.Private.CoreLib (205)
LibraryImports.g.cs (27)
5693
internal static partial int FChMod(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, int mode)
5699
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
5975
internal static partial int CopyFile(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
source, global::Microsoft.Win32.SafeHandles.
SafeFileHandle
destination, long sourceLength)
5982
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __destination_native__marshaller = new();
5983
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __source_native__marshaller = new();
6149
internal static partial bool FileSystemSupportsLocking(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations lockOperation, bool accessWrite)
6156
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
6189
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
6195
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
6250
internal static partial int FSync(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd)
6256
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
6288
internal static partial int FTruncate(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, long length)
6294
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
6879
internal static partial long LSeek(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, long offset, global::Interop.Sys.SeekWhence whence)
6885
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
7057
internal static partial nint MMap(nint addr, ulong len, global::Interop.Sys.MemoryMappedProtections prot, global::Interop.Sys.MemoryMappedFlags flags, global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, long offset)
7063
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
7149
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
7154
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
7157
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
7240
internal static partial int PosixFAdvise(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, long offset, long length, global::Interop.Sys.FileAdvice advice)
7245
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
7274
internal static partial int FAllocate(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, long offset, long length)
7280
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
8429
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
8435
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
src\libraries\Common\src\Interop\Unix\System.Native\Interop.CopyFile.cs (2)
13
internal static partial int CopyFile(
SafeFileHandle
source,
SafeFileHandle
destination, long sourceLength);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FAllocate.cs (1)
15
internal static partial int FAllocate(
SafeFileHandle
fd, long offset, long length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FChMod.cs (1)
13
internal static partial int FChMod(
SafeFileHandle
fd, int mode);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FileSystemSupportsLocking.cs (1)
13
internal static partial bool FileSystemSupportsLocking(
SafeFileHandle
fd, LockOperations lockOperation, [MarshalAs(UnmanagedType.Bool)] bool accessWrite);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FLock.cs (1)
21
internal static partial int FLock(
SafeFileHandle
fd, LockOperations operation);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FSync.cs (1)
12
internal static partial int FSync(
SafeFileHandle
fd);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.FTruncate.cs (1)
12
internal static partial int FTruncate(
SafeFileHandle
fd, long length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.InitializeTerminalAndSignalHandling.cs (1)
16
internal static partial void SetKeypadXmit(
SafeFileHandle
terminalHandle, string terminfoString);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.LSeek.cs (1)
19
internal static partial long LSeek(
SafeFileHandle
fd, long offset, SeekWhence whence);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.MMap.cs (1)
35
SafeFileHandle
fd, long offset);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.Open.cs (1)
12
internal static partial
SafeFileHandle
Open(string filename, OpenFlags flags, int mode);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.PosixFAdvise.cs (1)
33
internal static partial int PosixFAdvise(
SafeFileHandle
fd, long offset, long length, FileAdvice advice);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.cs (2)
29
public static partial void CreateAnonymousPipe(out
SafeFileHandle
readHandle, out
SafeFileHandle
writeHandle, bool asyncRead = false, bool asyncWrite = false);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (2)
32
private readonly
SafeFileHandle
_fileHandle;
47
internal ThreadPoolValueTaskSource(
SafeFileHandle
fileHandle)
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (12)
110
private static
SafeFileHandle
Open(string path, Interop.Sys.OpenFlags flags, int mode, bool failForSymlink, out bool wasSymlink,
115
SafeFileHandle
handle = Interop.Sys.Open(path, flags, mode);
183
public static partial void CreateAnonymousPipe(out
SafeFileHandle
readHandle, out
SafeFileHandle
writeHandle, bool asyncRead, bool asyncWrite)
186
SafeFileHandle
tempReadHandle = new();
187
SafeFileHandle
tempWriteHandle = new();
228
internal static
SafeFileHandle
OpenReadOnly(string fullPath, FileOptions options, out long fileLength, out UnixFileMode filePermissions)
230
SafeFileHandle
handle = Open(fullPath, FileMode.Open, FileAccess.Read, FileShare.Read, options, preallocationSize: 0, DefaultCreateMode, out fileLength, out filePermissions, false, out _, null);
235
internal static
SafeFileHandle
Open(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize, UnixFileMode? unixCreateMode = null,
241
internal static
SafeFileHandle
? OpenNoFollowSymlink(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize, out bool wasSymlink, UnixFileMode? unixCreateMode = null,
247
private static
SafeFileHandle
Open(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize, UnixFileMode openPermissions,
254
SafeFileHandle
? safeFileHandle = null;
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (50)
136
/// Initializes a new instance of the <see cref="
SafeFileHandle
" /> class with the specified path, creation mode, read/write and sharing permission, the access other SafeFileHandles can have to the same file, additional file options and the allocation size.
138
/// <param name="path">A relative or absolute path for the file that the current <see cref="
SafeFileHandle
" /> instance will encapsulate.</param>
144
/// <param name="options">An object that describes optional <see cref="
SafeFileHandle
" /> parameters to use.</param>
165
public static
SafeFileHandle
OpenHandle(string path, FileMode mode = FileMode.Open, FileAccess access = FileAccess.Read,
170
return
SafeFileHandle
.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize);
176
/// <returns>A <see cref="
SafeFileHandle
"/> to the system's null device.</returns>
194
public static
SafeFileHandle
OpenNullHandle()
196
return
SafeFileHandle
.Open(NullDevicePath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, FileOptions.None, preallocationSize: 0);
216
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to set the creation date and time information.
234
public static void SetCreationTime(
SafeFileHandle
fileHandle, DateTime creationTime)
248
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to set the creation date and time information.
266
public static void SetCreationTimeUtc(
SafeFileHandle
fileHandle, DateTime creationTimeUtc)
279
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to obtain creation date and time information.
291
public static DateTime GetCreationTime(
SafeFileHandle
fileHandle)
304
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to obtain creation date and time information.
316
public static DateTime GetCreationTimeUtc(
SafeFileHandle
fileHandle)
329
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to set the last access date and time information.
347
public static void SetLastAccessTime(
SafeFileHandle
fileHandle, DateTime lastAccessTime)
360
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to set the last access date and time information.
378
public static void SetLastAccessTimeUtc(
SafeFileHandle
fileHandle, DateTime lastAccessTimeUtc)
391
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to obtain last access date and time information.
403
public static DateTime GetLastAccessTime(
SafeFileHandle
fileHandle)
416
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to obtain last access date and time information.
428
public static DateTime GetLastAccessTimeUtc(
SafeFileHandle
fileHandle)
441
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to set the last write date and time information.
459
public static void SetLastWriteTime(
SafeFileHandle
fileHandle, DateTime lastWriteTime)
472
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to set the last write date and time information.
490
public static void SetLastWriteTimeUtc(
SafeFileHandle
fileHandle, DateTime lastWriteTimeUtc)
503
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to obtain last write date and time information.
515
public static DateTime GetLastWriteTime(
SafeFileHandle
fileHandle)
528
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which to obtain last write date and time information.
540
public static DateTime GetLastWriteTimeUtc(
SafeFileHandle
fileHandle)
553
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which the attributes are to be retrieved.
564
public static FileAttributes GetAttributes(
SafeFileHandle
fileHandle)
577
/// A <see cref="
SafeFileHandle
" /> to the file or directory for which <paramref name="fileAttributes"/> should be set.
590
/// using the <see cref="SetAttributes(
SafeFileHandle
, FileAttributes)"/> method.
592
public static void SetAttributes(
SafeFileHandle
fileHandle, FileAttributes fileAttributes)
616
public static UnixFileMode GetUnixFileMode(
SafeFileHandle
fileHandle)
640
public static void SetUnixFileMode(
SafeFileHandle
fileHandle, UnixFileMode mode)
724
using (
SafeFileHandle
sfh = OpenHandle(path, FileMode.Open, FileAccess.Read, FileShare.Read, options))
788
using
SafeFileHandle
sfh = OpenHandle(path, FileMode.Create, FileAccess.Write, FileShare.Read);
838
using
SafeFileHandle
fileHandle = OpenHandle(path, FileMode.Append, FileAccess.Write, FileShare.Read);
883
using
SafeFileHandle
fileHandle = OpenHandle(path, FileMode.Append, FileAccess.Write, FileShare.Read, FileOptions.Asynchronous);
1203
SafeFileHandle
sfh = OpenHandle(path, FileMode.Open, FileAccess.Read, FileShare.Read, options);
1223
private static async Task<byte[]> InternalReadAllBytesAsync(
SafeFileHandle
sfh, int count, CancellationToken cancellationToken)
1244
private static async Task<byte[]> InternalReadAllBytesUnknownLengthAsync(
SafeFileHandle
sfh, CancellationToken cancellationToken)
1312
using
SafeFileHandle
sfh = OpenHandle(path, FileMode.Create, FileAccess.Write, FileShare.Read, FileOptions.Asynchronous);
1508
private static byte[] ReadAllBytesUnknownLength(
SafeFileHandle
sfh)
1558
using
SafeFileHandle
fileHandle = OpenHandle(path, mode, FileAccess.Write, FileShare.Read, FileOptions.None, GetPreallocationSize(mode, contents, encoding, preambleSize));
1614
using
SafeFileHandle
fileHandle = OpenHandle(path, mode, FileAccess.Write, FileShare.Read, FileOptions.Asynchronous, GetPreallocationSize(mode, contents.Span, encoding, preambleSize));
src\libraries\System.Private.CoreLib\src\System\IO\File.Unix.cs (2)
15
private static UnixFileMode GetUnixFileModeCore(
SafeFileHandle
fileHandle)
21
private static void SetUnixFileModeCore(
SafeFileHandle
fileHandle, UnixFileMode mode)
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.SetTimes.OtherUnix.cs (3)
14
internal void SetCreationTime(
SafeFileHandle
handle, DateTimeOffset time, bool asDirectory) =>
17
private void SetAccessOrWriteTime(
SafeFileHandle
? handle, string? path, DateTimeOffset time, bool isAccessTime, bool asDirectory) =>
22
private static Interop.Error SetCreationTimeCore(
SafeFileHandle
? handle, string? path, long seconds, long nanoseconds) =>
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (21)
190
internal FileAttributes GetAttributes(
SafeFileHandle
handle, bool continueOnError = false)
193
private FileAttributes GetAttributes(
SafeFileHandle
? handle, ReadOnlySpan<char> path, ReadOnlySpan<char> fileName, bool continueOnError = false)
221
internal void SetAttributes(
SafeFileHandle
handle, FileAttributes attributes, bool asDirectory)
224
private void SetAttributes(
SafeFileHandle
? handle, string? path, FileAttributes attributes, bool asDirectory)
294
internal DateTimeOffset GetCreationTime(
SafeFileHandle
handle, bool continueOnError = false)
297
private DateTimeOffset GetCreationTime(
SafeFileHandle
? handle, ReadOnlySpan<char> path, bool continueOnError = false)
318
internal DateTimeOffset GetLastAccessTime(
SafeFileHandle
handle, bool continueOnError = false)
321
private DateTimeOffset GetLastAccessTime(
SafeFileHandle
? handle, ReadOnlySpan<char> path, bool continueOnError = false)
334
internal void SetLastAccessTime(
SafeFileHandle
handle, DateTimeOffset time, bool asDirectory)
337
private void SetLastAccessTime(
SafeFileHandle
? handle, string? path, DateTimeOffset time, bool asDirectory)
343
internal DateTimeOffset GetLastWriteTime(
SafeFileHandle
handle, bool continueOnError = false)
346
private DateTimeOffset GetLastWriteTime(
SafeFileHandle
? handle, ReadOnlySpan<char> path, bool continueOnError = false)
359
internal void SetLastWriteTime(
SafeFileHandle
handle, DateTimeOffset time, bool asDirectory)
362
internal void SetLastWriteTime(
SafeFileHandle
? handle, string? path, DateTimeOffset time, bool asDirectory)
370
private unsafe void SetAccessOrWriteTimeCore(
SafeFileHandle
? handle, string? path, DateTimeOffset time, bool isAccessTime, bool checkCreationTime, bool asDirectory)
458
internal UnixFileMode GetUnixFileMode(
SafeFileHandle
handle, bool continueOnError = false)
461
private UnixFileMode GetUnixFileMode(
SafeFileHandle
? handle, ReadOnlySpan<char> path, bool continueOnError = false)
474
internal void SetUnixFileMode(
SafeFileHandle
handle, UnixFileMode mode)
477
private void SetUnixFileMode(
SafeFileHandle
? handle, string? path, UnixFileMode mode)
498
internal void RefreshCaches(
SafeFileHandle
? handle, ReadOnlySpan<char> path)
558
internal void EnsureCachesInitialized(
SafeFileHandle
? handle, ReadOnlySpan<char> path, bool continueOnError = false)
src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (6)
46
SafeFileHandle
safeHandle = new SafeFileHandle(handle, ownsHandle: ownsHandle);
67
private static void ValidateHandle(
SafeFileHandle
handle, FileAccess access, int bufferSize)
87
public FileStream(
SafeFileHandle
handle, FileAccess access)
92
public FileStream(
SafeFileHandle
handle, FileAccess access, int bufferSize)
99
public FileStream(
SafeFileHandle
handle, FileAccess access, int bufferSize, bool isAsync)
428
public virtual
SafeFileHandle
SafeFileHandle => _strategy.SafeFileHandle;
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (14)
37
using
SafeFileHandle
src =
SafeFileHandle
.OpenReadOnly(sourceFullPath, FileOptions.None, out fileLength, out filePermissions);
47
using
SafeFileHandle
dst =
SafeFileHandle
.Open(destFullPath, overwrite ? FileMode.Create : FileMode.CreateNew,
592
public static FileAttributes GetAttributes(
SafeFileHandle
fileHandle)
598
public static void SetAttributes(
SafeFileHandle
fileHandle, FileAttributes attributes)
611
public static UnixFileMode GetUnixFileMode(
SafeFileHandle
fileHandle)
617
public static void SetUnixFileMode(
SafeFileHandle
fileHandle, UnixFileMode mode)
623
public static DateTimeOffset GetCreationTime(
SafeFileHandle
fileHandle)
629
public static void SetCreationTime(
SafeFileHandle
fileHandle, DateTimeOffset time)
635
public static DateTimeOffset GetLastAccessTime(
SafeFileHandle
fileHandle)
641
public static unsafe void SetLastAccessTime(
SafeFileHandle
fileHandle, DateTimeOffset time)
647
public static DateTimeOffset GetLastWriteTime(
SafeFileHandle
fileHandle)
653
public static unsafe void SetLastWriteTime(
SafeFileHandle
fileHandle, DateTimeOffset time)
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.cs (12)
23
public static long GetLength(
SafeFileHandle
handle)
40
public static void SetLength(
SafeFileHandle
handle, long length)
67
public static int Read(
SafeFileHandle
handle, Span<byte> buffer, long fileOffset)
89
public static long Read(
SafeFileHandle
handle, IReadOnlyList<Memory<byte>> buffers, long fileOffset)
113
public static ValueTask<int> ReadAsync(
SafeFileHandle
handle, Memory<byte> buffer, long fileOffset, CancellationToken cancellationToken = default)
141
public static ValueTask<long> ReadAsync(
SafeFileHandle
handle, IReadOnlyList<Memory<byte>> buffers, long fileOffset, CancellationToken cancellationToken = default)
168
public static void Write(
SafeFileHandle
handle, ReadOnlySpan<byte> buffer, long fileOffset)
189
public static void Write(
SafeFileHandle
handle, IReadOnlyList<ReadOnlyMemory<byte>> buffers, long fileOffset)
213
public static ValueTask WriteAsync(
SafeFileHandle
handle, ReadOnlyMemory<byte> buffer, long fileOffset, CancellationToken cancellationToken = default)
241
public static ValueTask WriteAsync(
SafeFileHandle
handle, IReadOnlyList<ReadOnlyMemory<byte>> buffers, long fileOffset, CancellationToken cancellationToken = default)
272
public static void FlushToDisk(
SafeFileHandle
handle)
284
private static void ValidateInput(
SafeFileHandle
handle, long fileOffset, bool allowUnseekableHandles = false)
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (9)
22
internal static unsafe void SetFileLength(
SafeFileHandle
handle, long length) =>
25
internal static unsafe int ReadAtOffset(
SafeFileHandle
handle, Span<byte> buffer, long fileOffset)
65
internal static unsafe long ReadScatterAtOffset(
SafeFileHandle
handle, IReadOnlyList<Memory<byte>> buffers, long fileOffset)
98
internal static ValueTask<int> ReadAtOffsetAsync(
SafeFileHandle
handle, Memory<byte> buffer, long fileOffset, CancellationToken cancellationToken, OSFileStreamStrategy? strategy = null)
101
private static ValueTask<long> ReadScatterAtOffsetAsync(
SafeFileHandle
handle, IReadOnlyList<Memory<byte>> buffers, long fileOffset, CancellationToken cancellationToken)
104
internal static unsafe void WriteAtOffset(
SafeFileHandle
handle, ReadOnlySpan<byte> buffer, long fileOffset)
169
internal static unsafe void WriteGatherAtOffset(
SafeFileHandle
handle, IReadOnlyList<ReadOnlyMemory<byte>> buffers, long fileOffset)
251
internal static ValueTask WriteAtOffsetAsync(
SafeFileHandle
handle, ReadOnlyMemory<byte> buffer, long fileOffset, CancellationToken cancellationToken, OSFileStreamStrategy? strategy = null)
254
private static ValueTask WriteGatherAtOffsetAsync(
SafeFileHandle
handle, IReadOnlyList<ReadOnlyMemory<byte>> buffers, long fileOffset, CancellationToken cancellationToken)
src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (14)
125
private readonly
SafeFileHandle
_fileHandle;
130
public SharedMemoryProcessDataHeader(SharedMemoryId id,
SafeFileHandle
fileHandle, SharedMemorySharedDataHeader* sharedDataHeader, nuint sharedDataTotalByteCount)
194
SafeFileHandle
fileHandle = SharedMemoryHelpers.CreateOrOpenFile(sharedMemoryFilePath, id, createIfNotExist, out bool createdFile);
419
internal static
SafeFileHandle
CreateOrOpenFile(string sharedMemoryFilePath, SharedMemoryId id, bool createIfNotExist, out bool createdFile)
421
SafeFileHandle
fd = Interop.Sys.Open(sharedMemoryFilePath, Interop.Sys.OpenFlags.O_RDWR | Interop.Sys.OpenFlags.O_CLOEXEC, 0);
649
internal static MemoryMappedFileHolder MemoryMapFile(
SafeFileHandle
fileHandle, nuint sharedDataTotalByteCount)
668
internal static bool TryAcquireFileLock(
SafeFileHandle
sharedLockFileHandle, bool nonBlocking, bool exclusive = true)
712
internal unsafe ref struct AutoReleaseFileLock(
SafeFileHandle
fd)
716
public readonly
SafeFileHandle
FileHandle = fd;
740
private
SafeFileHandle
? _creationDeletionLockFileHandle;
741
private readonly Dictionary<uint,
SafeFileHandle
> _uidToFileHandleMap = [];
756
SafeFileHandle
? fd = id.IsUserScope ? GetUserScopeCreationDeletionLockFileHandle(id.Uid) : _creationDeletionLockFileHandle;
798
SafeFileHandle
? GetUserScopeCreationDeletionLockFileHandle(uint uid)
800
_uidToFileHandleMap.TryGetValue(uid, out
SafeFileHandle
? fileHandle);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (1)
78
internal override
SafeFileHandle
SafeFileHandle
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\DerivedFileStreamStrategy.cs (1)
45
internal override
SafeFileHandle
SafeFileHandle
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\FileStreamHelpers.cs (1)
19
internal static FileStreamStrategy ChooseStrategy(FileStream fileStream,
SafeFileHandle
handle, FileAccess access, int bufferSize, bool isAsync)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\FileStreamHelpers.Unix.cs (6)
12
private static UnixFileStreamStrategy ChooseStrategyCore(
SafeFileHandle
handle, FileAccess access, bool isAsync) =>
33
internal static long Seek(
SafeFileHandle
handle, long offset, SeekOrigin origin) =>
36
internal static void ThrowInvalidArgument(
SafeFileHandle
handle) =>
40
internal static void FlushToDisk(
SafeFileHandle
handle)
59
internal static void Lock(
SafeFileHandle
handle, bool canWrite, long position, long length)
69
internal static void Unlock(
SafeFileHandle
handle, long position, long length)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\FileStreamStrategy.cs (1)
16
internal abstract
SafeFileHandle
SafeFileHandle { get; }
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (4)
14
protected readonly
SafeFileHandle
_fileHandle; // only ever null if ctor throws
20
internal OSFileStreamStrategy(
SafeFileHandle
handle, FileAccess access)
46
_fileHandle =
SafeFileHandle
.Open(fullPath, mode, access, share, options, preallocationSize, unixCreateMode);
96
internal override
SafeFileHandle
SafeFileHandle
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\UnixFileStreamStrategy.cs (2)
10
internal UnixFileStreamStrategy(
SafeFileHandle
handle, FileAccess access) : base(handle, access)
19
internal override
SafeFileHandle
SafeFileHandle
src\libraries\System.Private.CoreLib\src\System\Threading\NamedMutex.Unix.cs (1)
395
private readonly
SafeFileHandle
_sharedLockFileHandle;
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (1)
268
using (
SafeFileHandle
sfh = File.OpenHandle(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net11.0\System.Runtime.Forwards.cs (1)
5
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Win32.SafeHandles.
SafeFileHandle
))]
System.Security.Cryptography (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
System.Security.Cryptography.ProtectedData (9)
LibraryImports.g.cs (9)
54
internal static partial int FLock(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
fd, global::Interop.Sys.LockOperations operation)
60
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __fd_native__marshaller = new();
157
internal static partial global::Microsoft.Win32.SafeHandles.
SafeFileHandle
Open(string filename, global::Interop.Sys.OpenFlags flags, int mode)
162
global::Microsoft.Win32.SafeHandles.
SafeFileHandle
__retVal = default;
165
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
688
internal static partial int GetWindowSize(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, out global::Interop.Sys.WinSize winSize)
695
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
755
internal static partial void SetKeypadXmit(global::Microsoft.Win32.SafeHandles.
SafeFileHandle
terminalHandle, string terminfoString)
761
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.
SafeFileHandle
>.ManagedToUnmanagedIn __terminalHandle_native__marshaller = new();
vbc (3)
src\Compilers\Shared\NativeMethods.cs (3)
120
using
var
handle = CreateFileW(
170
private static extern
SafeFileHandle
CreateFileW(
182
SafeFileHandle
hFile,
VBCSCompiler (3)
src\Compilers\Shared\NativeMethods.cs (3)
120
using
var
handle = CreateFileW(
170
private static extern
SafeFileHandle
CreateFileW(
182
SafeFileHandle
hFile,