In windows process management, if we want to pass the values of more than one inheritable handle to a child process, how should it be done.. ? I understand that we can use STARTUPINFO to pass one handle value, but how can I pass multiple handle values to a child process..?
Asked
Active
Viewed 292 times
2
-
If the command line isn't convenient for any reason, another option is to use the environment block. – Harry Johnston Oct 25 '11 at 01:54
1 Answers
3
The command line is a convenient place to pass all sorts of information.

Raymond Chen
- 44,448
- 11
- 96
- 135
-
This might be a stupid question, but how would you "marshal" the value before passing it on the command line? I mean do you convert it to some kind of text representation before passing it on or do you just give "raw bytes" as the command line knowing that you wrote the application on the other end at it'll know how to parse it (And you'll never have to worry people accessing the command line using ansi API functions or other horrific things)? – user786653 Oct 22 '11 at 21:12
-
Since the command line is text-only, you have to [convert it to text](http://blogs.msdn.com/b/oldnewthing/archive/2003/12/11/56043.aspx). – Raymond Chen Oct 22 '11 at 21:35
-
Thanks a lot. I knew I should have just been better at searching your blog (I have red ears now since I now recall having read the linked article). (PS: Never give in to the nitpickers) – user786653 Oct 22 '11 at 22:13
-
Could you please explain how to convert that text back into a value.. As an example how can I do that with a file handler...? – psaw.mora Oct 23 '11 at 01:08
-
1You can see [the sample code I linked to](http://blogs.msdn.com/b/oldnewthing/archive/2003/12/11/56043.aspx). – Raymond Chen Oct 23 '11 at 01:20