[Winpcap-users] pcap_list_datalinks() - how to free

Gianluca Varenni gianluca.varenni at cacetech.com
Tue Apr 27 08:33:16 PDT 2010


The function was missing from the exports of wpcap.dll. The next release of WinPcap will have it.

At the moment there's no way to use it.

Have a nice day
GV


From: Boaz Brickner 
Sent: Saturday, April 24, 2010 2:01 AM
To: winpcap-users at winpcap.org 
Subject: Re: [Winpcap-users] pcap_list_datalinks() - how to free


Hi,

While working on Pcap.Net (http://pcapdotnet.codeplex.com), I've encountered a problem freeing the allocated memory that was allocated using pcap_list_datalinks().

I saw the 2008 issue - so I'm replying to it.

There is a function
void    pcap_free_datalinks(int *);
in pcap.h, but I couldn't resolve it using the .lib file (while I have no problem with pcap_list_datalinks) and there is no documentation about it in
http://www.winpcap.org/docs/docs_411/html/group__wpcapfunc.html

What should I do in order to use this function?

Thank you.

Boaz.

-----------------------------------------------------------

Guy Harris guy at alum.mit.edu
Mon May 26 20:00:05 GMT 2008

Previous message: [Winpcap-users] pcap_list_datalinks() - how to free
Next message: [Winpcap-users] Wincap and fake packages
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

________________________________

Gianluca Varenni wrote:

> In the next days I will try to commit an implementation of 
> pcap_free_datalinks() in the libpcap source tree.

I've checked one into the main and 1.0 branches (along with a man page).


----- Original Message ----- 
From: "Esmond Pitt" <esmond.pitt at bigpond.com>
To: <winpcap-users at winpcap.org>
Sent: Tuesday, May 20, 2008 11:35 PM
Subject: [Winpcap-users] pcap_list_datalinks() - how to free


> The documentation for the pcap_list_datalinks() function says that the 
> user
> is responsible for freeing the array of integers allocated by the 
> function.
>
> As no specific function to do that is provided, presumably we are supposed
> to use free(3). But in a DLL environment this is of course most 
> problematic,
> and indeed causes SEGVs when I do it.
>
> I think you need to add a pcap_free_datalinks() function. Or is there some
> other solution?

No other solution. This function was created within the linux/unix 
environment, where it's safe to call malloc/free from across DLLs/shared 
object boundaries (while it's not under Windows with the MS CRT).

In the next days I will try to commit an implementation of 
pcap_free_datalinks() in the libpcap source tree.

Have a nice day
GV

>
> EJP
>
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users 



--------------------------------------------------------------------------------


_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20100427/a2b12072/attachment-0001.htm 


More information about the Winpcap-users mailing list