The CreateProcess function sets a lpProcessInformation field. This field is set when a Windows process is called, but erased when a Unix binary (e.g. /bin/sleep 2) is called, so the hprocess handle is unknown. Is there a way to obtain this process handle so that GetExitCodeProcess can be called? I basically want to know when the called process has exited. Thanks
yves.surrel wrote:> The CreateProcess function sets a lpProcessInformation field. This field is set when a Windows process is called, but erased when a Unix binary (e.g. /bin/sleep 2) is called, so the hprocess handle is unknown. Is there a way to obtain this process handle so that GetExitCodeProcess can be called? I basically want to know when the called process has exited.Native *NIX processes won't have process handle - they are run outside Wine. The only thing you can use is a standard UNIX mechanism - get PID of the child process then do waitpid() on it. Of course for that you need winelib app so it can call system's waitpid() and not Wine'a msvcrt one.
Possibly Parallel Threads
- Running an R script from Delphi 7
- Calling R functions in Delphi
- [Bug] [Urgent] CreateProcess Failed internal error (1359)
- [ win32utils-Bugs-5503 ] Process::create() checks return value of CreateProcess against 0, should be false
- Question on CreateProcess and handle inheritance