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