<div>GV -</div>
<div> </div>
<div>Actually, after reading the article I read the responses on the associated message board. It turns out that this has been solved with .net 2.0 (I'm using VS 2005).</div>
<div> </div>
<div>If you use this before the delegate declaration, everything works correctly. I grabbed several thousand packets using pcap_dispatch / callback without any trouble.</div>
<div> </div><font size="2">
<p>[</p></font><font color="#008080" size="2">UnmanagedFunctionPointer</font><font size="2">(</font><font color="#008080" size="2">CallingConvention</font><font size="2">.Cdecl)]
<p></p></font>
<div>Thank you for leading me in the right direction!</div>
<div> </div>
<div>Chris</div>
<div><br><br> </div>
<div><span class="gmail_quote">On 4/12/06, <b class="gmail_sendername">Gianluca Varenni</b> <<a href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="DIRECTION: ltr">
<div><font size="2">Chris,</font></div>
<div><font size="2"></font> </div>
<div><font size="2">my suspect is that the calling convention of the delegate that you pass to pcap_loop or pcap_dispatch is wrong. As a consequence, on return from the first call to the callback/delegate, the stack becomes somewhat corrupted, causing the problems you are seeing.
</font></div></div></blockquote></div>