Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
Description
In Windows 2003 through Win10 sockets can be duplicated between arbitrary processes as long as socket handle 'value' is passed to the target process via some IPC method. This socket duplication method does not work in ReactOS. I have tested on multiple recent development builds as well as Windows server 2003 and Windows 10. (detected while porting samba 4 smbd file share server, which relies on this method to handle incoming client connections).
DuplicateHandle returns success and does copy the NT ObjectHandle, but the lack of the necessary winsock structures in the target process causes the handle to return WSAENOTSOCK errors when it is used. WSADuplicateSocket cannot be used in this case because the socket duplication takes place from the target process rather than the process owning the original socket and WSADuplicateSocket also fails returning WSAENOTSOCK during its early parameter validation.
I have attached a test application set for this (source and binary), as well as images showing test working on W2K3 and failing on a recent dev build.
Attachments
Issue Links
- relates to
-
CORE-17554 Winsock Handles not inherited in CreateProcess called with bInheritHandles=TRUE
- Untriaged