"Eric Pouech" pouech-eric@wanadoo.fr wrote:
For asynchronous read operations, hFile can be any handle opened with the FILE_FLAG_OVERLAPPED flag by the CreateFile function, or a socket handle returned by the socket or accept function.
which means that ReadFile() only works on socket for async reads, not sync reads. I'll precise this.
Did you actually test this? We need a knowledge, not a speculation.
I did. See attached test and it fails on XP. Note that ReadFile works on socket (overlapped op), while WriteFile (synchronous operation) doesn't.
Your test passes on win2k SP4 for me, but hangs on win98. Uncommented WriteFile call failes and doesn't change a previous error value, but that might be due to different reasons: missing OVERLAPPED pointer, incompatible socket open mode, or something else.