1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Prevent handle inheritance from blocking Windows async_wrapper (#5666)

This commit is contained in:
Matt Davis 2016-11-18 09:57:51 -08:00 committed by Matt Clay
parent 44c07d7ca8
commit 13a9b98565

View file

@ -397,7 +397,7 @@ Function Start-Watchdog {
$exec_cmd = [Ansible.Async.NativeProcessUtil]::SearchPath("powershell.exe") $exec_cmd = [Ansible.Async.NativeProcessUtil]::SearchPath("powershell.exe")
$exec_args = "`"$exec_cmd`" -NoProfile -ExecutionPolicy Bypass -EncodedCommand $encoded_command" $exec_args = "`"$exec_cmd`" -NoProfile -ExecutionPolicy Bypass -EncodedCommand $encoded_command"
If(-not [Ansible.Async.NativeProcessUtil]::CreateProcess($exec_cmd, $exec_args, [IntPtr]::Zero, [IntPtr]::Zero, $true, $pstartup_flags, [IntPtr]::Zero, $env:windir, [ref]$si, [ref]$pi)) { If(-not [Ansible.Async.NativeProcessUtil]::CreateProcess($exec_cmd, $exec_args, [IntPtr]::Zero, [IntPtr]::Zero, $false, $pstartup_flags, [IntPtr]::Zero, $env:windir, [ref]$si, [ref]$pi)) {
#throw New-Object System.ComponentModel.Win32Exception #throw New-Object System.ComponentModel.Win32Exception
throw "create bang $([System.Runtime.InteropServices.Marshal]::GetLastWin32Error())" throw "create bang $([System.Runtime.InteropServices.Marshal]::GetLastWin32Error())"
} }