<div>GV -</div>
<div>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;
<div>Thank you for leading me in the right direction!</div>
<div>&nbsp;</div>
<div>Chris</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 4/12/06, <b class="gmail_sendername">Gianluca Varenni</b> &lt;<a href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</a>&gt; 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>&nbsp;</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>