[Winpcap-users] some problems in closing NPF_GenericNdisWanAdapter

Deff impulse9 at rambler.ru
Fri Jun 3 17:01:45 GMT 2005


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




More information about the Winpcap-users mailing list