/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/System.Management.Automation/engine/Interop/Windows/CreateJobObject.cs
30 строк
898 B
Jordan Borean
Fix Start-Process -Wait polling (#24711)
28 янв 2025, 11:52
Не верифицирован
28 янв 2025, 11:52
4e79421
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #nullable enable using System.Runtime.InteropServices; internal static partial class Interop { internal static partial class Windows { internal sealed class SafeJobHandle : SafeHandle { public SafeJobHandle() : base(invalidHandleValue: nint.Zero, ownsHandle: true) { } public override bool IsInvalid => handle == nint.Zero; protected override bool ReleaseHandle() => Windows.CloseHandle(handle); } [LibraryImport("kernel32.dll", EntryPoint = "CreateJobObjectW", SetLastError = true)] private static partial SafeJobHandle CreateJobObject( nint lpJobAttributes, nint lpName); internal static SafeJobHandle CreateJobObject() => CreateJobObject(nint.Zero, nint.Zero); } }