There are some Win32 objects which according to the SDK can be “inherited” to the child-processes created by the given process. (Events, mutexes, pipes, …)
What does that actually mean?
Let’s say I have a named event object, created with CreateEvent, one time with bInheritHandle == true, and another time == false.
Now I start a child process. How do those two event handles affect the child process? In which scenarios do they differ?
If you create/open an object and allow that handle to be inherited, child processes which are allowed to inherit handles (e.g. you can specify
bInheritHandles = TRUEfor CreateProcess) will have copies of those handles. Those inherited handles will have the same handle values as the parent handles. So for example:CreateEventreturns a handle to an event object, handle is0x1234.0x1234without having to callCreateEventorOpenEvent. You could for example pass the handle value in the command line of the child process.This is useful for unnamed objects – since they’re unnamed, other processes can’t open them. Using handle inheritance child processes can obtain handles to unnamed objects if you want them to.