Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] reproc doesn't wait for process to fully start #73

Open
HellsingDarge opened this issue Nov 21, 2021 · 2 comments
Open

[Windows] reproc doesn't wait for process to fully start #73

HellsingDarge opened this issue Nov 21, 2021 · 2 comments

Comments

@HellsingDarge
Copy link

CreateProcess returns when the process begun starting rather than it has fully started and it's waiting for inputs/processing, which can lead to errors (e.g. 0xC0000142) when the object holding the process instance or the executable context itself exits before it's fully started

@DaanDeMeyer
Copy link
Owner

I don't have access to a WIndows machine anymore so it'd be great if you could open a PR that has reproc wait for the process to finish initializing using WaitForInputIdle.

@HellsingDarge
Copy link
Author

Which is used to wait for a window's object to be fully initialised (it's opened and displaying) and waiting for input (keypress, mouse, minimise, resize etc). And as I've searched through Microsoft docs, there doesn't seem to be a function that waits until all DLLs are loaded for a process, so the only option left is to arbitrarily wait after creation and hope that no out/err is lost before the drain is set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants