<div dir="ltr">Thanks for you answer, Guy.<div><br></div><div>Is there some documentation or a usage example for pcap_hopen_offline()?</div><div><br></div><div>Thanks again,</div><div><br></div><div>Boaz.<br><br><div class="gmail_quote">
On Sat, Jan 28, 2012 at 04:00, Guy Harris <span dir="ltr"><<a href="mailto:guy@alum.mit.edu">guy@alum.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On Jan 27, 2012, at 2:34 AM, Boaz Brickner wrote:<br>
<br>
> In Pcap.Net (<a href="http://pcapdot.net" target="_blank">http://pcapdot.net</a>), I'm using pcap_fopen_offline() to open files.<br>
> Since this function assumes the FILE* argument it gets is already open, does calling pcap_close() on its output also closes that FILE*<br>
<br>
</div>Yes, it does.<br>
<br>
And, yes, this does, I think, run the risk that you'll open the FILE * with one version of the C runtime library and have WinPcap close it with another version, which I am told<br>
<br>
1) can happen<br>
<br>
and<br>
<br>
2) can cause crashes and other problems.<br>
<br>
(I come from the UN*X world, where that sort of mismatched-versions-of-the-C-library problem simply doesn't happen. You can allocate stuff in a library and free it in the main program or another library, and open a FILE * in the main program and close it in a library or open it in a library and close it in the main program or another library, and all the operations will be done by the same version of the C library.)<br>
<br>
If this is causing problems, you might want to see whether you can use pcap_hopen_offline() with a HANDLE instead.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Winpcap-users mailing list<br>
<a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br>
<a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
</div></div></blockquote></div><br></div></div>