https://bugs.winehq.org/show_bug.cgi?id=51671
--- Comment #5 from Sagawa sagawa.aki+winebugs@gmail.com --- Hi Zebediah, Bug 51232 addresses a slightly different issue. In that bug, the reporter said getsockopt() with a file descriptor returned by open() caused WSAEBADF, not WSAENOTSOCK.
On the other hand, in this bug, we discuss a file handle returned by CreateFile(). With a file handle, getsockopt() was able to cause WSAENOTSOCK before the commit b58ca92fa53088a87c4c33a1e31c0d4ec1a43a1c.