Am 2017-04-11 um 12:26 schrieb Stefan Dösinger:
Is it necessary to store the child processes in a separate list? I'd expect that CreateToolhelp32Snapshot creates a snapshot that is not affected by changes to the process tree after it returns. If this is the case you can kill processes as you iterate over the snapshot with Process32Next. This would simplify the code a lot
I've been made aware that Process32First/Next doesn't work with recursion as it has to store the current iteration position in the handle. So my idea here doesn't work :-\ .
If you keep the list please use a wine list from include/wine/list.h. This will also give you more flexibility in the order of how you kill the processes, see below.
And this idea would mean wrapping a DWORD into a struct list structure, which is a bit wasteful. So while I do not like custom-written list / array structures using the dynamic array here is probably the lesser evil.