[Libevent-users] GetQueuedCompletionStatus return values
question/problem
Kevin Sanders
newroswell at gmail.com
Wed Nov 1 10:27:30 EST 2006
On 11/1/06, Toby Douglass <toby.douglass at summerblue.net> wrote:
> According to my reading of the docs, GetQueuedCompletionStatus has four
> return status';
>
> ---
>
> 1. return value != 0
> - all went well, we've just returned from a successful dequeuing
>
> 2. return value != 0 and lpOverlapped == NULL
> - all handles associated with the IO completion object have been
> closed and the IO completion object itself has been closed (time to quit)
>
> 3. return value == 0 and lpOverlapped != NULL
> - GetQueuedCompletionStatus() was okay, but we dequeued a *failed*
> IO operation (note that lpNumberOfBytes is not set in this case)
>
> 4. return value == ERROR_SUCCESS and lpOverlapped != NULL and
> *lpNumberOfBytes == 0
> - the handle we've come back on is actually a socket, and the remote
> host has closed
>
> ---
>
> Now, the problem is this: ERROR_SUCCESS is #defined as zero!
>
> In other words, I don't think it's possible to differentiate between
> case 3 and 4, because in case 3, *lpNumberOfBytes might be 0 just by chance.
>
Call GetLastError().
More information about the Libevent-users
mailing list