86 references to Interop
System.IO.FileSystem.AccessControl (86)
_generated\0\LibraryImports.g.cs (16)
7
private static unsafe partial global::Microsoft.Win32.SafeHandles.SafeFileHandle CreateFilePrivate(string lpFileName, int dwDesiredAccess, global::System.IO.FileShare dwShareMode, global::
Interop
.Kernel32.SECURITY_ATTRIBUTES* lpSecurityAttributes, global::System.IO.FileMode dwCreationDisposition, int dwFlagsAndAttributes, nint hTemplateFile)
44
static extern unsafe nint __PInvoke(ushort* __lpFileName_native, int __dwDesiredAccess_native, global::System.IO.FileShare __dwShareMode_native, global::
Interop
.Kernel32.SECURITY_ATTRIBUTES* __lpSecurityAttributes_native, global::System.IO.FileMode __dwCreationDisposition_native, int __dwFlagsAndAttributes_native, nint __hTemplateFile_native);
79
private static partial global::Microsoft.Win32.SafeHandles.SafeFindHandle FindFirstFileExPrivate(string lpFileName, global::
Interop
.Kernel32.FINDEX_INFO_LEVELS fInfoLevelId, ref global::
Interop
.Kernel32.WIN32_FIND_DATA lpFindFileData, global::
Interop
.Kernel32.FINDEX_SEARCH_OPS fSearchOp, nint lpSearchFilter, int dwAdditionalFlags)
90
fixed (global::
Interop
.Kernel32.WIN32_FIND_DATA* __lpFindFileData_native = &lpFindFileData)
117
static extern unsafe nint __PInvoke(ushort* __lpFileName_native, global::
Interop
.Kernel32.FINDEX_INFO_LEVELS __fInfoLevelId_native, global::
Interop
.Kernel32.WIN32_FIND_DATA* __lpFindFileData_native, global::
Interop
.Kernel32.FINDEX_SEARCH_OPS __fSearchOp_native, nint __lpSearchFilter_native, int __dwAdditionalFlags_native);
149
private static partial bool GetFileAttributesExPrivate(string name, global::
Interop
.Kernel32.GET_FILEEX_INFO_LEVELS fileInfoLevel, ref global::
Interop
.Kernel32.WIN32_FILE_ATTRIBUTE_DATA lpFileInformation)
155
fixed (global::
Interop
.Kernel32.WIN32_FILE_ATTRIBUTE_DATA* __lpFileInformation_native = &lpFileInformation)
169
static extern unsafe int __PInvoke(ushort* __name_native, global::
Interop
.Kernel32.GET_FILEEX_INFO_LEVELS __fileInfoLevel_native, global::
Interop
.Kernel32.WIN32_FILE_ATTRIBUTE_DATA* __lpFileInformation_native);
260
private static unsafe partial bool CreateDirectoryPrivate(string path, global::
Interop
.Kernel32.SECURITY_ATTRIBUTES* lpSecurityAttributes)
279
static extern unsafe int __PInvoke(ushort* __path_native, global::
Interop
.Kernel32.SECURITY_ATTRIBUTES* __lpSecurityAttributes_native);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeFindHandle.Windows.cs (1)
15
return
Interop
.Kernel32.FindClose(handle);
src\runtime\src\libraries\Common\src\System\IO\FileSystem.Attributes.Windows.cs (32)
23
Interop
.Kernel32.WIN32_FILE_ATTRIBUTE_DATA data = default;
29
((data.dwFileAttributes &
Interop
.Kernel32.FileAttributes.FILE_ATTRIBUTE_DIRECTORY) != 0);
34
Interop
.Kernel32.WIN32_FILE_ATTRIBUTE_DATA data = default;
40
((data.dwFileAttributes &
Interop
.Kernel32.FileAttributes.FILE_ATTRIBUTE_DIRECTORY) == 0);
50
internal static int FillAttributeInfo(string? path, ref
Interop
.Kernel32.WIN32_FILE_ATTRIBUTE_DATA data, bool returnErrorOnNotFound)
52
int errorCode =
Interop
.Errors.ERROR_SUCCESS;
59
if (!
Interop
.Kernel32.GetFileAttributesEx(path,
Interop
.Kernel32.GET_FILEEX_INFO_LEVELS.GetFileExInfoStandard, ref data))
66
Debug.Assert(errorCode ==
Interop
.Errors.ERROR_ACCESS_DENIED || errorCode ==
Interop
.Errors.ERROR_SHARING_VIOLATION || errorCode ==
Interop
.Errors.ERROR_SEM_TIMEOUT,
82
Interop
.Kernel32.WIN32_FIND_DATA findData = default;
83
using (SafeFindHandle handle =
Interop
.Kernel32.FindFirstFile(path!, ref findData))
91
errorCode =
Interop
.Errors.ERROR_SUCCESS;
99
if (errorCode !=
Interop
.Errors.ERROR_SUCCESS && !returnErrorOnNotFound)
103
case
Interop
.Errors.ERROR_FILE_NOT_FOUND:
104
case
Interop
.Errors.ERROR_PATH_NOT_FOUND:
105
case
Interop
.Errors.ERROR_NOT_READY: // Removable media not ready
108
return
Interop
.Errors.ERROR_SUCCESS;
117
Interop
.Errors.ERROR_FILE_NOT_FOUND or
118
Interop
.Errors.ERROR_PATH_NOT_FOUND or
119
Interop
.Errors.ERROR_NOT_READY or
120
Interop
.Errors.ERROR_INVALID_NAME or
121
Interop
.Errors.ERROR_BAD_PATHNAME or
122
Interop
.Errors.ERROR_BAD_NETPATH or
123
Interop
.Errors.ERROR_BAD_NET_NAME or
124
Interop
.Errors.ERROR_NETNAME_DELETED or
125
Interop
.Errors.ERROR_INVALID_PARAMETER or
126
Interop
.Errors.ERROR_NETWORK_UNREACHABLE or
127
Interop
.Errors.ERROR_NETWORK_ACCESS_DENIED or
128
Interop
.Errors.ERROR_INVALID_HANDLE or // eg from \\.\CON
129
Interop
.Errors.ERROR_FILENAME_EXCED_RANGE; // Path is too long
src\runtime\src\libraries\Common\src\System\IO\FileSystem.DirectoryCreation.Windows.cs (6)
80
Interop
.Kernel32.SECURITY_ATTRIBUTES secAttrs =
Interop
.Kernel32.SECURITY_ATTRIBUTES.Create(pSecurityDescriptor);
87
r =
Interop
.Kernel32.CreateDirectory(name, &secAttrs);
99
if (currentError !=
Interop
.Errors.ERROR_ALREADY_EXISTS)
106
if (FileExists(name) || (!DirectoryExists(name, out currentError) && currentError ==
Interop
.Errors.ERROR_ACCESS_DENIED))
124
throw Win32Marshal.GetExceptionForWin32Error(
Interop
.Errors.ERROR_PATH_NOT_FOUND, root);
src\runtime\src\libraries\Common\src\System\IO\Win32Marshal.cs (10)
29
Debug.Assert(errorCode !=
Interop
.Errors.ERROR_SUCCESS);
33
case
Interop
.Errors.ERROR_FILE_NOT_FOUND:
36
case
Interop
.Errors.ERROR_PATH_NOT_FOUND:
44
case
Interop
.Errors.ERROR_ACCESS_DENIED:
47
case
Interop
.Errors.ERROR_ALREADY_EXISTS:
51
case
Interop
.Errors.ERROR_FILENAME_EXCED_RANGE:
54
case
Interop
.Errors.ERROR_SHARING_VIOLATION:
58
case
Interop
.Errors.ERROR_FILE_EXISTS:
62
case
Interop
.Errors.ERROR_OPERATION_ABORTED:
64
case
Interop
.Errors.ERROR_INVALID_PARAMETER:
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\DisableMediaInsertionPrompt.cs (3)
24
prompt._disableSuccess =
Interop
.Kernel32.SetThreadErrorMode(
Interop
.Kernel32.SEM_FAILCRITICALERRORS, out prompt._oldMode);
31
Interop
.Kernel32.SetThreadErrorMode(_oldMode, out _);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PathHelper.Windows.cs (5)
78
while ((result =
Interop
.Kernel32.GetFullPathNameW(ref MemoryMarshal.GetReference(path), (uint)builder.Capacity, ref builder.GetPinnableReference(), IntPtr.Zero)) > builder.Capacity)
89
errorCode =
Interop
.Errors.ERROR_BAD_PATHNAME;
181
uint result =
Interop
.Kernel32.GetLongPathNameW(
191
if (error !=
Interop
.Errors.ERROR_FILE_NOT_FOUND && error !=
Interop
.Errors.ERROR_PATH_NOT_FOUND)
System\IO\FileSystemAclExtensions.cs (10)
233
((int)rights &
Interop
.Kernel32.GenericOperations.GENERIC_READ) != 0)
245
((int)rights &
Interop
.Kernel32.GenericOperations.GENERIC_WRITE) != 0)
268
int flagsAndAttributes = (int)options |
Interop
.Kernel32.SecurityOptions.SECURITY_SQOS_PRESENT |
Interop
.Kernel32.SecurityOptions.SECURITY_ANONYMOUS;
272
Interop
.Kernel32.SECURITY_ATTRIBUTES secAttrs =
Interop
.Kernel32.SECURITY_ATTRIBUTES.Create((share & FileShare.Inheritable) != 0);
289
static SafeFileHandle CreateFileHandleInternal(string fullPath, FileMode mode, FileSystemRights rights, FileShare share, int flagsAndAttributes,
Interop
.Kernel32.SECURITY_ATTRIBUTES* secAttrs)
296
handle =
Interop
.Kernel32.CreateFile(fullPath, (int)rights, (share & ~FileShare.Inheritable), secAttrs, mode, flagsAndAttributes, IntPtr.Zero);
314
if (errorCode ==
Interop
.Errors.ERROR_PATH_NOT_FOUND && fullPath.Length == Path.GetPathRoot(fullPath)!.Length)
316
errorCode =
Interop
.Errors.ERROR_ACCESS_DENIED;
System\Security\AccessControl\FileSystemSecurity.cs (3)
36
case
Interop
.Errors.ERROR_INVALID_NAME:
40
case
Interop
.Errors.ERROR_INVALID_HANDLE:
44
case
Interop
.Errors.ERROR_FILE_NOT_FOUND: