<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Webdings;
panose-1:5 3 1 2 1 5 9 6 7 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Texte de bulles Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.TextedebullesCar
{mso-style-name:"Texte de bulles Car";
mso-style-priority:99;
mso-style-link:"Texte de bulles";
font-family:"Tahoma","sans-serif";}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:491216824;
mso-list-type:hybrid;
mso-list-template-ids:1298038328 67895311 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level4
{mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level7
{mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>As my attachment have been dropped, i forward this email with unzipped Code::Blocks project.</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Main.cpp and main.h are the source code files for the DLL and main.c is the source code file for the application.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The others files are the Code::Blocks projects (V12.11).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><i>Hello gents,<o:p></o:p></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><o:p> </o:p></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>I’m facing a problem with pcap_close.<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>I have a DLL where I use pcap_open and pcap_close.<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>And an executable program which uses this DLL.<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>The problem appears only when I uses the \device\NPF_GenericDialupAdapter .<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>With a real adapter there is no problem.<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Also , when I use the same source code in an application (without a DLL) there is no problem.<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>So the problem comes from using pcap_close in a DLL with the \device\NPF_GenericDialupAdapter<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>I have attached the source code and project for Code::Blocks for both DLL and application.<o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>Does someone facing the same problem ? <o:p></o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:35.4pt'><i><span lang=EN-US>To explain what is done in the DLL and in the application :<o:p></o:p></span></i></p><p class=MsoListParagraph style='margin-left:71.4pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><i><span lang=EN-US><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'> </span></span></span></i><![endif]><i><span lang=EN-US>The application does only a call to EdrEth_OpenDevice(0) , wait 1s, and call to EdrEth_CloseDevice();<o:p></o:p></span></i></p><p class=MsoListParagraph style='margin-left:71.4pt'><i><span lang=EN-US>The crash appears after the call to EdrEth_CloseDevice. Crash appears in debug mode and release mode.<o:p></o:p></span></i></p><p class=MsoListParagraph style='margin-left:71.4pt'><i><span lang=EN-US>Everything is ok when I debug the DLL (adhandle variable is correctly set).<o:p></o:p></span></i></p><p class=MsoListParagraph style='text-indent:34.8pt'><img width=418 height=271 id="Image_x0020_2" src="cid:image001.png@01D04C3F.8EBA9EB0"><span lang=EN-US><o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US><o:p> </o:p></span></p><p class=MsoListParagraph style='margin-left:53.4pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><i><span lang=EN-US><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'> </span></span></span></i><![endif]><i><span lang=EN-US>The DLL does the pcap_open in EdrEth_OpenDevice function and the pcap_close in the EdrEth_CloseDevice function.<o:p></o:p></span></i></p><p class=MsoListParagraph style='margin-left:53.4pt'><i><span lang=EN-US><o:p> </o:p></span></i></p><p class=MsoNormal style='margin-left:17.4pt'><i><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Last information, I use a PC with Windows XP SP3.<o:p></o:p></span></i></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Best regards / Cordialement,</span><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br>Jean-Loïc MARTIN<br>Software engineer/ Ingénieur développement logiciel</span><br><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'><br>Meggitt Sensing Systems "MSS"<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>196 rue Louis Rustin<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'>BP63108</span></b><span style='font-size:7.5pt;font-family:"Arial","sans-serif"'><br>Archamps Technopole<br>74166 Archamps<br>FRANCE</span><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br>(Ligne directe) +33 (0) 4 56 66 03 51 (standard) +33 (0) 4 50 95 43 55 Poste : 519<br><a href="mailto:jean-loic.martin@fr.meggitt.com">jean-loic.martin@fr.meggitt.com</a></span><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br><a href="http://www.meggitt.com">www.meggitt.com</a><br><a href="http://www.sensorex.fr">www.sensorex.fr</a></span><span style='font-size:18.0pt;font-family:Webdings;color:#00A000'><br>P</span> <span style='font-size:7.5pt;font-family:"Verdana","sans-serif";color:#00A000'>N'imprimez que si necessaire / Print only if necessary</span><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>