[Winpcap-users] repeat: some problems in closingNPF_GenericNdisWanAdapter

Gianluca Varenni gianluca.varenni at gmail.com
Fri Jun 10 02:41:33 GMT 2005


Hi Deff.

We are aware of this issue affecting winpcap 3.1beta4, which is mainly 
caused by internal bugs of Microsoft NetMon, the capture engine WinPcap uses 
to sniff packets from dialup adapters. We have already added a patch  to our 
source tree (thanks Fyodor and Raymond for the help!), that basically solves 
both the memory and the thread leak under XP/2003. Under 2000, at the moment 
the fix solves the thread leak, but the memory leak is still there (and we 
are almost sure it's not due to winpcap, but rather to that *buggy* NetMon).

This fix will be available in the upcoming WinPcap 3.1.

Have a nice day
GV



----- Original Message ----- 
From: "Deff" <impulse9 at rambler.ru>
To: <winpcap-users at winpcap.org>
Sent: Thursday, June 09, 2005 12:48 PM
Subject: [Winpcap-users] repeat: some problems in 
closingNPF_GenericNdisWanAdapter


> Hello winpcap-users,
>
> I've accidentally noticed that using NPF_GenericNdisWanAdapter
> leads to some memory leaks (if they are be called like that)
> and increasing number of threads in application:
>
> Here's the code
>
> void Test()
> {
>        LPADAPTER lpAdapter;
>        if ((lpAdapter = 
> PacketOpenAdapter("\\Device\\NPF_GenericNdisWanAdapter")) && 
> (lpAdapter->hFile != INVALID_HANDLE_VALUE))
>        {
>                AtlTrace("adapter opened... ");
>                PacketCloseAdapter(lpAdapter);
>                AtlTrace("and closed\n");
>        }
> }
>
> for instance, when I launch that simple proc in proj_listener
> application (that does nothing else except calling Test())
> for 6 times I get 7 threads in my application and
> the following output (repeated 7 times):
>
> adapter opened... 'proj_listener.exe': Unloaded 
> 'H:\WINXP\system32\npp\ndisnpp.dll'
> and closed
> 'proj_listener.exe': Loaded 'H:\WINXP\system32\npp\ndisnpp.dll', No 
> symbols loaded.
> 'proj_listener.exe': Unloaded 'H:\WINXP\system32\npp\ndisnpp.dll'
> 'proj_listener.exe': Loaded 'H:\WINXP\system32\npp\ndisnpp.dll', No 
> symbols loaded.
> adapter opened... 'proj_listener.exe': Unloaded 
> 'H:\WINXP\system32\npp\ndisnpp.dll'
> and closed
> 'proj_listener.exe': Loaded 'H:\WINXP\system32\npp\ndisnpp.dll', No 
> symbols loaded.
> 'proj_listener.exe': Unloaded 'H:\WINXP\system32\npp\ndisnpp.dll'
> 'proj_listener.exe': Loaded 'H:\WINXP\system32\npp\ndisnpp.dll', No 
> symbols loaded.
> adapter opened... 'proj_listener.exe': Unloaded 
> 'H:\WINXP\system32\npp\ndisnpp.dll'
> and closed
> ...
> etc.
> -- 
> Best regards,
> Deff                          mailto:impulse9 at rambler.ru
>
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users 




More information about the Winpcap-users mailing list