On Thu, Apr 20, 2023, 2:11 AM Richard W.M. Jones <rjones@redhat.com> wrote:
On Thu, Apr 20, 2023 at 12:58:04AM +0900, Jin-oh Kang wrote:
> On Tue, Apr 18, 2023, 4:44 PM Richard W.M. Jones <rjones@redhat.com> wrote:
>     Supplemental question: There appears to be duplicate socket handling
>     code in wineserver server/sock.c and dlls/ntdll/unix/socket.c.
>
>
> I don't believe this to be the case.
>
>
>     In my
>     tests only the wineserver code is called, and never the ntdll/unix
>     code.  Why is that?
>
>
> This would need further elaboration: which part of dlls/ntdll/unix/* did you
> expect to be called, but wasn't?

Thanks for the other tips.

In the case above I was referring to these pieces of code which both
may be doing conversion to and from Unix sockaddr:

https://gitlab.winehq.org/wine/wine/-/blob/9e99c6f66d236101a084b6a3a24c98b5c8677fe5/dlls/ntdll/unix/socket.c#L298

https://gitlab.winehq.org/wine/wine/-/blob/9e99c6f66d236101a084b6a3a24c98b5c8677fe5/server/sock.c#L483

They appear identical.  In my test only the one in server/sock.c was
called (not that I'm saying the other is never called, just that I
didn't see it).

Are they used in different circumstances?

The former sockadr_from_unix (in ntdll) seems to be for WS2 getpeername() and recvfrom().

In case you haven't tried, running wine tests should give an idea about which function is called in which scenario.


Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW