Re: ReadFille error caused by USB sniffer
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Tue, 13 Mar 2007 09:28:33 -0700
And also while OP is skipping percent characters, the code needs to check
for the end of buffer.
"Ben Voigt" <rbv@xxxxxxxxxxxxx> wrote in message
news:erKIGiXZHHA.4552@xxxxxxxxxxxxxxxxxxxxxxx
"HMS Surprise" <john@xxxxxxxxxxxxxxxx> wrote in message
news:1173793517.220687.95970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Specifically, we need to know if you're using overlapped I/O, completion
routines, anything like that.
Thanks for posting. Here's a rough example of the code, as you can see
it uses overlapped reads and WaitForSingleObject.
Since you are using a local variable as a buffer, you must not allow the
function to exit while the operation is pending. Cancellation is also
unreliable, and I think that's what is going wrong. You issue a request
and wait for it, that's fine, the buffer is still valid. But when you
timeout, you exit your function, allowing the stack space occupied by the
buffer to be reused. You may have issued a cancellation request, but that
doesn't prevent the operation from using the buffer after CancelIo
returns. Only when the event is triggered, can you be sure that the
kernel is done using your buffer.
.
- Follow-Ups:
- Re: ReadFille error caused by USB sniffer
- From: HMS Surprise
- Re: ReadFille error caused by USB sniffer
- References:
- ReadFille error caused by USB sniffer
- From: HMS Surprise
- Re: ReadFille error caused by USB sniffer
- From: William DePalo [MVP VC++]
- Re: ReadFille error caused by USB sniffer
- From: Ben Voigt
- Re: ReadFille error caused by USB sniffer
- From: HMS Surprise
- Re: ReadFille error caused by USB sniffer
- From: Ben Voigt
- ReadFille error caused by USB sniffer
- Prev by Date: Re: get the length of a file
- Next by Date: Re: Thread deadlock misery
- Previous by thread: Re: ReadFille error caused by USB sniffer
- Next by thread: Re: ReadFille error caused by USB sniffer
- Index(es):