Undo handle duplication
parent
62bbb0597e
commit
bae79b80e3
|
@ -118,23 +118,11 @@ TUPLE: CreateProcess-args
|
||||||
: inherited-stderr ( args -- handle )
|
: inherited-stderr ( args -- handle )
|
||||||
drop STD_ERROR_HANDLE GetStdHandle ;
|
drop STD_ERROR_HANDLE GetStdHandle ;
|
||||||
|
|
||||||
: duplicate-handle ( handle -- handle )
|
|
||||||
GetCurrentProcess
|
|
||||||
swap
|
|
||||||
GetCurrentProcess
|
|
||||||
f <void*> [
|
|
||||||
0
|
|
||||||
TRUE
|
|
||||||
DUPLICATE_SAME_ACCESS
|
|
||||||
DuplicateHandle win32-error=0/f
|
|
||||||
] keep *void* ;
|
|
||||||
|
|
||||||
: redirect-stderr ( args -- handle )
|
: redirect-stderr ( args -- handle )
|
||||||
+stderr+ get
|
+stderr+ get
|
||||||
dup +stdout+ eq? [
|
dup +stdout+ eq? [
|
||||||
drop
|
drop
|
||||||
CreateProcess-args-lpStartupInfo duplicate-handle
|
CreateProcess-args-lpStartupInfo STARTUPINFO-hStdOutput
|
||||||
STARTUPINFO-hStdOutput
|
|
||||||
] [
|
] [
|
||||||
GENERIC_WRITE CREATE_ALWAYS redirect
|
GENERIC_WRITE CREATE_ALWAYS redirect
|
||||||
swap inherited-stderr ?closed
|
swap inherited-stderr ?closed
|
||||||
|
|
Loading…
Reference in New Issue