Is there some equivalent (CLI or GUI) to Linux's
See the function EnvironFromProcId():
void EnvironFromProcId(PROCID procId, char ***buffer, int *size)
From the specified PROCID, (typedef for
unsigned long on Windows, otherwise
int for Mac, Linux, and other Unix-likes), the function shall copy a vector of environment strings (NAME=VALUE) to 'buffer', and the amount of strings shall be copied to 'size'. This function is not thread safe, however the source may be modified so that it can become thread safe. Note that this uses an incompletely-documented structure on Windows, and in order for it to be able to read the environment block between (to and from) both 32-bit and 64-bit processes, it uses a method that is not as performant as the other platforms. It is built with secondary executables compiled directly into the initial one, which gets extracted to the Windows temp directory at runtime, and runs from there. Depending on the architecture of the target process's associated executable image, that will determine the architecture of the secondary executable to run. Wrote for Windows, Mac, Linux, and FreeBSD. Ubuntu / Debian needs
libx11-dev if compiled using the
build*w.sh build scripts which include windowing code, (not the default). FreeBSD will need
libX11 if built with windowing.
Or, compile from the source code using the build scripts (MinGW / g++ on Windows / Linux, clang on Mac / FreeBSD), then run from the command line passing the
--env-from-pid pid command line parameters. Pass the --help parameter for the list of all possible options.
For convenience, example usage is in
main.cpp (the actual CLI code): https://github.com/time-killer-games/xproc/blob/fe14ec70e4e58359ddf3d29aa03c86328c97b49b/main.cpp#L153