[Libevent-users] GetQueuedCompletionStatus return values question/problem

Gordon Scott gscott2112 at gmail.com
Thu Nov 2 17:46:48 EST 2006


>>The two cases are differentiated by the fact that in case 4,
>>*lpNumberOfBytes == 0.
>>
>>Now - here's the rub - what's to prevent *lpNumberOfBytes being 0 in
>>case 3?  the docs say in case 3, the value in *lpNumberOfBytes is not
>>set by GetQueuedCompletionStatus().  So, it would retain whatever value
>>I set it to originally.  I'm thinking then that I need to set
>>*lpNumberOfBytes to a value, say 1, and then if it's different, I'll be
>>able to *know* it was set to 0.
Not true.  As per the documentation in condition 3 sets the number of bytes
read.  If there is an error and 0 bytes have been read, it will be set to 0.
Setting a value of 1 would lead to problems for the same reason, what if 1
byte was read?  -1 could be an option

Really though, the difference between case 3 and 4 is that GetLastError()
returns an error code in case 3, and it does not return an error code in
case 4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://monkeymail.org/archives/libevent-users/attachments/20061102/e868b6e5/attachment.htm


More information about the Libevent-users mailing list