On 10/13/2020 7:28 AM, Corinna Vinschen wrote: > On Oct 4 12:49, Ken Brown via Cygwin-patches wrote: >> A successful connection can be indicated by STATUS_SUCCESS or >> STATUS_PIPE_CONNECTED. > > THanks for catching but... huh? How does Windows generate two different > status codes for the same result from the same function?
I think (but I'd have to recheck) that if the pipe is already connected when NtFsControlFile is called, then the latter returns STATUS_PIPE_CONNECTED. But if you first get STATUS_PENDING and then set status = io.Status after completion, then the result is STATUS_SUCCESS. I might not have that exactly right. All I remember for sure is that I was debugging a listen_pipe failure, and it turned out to be due to STATUS_SUCCESS being treated as an error condition. Ken