39 references to NativeMethodsShared
MSBuildTaskHost (39)
AssemblyInfo.cs (1)
4global using NativeMethodsShared = Microsoft.Build.Framework.NativeMethods;
BuildEnvironmentHelper.cs (12)
138if (!NativeMethodsShared.IsWindows) 170if (NativeMethodsShared.IsWindows && 243if (NativeMethodsShared.IsWindows && 373NativeMethodsShared.ProcessorArchitecture == Framework.NativeMethods.ProcessorArchitectures.X64 ? "amd64" : 374NativeMethodsShared.ProcessorArchitecture == Framework.NativeMethods.ProcessorArchitectures.ARM64 ? "arm64" : string.Empty, 582MSBuildToolsDirectoryRoot = NativeMethodsShared.ProcessorArchitecture switch 584NativeMethodsShared.ProcessorArchitectures.X86 => CurrentMSBuildToolsDirectory, 585NativeMethodsShared.ProcessorArchitectures.X64 or NativeMethodsShared.ProcessorArchitectures.ARM64 587_ => throw new InternalErrorException("Unknown processor architecture " + NativeMethodsShared.ProcessorArchitecture),
Concurrent\ConcurrentDictionary.cs (1)
101int concurrencyLevel = NativeMethodsShared.GetLogicalCoreCount();
FileSystem\MSBuildTaskHostFileSystem.cs (3)
23return NativeMethodsShared.FileOrDirectoryExists(path); 38return NativeMethodsShared.DirectoryExists(path); 80return NativeMethodsShared.FileExists(path);
FileUtilities.cs (10)
173if (NativeMethodsShared.GetLastWriteDirectoryUtcTime(directoryPath, out lastModifiedTime)) 505if (NativeMethodsShared.IsWindows) 507string uncheckedFullPath = NativeMethodsShared.GetFullPath(path); 511string message = ResourceUtilities.FormatString(AssemblyResources.GetString("Shared.PathTooLong"), path, NativeMethodsShared.MaxPath); 530if (!NativeMethodsShared.IsWindows || !path.StartsWith(@"\\", StringComparison.Ordinal)) 820if (NativeMethodsShared.IsWindows && !EndsWithSlash(fullPath)) 1274return path.Length >= NativeMethodsShared.MaxPath; 1279bool hasMaxPath = NativeMethodsShared.HasMaxPath; 1280int maxPath = NativeMethodsShared.MaxPath; 1282return hasMaxPath && !IsRootedNoThrow(path) && NativeMethodsShared.GetCurrentDirectory().Length + path.Length + 1 /* slash */ >= maxPath;
Modifiers.cs (1)
265if (NativeMethodsShared.IsWindows)
MSBuildNameIgnoreCaseComparer.cs (6)
25private static readonly NativeMethods.ProcessorArchitectures s_runningProcessorArchitecture = NativeMethods.ProcessorArchitecture; 75if ((s_runningProcessorArchitecture != NativeMethods.ProcessorArchitectures.IA64) 76&& (s_runningProcessorArchitecture != NativeMethods.ProcessorArchitectures.ARM)) 123if ((s_runningProcessorArchitecture != NativeMethods.ProcessorArchitectures.IA64) 124&& (s_runningProcessorArchitecture != NativeMethods.ProcessorArchitectures.ARM))
NamedPipeUtil.cs (1)
25if (NativeMethodsShared.IsUnixLike)
NativeMethods.cs (2)
1194bool success = NativeMethods.GetFileAttributesEx(path, 0, ref data); 1196if (success && (data.fileAttributes & NativeMethods.FILE_ATTRIBUTE_DIRECTORY) == 0)
OutOfProcTaskHostNode.cs (2)
849NativeMethodsShared.SetCurrentDirectory(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory); 931NativeMethodsShared.SetCurrentDirectory(taskConfiguration.StartupDirectory);