YuweiBa-3096 avatar image
0 Votes"
YuweiBa-3096 asked RLWA32-6355 edited

windows-rs CreateProcessW with EXTENDED_STARTUPINFO_PRESENT

I'm using the Rust binding windows-rs to call Win32 APIs to create processes with ConPty.

However the CreateProcessW can only run "some" programs, for example, "notepad.exe",

If I ran "cmd.exe", "powershell.exe", "ping.exe", the program won't start and exit with code: exitcode: 3221225794.

I have a repro at:

To run different programs, change

and "cargo r"

related Github issue:

· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

There is a Microsoft sample that uses pseudoconsoles with ping.exe at

You might want to try converting that to use the Rust binding as a test of your work.

0 Votes 0 ·

Thanks for the reply

If you read the related Github Issue before writing you'll see this is what I'm doing.

I have no problem using the APIs as I mentioned it does work with "notepad.exe".

My question is why is "ping.exe" not working ?

0 Votes 0 ·

Notepad is a windows desktop application (gui application) and does not use any console input/output.

0 Votes 0 ·
Show more comments

Sample doesn't compile:

thread::spawn(move || loop {
             ------- value moved into closure here
   let mut buffer = [0u8; 1024];
   match buffer) {
         -------- variable moved due to use in closure

thread::spawn(move || loop {
             ^^^^^^^ value used here after move
   let mut buffer = [0u8; 1024];
   match buffer) {
         -------- use occurs due to use in closure

0 Votes 0 ·

Sorry fixed. I added a dup code section in from copy&paste

0 Votes 0 ·

0 Answers