[Winpcap-users] Debugging a winpcap exception

Gianluca Varenni gianluca.varenni at cacetech.com
Wed Jan 6 12:40:39 PST 2010


--------------------------------------------------
From: "Chris Morgan" <chmorgan at gmail.com>
Sent: Wednesday, January 06, 2010 12:24 PM
To: "Gianluca Varenni" <gianluca.varenni at cacetech.com>
Cc: <winpcap-users at winpcap.org>
Subject: Re: [Winpcap-users] Debugging a winpcap exception

> On Wed, Jan 6, 2010 at 3:19 PM, Gianluca Varenni
> <gianluca.varenni at cacetech.com> wrote:
>>
>>
>> --------------------------------------------------
>> From: "Chris Morgan" <chmorgan at gmail.com>
>> Sent: Wednesday, January 06, 2010 11:56 AM
>> To: "Gianluca Varenni" <gianluca.varenni at cacetech.com>
>> Cc: <winpcap-users at winpcap.org>
>> Subject: Re: [Winpcap-users] Debugging a winpcap exception
>>
>>> On Wed, Jan 6, 2010 at 11:31 AM, Gianluca Varenni
>>> <gianluca.varenni at cacetech.com> wrote:
>>>>
>>>>
>>>> --------------------------------------------------
>>>> From: "Chris Morgan" <chmorgan at gmail.com>
>>>> Sent: Monday, January 04, 2010 1:45 PM
>>>> To: <winpcap-users at winpcap.org>
>>>> Subject: [Winpcap-users] Debugging a winpcap exception
>>>>
>>>>> I'm trying to debug some very odd behavior in a .net application that
>>>>> pinvokes winpcap to capture network packets. The behavior I see seems
>>>>> indicative of memory corruption, when I run under the vs debugger all
>>>>> events seem to stop until I do a 'break all' and continue after
>>>>> setting breakpoints. Even then things only run for a short while.
>>>>>
>>>>> I switched to using windbg and after running I see this exception
>>>>> which may or may not be the issue. I'm having trouble continuing
>>>>> because I'm having difficulty building wpcap.dll in debug mode, it
>>>>> wants packet.lib but after building packet.lib it still won't build.
>>>>
>>>> Which configuration of packet.dll did you build? Did you follow the
>>>> instructions at
>>>>
>>>> http://www.winpcap.org/docs/docs_411/html/group__compilation.html
>>>>
>>>> Have a nice day
>>>> GV
>>>>
>>>
>>> I was trying to follow the instructions there. I've been doing
>>> software development for a long time now and those instructions are
>>> pretty confusing. It might make sense to have a single solution that
>>> contains both the packet and wpcap projects and so the targets can be
>>> synchronized to avoid the problem below. Also putting the solution at
>>> a parent directory instead of a subdirectory to make it easier to
>>> find. I can submit patches if there is any interest or not if there is
>>> a good reason why things are how they are that I'm unaware of.
>>
>> I've been working on something like that, but nothing is public yet. It's 
>> a
>> bit of a pain because there is a single flavor for wpcap.dll but several
>> flavors of packet.dll (NT4, NT5, NT6) and this makes things quite 
>> complex.
>
> Ahh thats good news. It would make those instructions a lot simpler if
> one could just pick a target :-)

The truth is that there are very few people recompiling winpcap (I think 
I've received less than 5 emails in 2009 regarding the winpcap compilation) 
so providing a better documentation on how to compile the WinPcap DLLs is 
very low priority.

>
>
>>
>>>
>>> I'm building the 'Debug No Netmon' target for the packet solution. The
>>> 'Debug' target says npptools.lib can't be found.
>>>
>>
>> This is not normal. Are you using Visual Studio 2005 SP1 to build?
>>
>
> I'm running vs2008 sp1 here.

The compilation of WinPcap should be done with VS2005 SP1. The samples do 
compile with VS2008, but the source code of WinPcap itself has only been 
tested with VS2005SP1.

Have a nice day
GV

>
>
>>
>>> Looking at the linker arguments for wpcap the additional linker
>>> directory is set to '..\..\packetNtx\Dll\Project\Debug\x86' which is
>>> the output directory for the 'Debug' target of the packet solution.
>>> Can I just change this to point at the
>>> '..\..\packetNtx\Dll\Project\Debug No Netmon\x86' directory?
>>
>> Yes.
>>
>
> Cool. Let me try that.
>
> Chris 



More information about the Winpcap-users mailing list