On 19 Dec 2016 at 1:26, Antony Polukhin wrote:
Windows has no fork(). Looks like the only way to do that safely on Windows, is to create a process before the signal, make a pipe and wait for data on a pipe. As soon as the signal appears - dump data into the pipe and die. The child process have to output the content... it seems to me that such out-of-the-box functionality won't make all the users happy. They would definitely want to tune multiple things that I'm failing to predict.
The NT kernel has a fork() implementation: RtlCloneUserProcess() You should note that much Win32 code is highly unreliable after being forked, only Nt*() calls are reliable but if you called NtTerminateProcess() on the clone when you're done so no Win32 code executes it should work. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/