Discussion:
CreateProcess and redirected input - how to "pass thru" ?
(too old to reply)
R.Wieser
2024-04-20 08:01:03 UTC
Permalink
Hello all,

I've written a "launcher" program which uses CreateProcess to start the
child. Both are console programs.

The thing is, the child (lets say its "more") accepts redirected input and
I've got no idea how to get the redirected input from the launcher to the
child.

I've tried a few things (inheriting StdIO handles), but cannot seem to get
it to work, nor does googeling turn anything up. :-(


So, the question : how do I allow the child to, if present, use the
redirected input the launcher gets.

Remark: this is *not* about the launcher talking to the child using pipes.
Examples about that are plenty. If the launcher gets cut off from StdInp
its fine by me.

Regards,
Rudy Wieser
R.Wieser
2024-04-20 13:30:21 UTC
Permalink
Post by R.Wieser
So, the question : how do I allow the child to, if present, use
the redirected input the launcher gets.
As it turns out (after having tried throwing all kinds of stuff at it),
letting the child inherit the launchers StdIO handles isn't the problem.

What is is that I've put that launcher into the registry as the "open" verb
for a certain file extension.

IOW, running it from the comandline works, running it by double-clicking the
involved file fails.

I think I'm outof my depth her ...

Remark: I've also tried to add OleInitialize (just a hunch), but that didn't
make any difference. :-\

Regards,
Rudy Wieser
R.Wieser
2024-04-21 17:25:27 UTC
Permalink
Post by R.Wieser
What is is that I've put that launcher into the registry as the "open"
verb for a certain file extension.
(going thru the registry:)

I checked if the launcher itself could read redirected input from StdIn, and
it couldn't.

I removed the launcher altogether, and I got the same problem : and invalid
handle.

FYI, the called (origional) program in case is cscript (for which I added a
".VBC" extension), and the "invalid handle" error is thrown by the script
that is run.

Regards,
Rudy Wieser

Loading...