* expose EnvironmentBlockToEnvpA
* cleanup includes in process.c
* removed unused "flag" variable in _CreateProcessExA
* make ProcessHandleCloseHandle static
When launching a new process stdin/stdout/stderr can be redirected by
passing the corresponding HANDLEs in the passed lpStartupInfo structure.
This is required for example if a pipe should be used as stdin/stdout.
If set in lpStartupInfo the file descriptor of the passed handle is
now used. The test was updated accordingly.
If SA_SIGINFO isn't set in the flags sa_handler is used
instead of sa_sigaction.
This fixes also the compiler warning:
FreeRDP/winpr/libwinpr/thread/process.c: In function ‘_CreateProcessExA’:
FreeRDP/winpr/libwinpr/thread/process.c:282:20: warning: assignment from
incompatible pointer type [enabled by default]
The calling thread of CreateProcess can be in any library and
can have arbitrary signal masks and handlers.
We now save the caller's mask and block all signals before forking.
After fork:
- child resets the handlers and unblocks all signals.
- parent restores the caller's original signal mask.
TerminateProcess shouldn't call kill if the PID is <=0 because this has
unwanted effects (and is not what TerminateProcess should do):
* with PID == 0 any process in the same process group gets the signal
sent
* with PID == -1 *every* processes that the running users has
permissions to gets the signal sent
* with PID < -1 the process within the same process group and -PID gets
the signal send
For more details see kill(2).