[Winpcap-users] pcap_close crash when used in a DLL

MARTIN, Jean-loic (FR - SX) jean-loic.martin at fr.meggitt.com
Thu Feb 19 11:28:32 UTC 2015


As my attachment have been dropped, i forward this email with unzipped Code::Blocks project.
Main.cpp and main.h are the source code files for the DLL and main.c is the source code file for the application.
The others files are the Code::Blocks projects (V12.11).

Hello gents,

I'm facing a problem with pcap_close.

I have a DLL where I use pcap_open and pcap_close.
And an executable program which uses this DLL.
The problem appears only when I uses the \device\NPF_GenericDialupAdapter .
With a real adapter there is no problem.

Also , when I use the same source code in an application (without a DLL) there is no problem.
So the problem comes from using pcap_close in a DLL with the \device\NPF_GenericDialupAdapter

I have attached the source code and project for Code::Blocks for both DLL and application.

Does someone facing the same problem ?

To explain what is done in the DLL and in the application :

1.       The application does only a call to EdrEth_OpenDevice(0) , wait 1s, and call to EdrEth_CloseDevice();

The crash appears after the call to EdrEth_CloseDevice. Crash appears in debug mode and release mode.

Everything is ok when I debug the DLL (adhandle variable is correctly set).

[cid:image001.png at 01D04C3F.8EBA9EB0]



2.       The DLL does the pcap_open in EdrEth_OpenDevice function and the pcap_close in the EdrEth_CloseDevice function.


Last information, I use a PC with Windows XP SP3.


Best regards / Cordialement,

Jean-Loïc MARTIN
Software engineer/ Ingénieur développement logiciel

Meggitt Sensing Systems "MSS"
196 rue Louis Rustin
BP63108
Archamps Technopole
74166 Archamps
FRANCE

(Ligne directe) +33 (0) 4 56 66 03 51 (standard) +33 (0) 4 50 95 43 55 Poste : 519
jean-loic.martin at fr.meggitt.com<mailto:jean-loic.martin at fr.meggitt.com>

www.meggitt.com<http://www.meggitt.com>
www.sensorex.fr<http://www.sensorex.fr>
P N'imprimez que si necessaire / Print only if necessary

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20150219/3d0d9aca/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 13760 bytes
Desc: image001.png
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20150219/3d0d9aca/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DLL_pcap_close_crash.cbp
Type: application/octet-stream
Size: 1435 bytes
Desc: DLL_pcap_close_crash.cbp
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20150219/3d0d9aca/attachment-0002.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.cpp
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20150219/3d0d9aca/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.h
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20150219/3d0d9aca/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test_pcap_close_crash.cbp
Type: application/octet-stream
Size: 1152 bytes
Desc: Test_pcap_close_crash.cbp
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20150219/3d0d9aca/attachment-0003.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.c
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20150219/3d0d9aca/attachment-0001.c>


More information about the Winpcap-users mailing list