Hi,
While I'm not an expert in this part of wine, I want to point out that while it's definitely one way to do it, it's not the best way. You're relying on System() here which in turn relies on the output of the ps command. There's many potential issues here:
1. You have to make sure the output of the command you're executing will be the same across all systems. This could be an issue for cross-platform compatibility.
2. System() spawns extra processes which introduces overhead, which could be a problem on systems with limited resources.
3. 'ps' itself could have been removed, or modified maliciously, or only executable as root, probably anything could happen.
IMO, as much as possible, you should rely on using the existing API's provided within
Feel free to ask any further questions you have. Make sure to CC wine-devel in your replies so other devs can see and help if need be.
Cheers,
Aaryaman