[Winpcap-users] freeing memory allocated by pcap_stats_ex vie
cavemangsz at gmail.com
Mon Jun 6 10:08:46 GMT 2005
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.
I have one problem which I can't fix gracefully, and was wondering if anyone
can help me.
As I understand from the code, pcap_stats_ex allocates the memory for the
user, and later the user is responsible to deallocate it.
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.
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.
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
Tell me what you think? and if you'll change the source code and add this
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Winpcap-users