57 references to PInvoke
Microsoft.Build (6)
BackEnd\Components\Communications\NodeLauncher.cs (2)
237
PInvoke
.CloseHandle((HANDLE)processInfo.hProcess);
242
PInvoke
.CloseHandle((HANDLE)processInfo.hThread);
Logging\InProcessConsoleConfiguration.cs (4)
38
HANDLE stdOut =
PInvoke
.GetStdHandle(STD_HANDLE.STD_OUTPUT_HANDLE);
39
if (
PInvoke
.GetConsoleMode(stdOut, out CONSOLE_MODE consoleMode))
90
HANDLE stdHandle =
PInvoke
.GetStdHandle(STD_HANDLE.STD_OUTPUT_HANDLE);
94
isScreen =
PInvoke
.GetFileType(stdHandle) == FILE_TYPE.FILE_TYPE_CHAR;
Microsoft.Build.Engine.UnitTests (2)
ConsoleLogger_Tests.cs (2)
1972
HANDLE stdHandle =
PInvoke
.GetStdHandle(STD_HANDLE.STD_OUTPUT_HANDLE);
1977
return
PInvoke
.GetFileType(stdHandle) == FILE_TYPE.FILE_TYPE_CHAR;
Microsoft.Build.Framework (36)
EncodingUtilities.cs (1)
68
s_currentOemEncoding = Encoding.GetEncoding((int)
PInvoke
.GetOEMCP());
FileSystem\WindowsFileSystem.cs (4)
65
uint attrs =
PInvoke
.GetFileAttributes(path);
66
return attrs !=
PInvoke
.INVALID_FILE_ATTRIBUTES
79
public override bool FileOrDirectoryExists(string path) =>
PInvoke
.GetFileAttributes(path) !=
PInvoke
.INVALID_FILE_ATTRIBUTES;
NativeMethods.cs (30)
105
return
PInvoke
.CloseHandle((HANDLE)handle);
156
PInvoke
.GetSystemInfo(out systemInfo);
159
PInvoke
.GetNativeSystemInfo(out systemInfo);
225
if (!
PInvoke
.GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP.RelationProcessorCore, null, ref len) &&
231
if (
PInvoke
.GetLogicalProcessorInformationEx(
687
if (
PInvoke
.GetFileAttributesEx(fullPath, out WIN32_FILE_ATTRIBUTE_DATA data)
724
using BufferScope<char> buffer = new(stackalloc char[(int)
PInvoke
.MAX_PATH]);
725
int length = (int)
PInvoke
.GetShortPathName(path, buffer.AsSpan());
731
length = (int)
PInvoke
.GetShortPathName(path, buffer.AsSpan());
766
using BufferScope<char> buffer = new(stackalloc char[(int)
PInvoke
.MAX_PATH]);
767
int length = (int)
PInvoke
.GetLongPathName(path, buffer.AsSpan());
773
length = (int)
PInvoke
.GetLongPathName(path, buffer.AsSpan());
803
return
PInvoke
.GlobalMemoryStatusEx(ref memoryStatus);
823
symbolicLinkCreated =
PInvoke
.CreateSymbolicLink(newFileName, existingFileName, flags);
883
bool success =
PInvoke
.GetFileAttributesEx(path, out WIN32_FILE_ATTRIBUTE_DATA data);
916
HANDLE h =
PInvoke
.CreateFile(
946
if (
PInvoke
.GetFileTime((HANDLE)handle.DangerousGetHandle(), &ftCreationTime, &ftLastAccessTime, &ftLastWriteTime))
1204
return
PInvoke
.SetCurrentDirectory(path);
1224
using BufferScope<char> buffer = new(stackalloc char[(int)
PInvoke
.MAX_PATH]);
1225
int fullPathLength = (int)
PInvoke
.GetFullPathName(path, buffer, null);
1231
fullPathLength = (int)
PInvoke
.GetFullPathName(path, buffer, null);
1269
HANDLE outputStream =
PInvoke
.GetStdHandle(useStandardError ? STD_HANDLE.STD_ERROR_HANDLE : STD_HANDLE.STD_OUTPUT_HANDLE);
1270
if (
PInvoke
.GetConsoleMode(outputStream, out CONSOLE_MODE consoleMode))
1280
if (
PInvoke
.SetConsoleMode(outputStream, consoleMode) &&
PInvoke
.GetConsoleMode(outputStream, out consoleMode))
1286
outputIsScreen =
PInvoke
.GetFileType(outputStream) == FILE_TYPE.FILE_TYPE_CHAR;
1311
HANDLE stdOut =
PInvoke
.GetStdHandle(useStandardError ? STD_HANDLE.STD_ERROR_HANDLE : STD_HANDLE.STD_OUTPUT_HANDLE);
1312
_ =
PInvoke
.SetConsoleMode(stdOut, (CONSOLE_MODE)originalConsoleMode.Value);
1333
bool result =
PInvoke
.SetThreadErrorMode((THREAD_ERROR_MODE)newMode, &oldModeU);
1341
HANDLE h =
PInvoke
.OpenProcess(dwDesiredAccess, bInheritHandle, (uint)dwProcessId);
Windows\Win32\System\Variant\VARIANT.cs (1)
87
PInvoke
.PropVariantClear((PROPVARIANT*)t);
Microsoft.Build.Tasks.Core (6)
ComReference.cs (5)
385
HMODULE libraryHandle =
PInvoke
.LoadLibrary(typeLibPath);
394
PInvoke
.FreeLibrary(libraryHandle);
408
using BufferScope<char> buffer = new(stackalloc char[(int)
PInvoke
.MAX_PATH]);
411
for (int bufferSize = (int)
PInvoke
.MAX_PATH; bufferSize <= NativeMethodsShared.MaxPath; bufferSize *= 2)
415
int pathLength = (int)
PInvoke
.GetModuleFileName(handle, buffer.AsSpan());
FileState.cs (1)
115
bool success =
PInvoke
.GetFileAttributesEx(_filename, out WIN32_FILE_ATTRIBUTE_DATA data);
Microsoft.Build.Tasks.UnitTests (4)
AddToWin32Manifest_Tests.cs (1)
202
PInvoke
.FreeLibrary((HMODULE)hModule);
NativeMethodsShared_Tests.cs (3)
40
HMODULE kernel32Dll =
PInvoke
.LoadLibrary("kernel32.dll");
46
processHandle = (IntPtr)
PInvoke
.GetProcAddress(kernel32Dll, "GetCurrentProcessId").Value;
67
PInvoke
.FreeLibrary(kernel32Dll);
Microsoft.Build.Utilities.UnitTests (3)
NativeMethodsShared_Tests.cs (3)
40
HMODULE kernel32Dll =
PInvoke
.LoadLibrary("kernel32.dll");
46
processHandle = (IntPtr)
PInvoke
.GetProcAddress(kernel32Dll, "GetCurrentProcessId").Value;
67
PInvoke
.FreeLibrary(kernel32Dll);