Hello.<br>I've been using WinPCap for a long time now with a C# application we constructed over here (= my work place), and am very pleased with it.<br>&nbsp;<br>I have one problem which I can't fix gracefully, and was wondering if anyone can help me.
<br>&nbsp;<br>As I understand from the code, pcap_stats_ex allocates the memory for the user, and later the user is responsible to deallocate it.<br>My problem is that I am accesing wpcap.dll through PInvoke and don't have access to the memory managment functions used in the pcap dll.
<br>&nbsp;<br>Another issue, is if used from another exe or dll (this time unmanaged regular C++ or C) if the compiler/libraries are different from what winpcap.dll was built with they would not be compatible when freeing memory. 
<br>&nbsp;<br>I would suggest a&nbsp;solution: Use a free_stats function in wpcap.lib which frees the allocated buffer. The user still deallocates the structure, but does it via a function call to the dll. This ensures deallocation is done correctly. 
<br>&nbsp;<br>Tell me what you think? and if you'll change the source code and add this function<br>&nbsp;<br>-- <br>Truly Yours<br>Gal Szkolnik