From your previous post, you are not using a hEvent parameter in your
OVERLAPPED structure, from the SDK on GetOverLappedResult…
Windows NT/2000/XP: If the hEvent member of the
OVERLAPPED
structure is NULL, the system uses the state of the hFile handle to signal when the operation has been completed. Use of file, named pipe, or communications-device handles for this purpose is discouraged. It is safer to use an event object because of the confusion that can occur when multiple simultaneous overlapped operations are performed on the same file, named pipe, or communications device. In this situation, there is no way to know which operation caused the object’s state to be signaled.
I would suggest that you use an hEvent parameter, it is as simple as using CreateEvent to create one and initializing the hEvent member of the OVERLAPPED structure to it. You should read all the SDK docs on the file I/O calls.
At 08:10 AM 1/23/2006, =?UNKNOWN?Q?S=F8ren?= Dreijer wrote:
Hey,
I’m reading data from my NDIS miniport driver through ReadFile() with
overlapped I/O in a dedicated reading thread. I’m using
GetOverlappedResult() with the wait-parameter set to TRUE in order to block
until data has been received.
Now, what I am experiencing is that some times when GetOverlappedResult()
returns, the number of bytes read is 0, even though I can see my driver
reports another value through DbgPrint(). If I use my debugger to move the
point of execution back to the GetOverlappedResult() call, the function
returns immediately (as it should, since data has been received), and this
time around the number of bytes read are reported correctly.
What’s going on here…?
Thanks,
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@credence.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Russ Poffenberger
Credence Systems Corp.
xxxxx@credence.com