Windows handles can be set to be either inheritable or not, to control whether child processes will receive them (when bInheritHandles
in CreateProcess
is TRUE). However, using SetHandleInformation
to mark a SOCKET non-inheritable does not always work. In particular, when certain Layered Service Providers (LSPs) are installed, the child process inherits the handle anyway. This is particularly likely to cause bugs with listening sockets. (But, because of another issue, if the child were to try using the socket, it would not be able! A real catch-22!)
SetHandleInformation
.bInheritHandles
true.When a (non-IFS) LSP is installed, eg. PCTools Internet Security, the listening socket will be open in the child (visible in netstat
), despite SetHandleInformation
being called on the socket to disable inheritance before creating the child.
For an alternative scenario, see the (brief) steps in KB2398202.
What workarounds are available?RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4