https://bugs.winehq.org/show_bug.cgi?id=46272
--- Comment #12 from Hans Leidekker hans@meelstraat.net --- (In reply to Zebediah Figura from comment #11)
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.
Eh, I guess. I'm just concerned about abusing reserved fields that might be meaningful, and I'm not sure how worthwhile avoiding that kind of a race would actually be. Not to mention that our current implementation of SystemProcessInformation is already racy (though I guess this could be fixed by moving it all to the server).
There are 6 more unused DWORD fields, so we may have some wiggle room here.
Besides which trying to avoid races may be a moot point, as it seems that tasklist.exe is supposed to return/filter by some things (username, "service information") that aren't available in SYSTEM_PROCESS_INFORMATION anyway.
Why do we need this in tasklist? Isn't the use case that one should be able to gracefully close a Wine process using its Unix pid? If so, I think a taskkill /unixpid option would suffice.