What is the equivalent of POSIX's group ID on Windows?

212 views Asked by At

When analyzing the process tree in C++, POSIX allows you to prune it using group ID. Several processes may be added to a particular group.

Eg. see the following POSIX function.

add my process to a group

Does Windows have an equivalent of the above? I would like to assign a bunch of processes I own to a group, and then control the group as a whole.

Eg.

kill all processes in my group

1

There are 1 answers

0
Artyer On

Windows has process groups which each newly created child process is added to unless it is created with the CREATE_NEW_PROCESS_GROUP flag. This is only useful for the GenerateConsoleCtrlEvent function as far as I know.

Job objects might be more useful to you. For example, you can kill all process associated with a given job with TerminateJobObject.