fixes #5179
This commit is contained in:
parent
7cd8b0b5e6
commit
92ecbc9958
1 changed files with 5 additions and 4 deletions
|
|
@ -429,13 +429,14 @@ when defined(Windows) and not defined(useNimRtl):
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
|
|
||||||
proc createAllPipeHandles(si: var STARTUPINFO;
|
proc createAllPipeHandles(si: var STARTUPINFO;
|
||||||
stdin, stdout, stderr: var Handle) =
|
stdin, stdout, stderr: var Handle;
|
||||||
|
hash: int) =
|
||||||
var sa: SECURITY_ATTRIBUTES
|
var sa: SECURITY_ATTRIBUTES
|
||||||
sa.nLength = sizeof(SECURITY_ATTRIBUTES).cint
|
sa.nLength = sizeof(SECURITY_ATTRIBUTES).cint
|
||||||
sa.lpSecurityDescriptor = nil
|
sa.lpSecurityDescriptor = nil
|
||||||
sa.bInheritHandle = 1
|
sa.bInheritHandle = 1
|
||||||
let pipeOutName = newWideCString(r"\\.\pipe\stdout")
|
let pipeOutName = newWideCString(r"\\.\pipe\stdout" & $hash)
|
||||||
let pipeInName = newWideCString(r"\\.\pipe\stdin")
|
let pipeInName = newWideCString(r"\\.\pipe\stdin" & $hash)
|
||||||
let pipeOut = createNamedPipe(pipeOutName,
|
let pipeOut = createNamedPipe(pipeOutName,
|
||||||
dwOpenMode=PIPE_ACCESS_INBOUND or FILE_FLAG_WRITE_THROUGH,
|
dwOpenMode=PIPE_ACCESS_INBOUND or FILE_FLAG_WRITE_THROUGH,
|
||||||
dwPipeMode=PIPE_NOWAIT,
|
dwPipeMode=PIPE_NOWAIT,
|
||||||
|
|
@ -512,7 +513,7 @@ when defined(Windows) and not defined(useNimRtl):
|
||||||
else:
|
else:
|
||||||
createPipeHandles(he, si.hStdError)
|
createPipeHandles(he, si.hStdError)
|
||||||
else:
|
else:
|
||||||
createAllPipeHandles(si, hi, ho, he)
|
createAllPipeHandles(si, hi, ho, he, cast[int](result))
|
||||||
result.inHandle = FileHandle(hi)
|
result.inHandle = FileHandle(hi)
|
||||||
result.outHandle = FileHandle(ho)
|
result.outHandle = FileHandle(ho)
|
||||||
result.errHandle = FileHandle(he)
|
result.errHandle = FileHandle(he)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue