CreateProcess for Unix binaries

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
yves.surrel
Newbie
Newbie
Posts: 3
Joined: Wed Dec 17, 2008 4:16 am

CreateProcess for Unix binaries

Post by yves.surrel »

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
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: CreateProcess for Unix binaries

Post by vitamin »

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.
Locked