https://bugs.winehq.org/show_bug.cgi?id=50405
Bug ID: 50405 Summary: Missing ability to read Evironment Block and Environment Block Size from any Process ID kernel32 Product: Wine Version: 5.0 Hardware: x86-64 OS: FreeBSD Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: samuelvenable@hotmail.com
This works on Windows for me, but in WINE I get an empty string:
https://github.com/time-killer-games/libprocinfo/blob/57ca23b1896a68f7b349bf...
Requires using a private API. I noticed you guys implemented a different private API which allows you to get the Current Working Directory from an arbitrary Process ID, so that shows you guys aren't against implementing private API's.
So anyway, it would be nice to have this, as my libprocinfo library relies on this as one of its core features. It can also help debugging Windows processes runing through WINE, for those who need that sort of thing.
I use it for inter-process communication and to avoid sockets, personally.
See the function env_from_pid(process_t pid) in that source file, for more details on the implementation. Who knows, maybe I'm doing something wrong and it could be pure luck it works on Windows natively, but I really doubt that.