https://bugs.winehq.org/show_bug.cgi?id=46272
--- Comment #9 from Hans Leidekker hans@meelstraat.net --- (In reply to Zebediah Figura from comment #7)
(In reply to Hans Leidekker from comment #3)
Obviously we can't do server calls in programs. Maybe it would be acceptable to use an unused field from SYSTEM_PROCESS_INFORMATION for this purpose, e.g. dwUnknown4. Then we could retrieve the Unix pid with a call to NtQuerySystemInformation(SystemProcessInformation).
I think it would make more sense to use an unused value instead, something like NtQueryInformationProcess(ProcessUnixPID); what do you think?
For the taskkill case I think it would be better to have it in SYSTEM_PROCESS_INFORMATION. We're already walking the list of processes so it requires no extra calls to retrieve the Unix pid. This way we are also guaranteed to get consistent data because it's all in the same snapshot. A separate call would open up a race, albeit very unlikely to hit.