SYNOPSIS - some ported socket SW opens/connects socket then calls sendto() with socket nbr and no target address. Fails in ROS but works in 2003
proof of concept hacks to AFD, attaching 4.15-dev-5933-gfdf4814 based source/binaries (WIP) - does not meet coding standards and is not thread safe
While working on porting SAMBA4 via Cygwin 2.5.2 I found that UDP messaging would not work when running on ReactOS 0.4.15-dev-2039-gca74467. I traced the problem to the use of a slightly uncommon calling sequence for winsock functions. basically the application calls socket() to create a datagram socket, then calls connect() specifying a RemoteAddress, and later calls Sendto() without providing a RemoteAddress value. This sequence works fine under Windows 10, so apparently Windows is retaining the RemoteAddress value from the Connect() call and associating it with the socket even though a connection is not actually made. ReactOS is not storing the RemoteAddress in association with the socket for connectionless mode calls. I do not know if this functionality is found in windows at winsock, AFD, TDI, or the LAN layer, but currently it does not exist in ReactOS so the application fails. I have attached a small test application that demonstrates the issue in source form (I'll attach binaries if it allows me to). I did develop workaround code in the AfdStreamSocketconnect() and AfdPacketSocketWriteData() functions that handles this by storing the information in FCB->ConnectCallInfo->RemoteAddress FCB->ConnectReturnInfo->RemoteAddress and using it if the function to populate TargetAddress fails, but I'm not sure that is the proper way to handle this..
NOTE: the binaries were built using Delphi by porting the code because I didn't have a working C compiler, but I just passed the code through a converter, patched it up, and added some comments.. It is functionally equivalent.