[Winpcap-users] Re: WriteFile fails with ERROR_GEN_FAILURE

Eli Iser eli.iser at gmail.com
Thu Nov 9 13:01:04 GMT 2006


I apologize for the late reply.

Firstly, I appriciate your fast reply. It's good to know that WinPCap is
supported so well.

I seem to have sorted the problem out, and have ran some lengthy tests to
make sure that I did.
What I did was to set to zero the entire OVERLAPPED structure (aside from
the event, of course), instead of just two of the fields (if I remember
correctly, Offset and OffsetHigh) like I saw in one of the MSDN examples.
Also, I've set to zero the OVERLAPPED structure before calling
GetOverlappedResult, which I did not do before. Originialy I only
initialized the OVERLAPPED structure before calls to WriteFile, ReadFile and
DeviceIoCtl. I was under the (probably wrong) impression that
GetOverlappedResult required the values set in the OVERLAPPED structure by
the call to the function (like WriteFile). If this is really not the case -
that you need to always init the OVERLAPPED strucutre - why have it? Maybe
I'm missing something with the OVERLAPPED working? Of topic, I know, so no
need to really answer that. Just thinking out loud :)

Finally, about your remark not to use the Packet32 - I decided that I don't
need the overhead of the WinPCap library, nor do I need any of it's extra
feature. All I need is ReceivePacket and SendPacket. All else I handle by
myself. I do understand that I will probably won't be able to use future
releases of Packet32, but that is a risk I knowingly take.

Thank you,

Eli Iser
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20061109/8f57e8b1/attachment.htm


More information about the Winpcap-users mailing list