From 6bc340e473b4db6c3238a52c1e8cf68d7d03fb56 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 22 Aug 2019 17:59:05 +0500 Subject: [PATCH 1/2] Replace 'api-ms-win-core-job-12-1-0.dll' with 'Kernell32.dll' --- .../commands/management/Service.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index 9f27b746a2f..7f87dfd84d1 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -2764,7 +2764,7 @@ byte[] lpSecurityDescriptor /// If the object existed before the function call, the function /// returns a handle to the existing job object. /// - [DllImport(PinvokeDllNames.CreateJobObjectDllName, CharSet = CharSet.Unicode)] + [DllImport("Kernel32.dll", CharSet = CharSet.Unicode)] internal static extern IntPtr CreateJobObject(IntPtr lpJobAttributes, string lpName); /// From d173885f138d60611ea623fdeb4f6d92aa3dd9e6 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 27 Aug 2019 14:40:58 +0500 Subject: [PATCH 2/2] Remove all links to api-ms-win-core-job-l2-1-0.dll --- .../commands/management/Service.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index 7f87dfd84d1..71044487800 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -2779,7 +2779,7 @@ byte[] lpSecurityDescriptor /// If the function succeeds, the return value is nonzero. /// If the function fails, the return value is zero. /// - [DllImport(PinvokeDllNames.AssignProcessToJobObjectDllName, CharSet = CharSet.Unicode)] + [DllImport("Kernel32.dll", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool AssignProcessToJobObject(SafeHandle hJob, IntPtr hProcess); @@ -2805,7 +2805,7 @@ byte[] lpSecurityDescriptor /// If the function succeeds, the return value is nonzero. /// If the function fails, the return value is zero. /// - [DllImport(PinvokeDllNames.QueryInformationJobObjectDllName, EntryPoint = "QueryInformationJobObject", SetLastError = true, CharSet = CharSet.Unicode)] + [DllImport("Kernel32.dll", EntryPoint = "QueryInformationJobObject", SetLastError = true, CharSet = CharSet.Unicode)] public static extern bool QueryInformationJobObject(SafeHandle hJob, int JobObjectInfoClass, ref JOBOBJECT_BASIC_PROCESS_ID_LIST lpJobObjectInfo, int cbJobObjectLength, IntPtr lpReturnLength);