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> <br>I have one problem which I can't fix gracefully, and was wondering if anyone can help me.
<br> <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> <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> <br>I would suggest a 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> <br>Tell me what you think? and if you'll change the source code and add this function<br> <br>-- <br>Truly Yours<br>Gal Szkolnik