Since you didn't open those handles (that's not what GetStdHandle
does), you don't need to close them (maybe you want to close them
for some other reason, but it's unlikely). (Note: even if you did
open the handles, you don't have to wait for the process to exit
before you close them: once they are inherited, closing them in parent
process has no effect on the child).
Note that hStdOutput
should be INVALID_HANDLE_VALUE
instead of
NULL
: that's the convention for passing the absence of a handle in STARTUPINFO
.