<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV>Anyone have current Packet32 source?</DIV>
<DIV> </DIV>
<DIV>The code I see in the packetNtx download is not the same as the code supplied as a compiled .dll. This code section does not repond the the Sync flag and it also runs VERY, very slow... like one packet per second so the loop at "<FONT size=2><FONT color=#0000ff>do</FONT>{" must be broken.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Any help on pointing me to a fully functional packet dll will be appreciated.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Thnaks,</FONT></DIV>
<DIV><FONT size=2>Dennis (The other Dennis!)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<P>INT PacketSendPackets( EMCallBack CB, LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync)</P>
<P>{</P>
<P>BOOLEAN Res;</P>
<P>DWORD BytesTransfered, TotBytesTransfered=0;</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>struct</FONT></FONT><FONT size=2> timeval BufStartTime;</P>
<P>LARGE_INTEGER StartTicks, CurTicks, TargetTicks, TimeFreq;</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> nCt = 0, nCount = 0;</P>
<P>TRACE_ENTER(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"PacketSendPackets"</FONT></FONT><FONT size=2>);</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>#ifdef</FONT></FONT><FONT size=2> HAVE_WANPACKET_API</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>(AdapterObject->Flags == INFO_FLAG_NDISWAN_ADAPTER)</P>
<P>{</P>
<P>TRACE_PRINT(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"PacketSendPackets: packet sending not allowed on wan adapters"</FONT></FONT><FONT size=2>);</P>
<P>TRACE_EXIT(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"PacketSendPackets"</FONT></FONT><FONT size=2>);</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> 0;</P>
<P>}</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>#endif</FONT></FONT><FONT size=2> </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// HAVE_WANPACKET_API</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>#ifdef</FONT></FONT><FONT size=2> HAVE_NPFIM_API</P></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2>
<P>if(AdapterObject->Flags == INFO_FLAG_NPFIM_DEVICE)</P>
<P>{</P>
<P>TRACE_PRINT("PacketSendPackets: packet sending not allowed on npfim adapters");</P>
<P>TRACE_EXIT("PacketSendPackets");</P>
<P>return 0;</P>
<P>}</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>#endif</FONT></FONT><FONT size=2> </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// HAVE_NPFIM_API</P></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>#ifdef</FONT></FONT><FONT size=2> HAVE_AIRPCAP_API</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>(AdapterObject->Flags == INFO_FLAG_AIRPCAP_CARD)</P>
<P>{</P>
<P>TRACE_PRINT(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"PacketSendPackets: packet sending not allowed on airpcap adapters"</FONT></FONT><FONT size=2>);</P>
<P>TRACE_EXIT(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"PacketSendPackets"</FONT></FONT><FONT size=2>);</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> 0;</P>
<P>}</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>#endif</FONT></FONT><FONT size=2> </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// HAVE_AIRPCAP_API</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (AdapterObject->Flags == INFO_FLAG_NDIS_ADAPTER)</P>
<P>{</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Obtain starting timestamp of the buffer</P></FONT></FONT><FONT size=2>
<P>BufStartTime.tv_sec = ((</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>struct</FONT></FONT><FONT size=2> timeval*)(PacketBuff))->tv_sec;</P>
<P>BufStartTime.tv_usec = ((</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>struct</FONT></FONT><FONT size=2> timeval*)(PacketBuff))->tv_usec;</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Retrieve the reference time counters</P></FONT></FONT><FONT size=2>
<P>QueryPerformanceCounter(&StartTicks);</P>
<P>QueryPerformanceFrequency(&TimeFreq);</P>
<P>CurTicks.QuadPart = StartTicks.QuadPart;</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>do</FONT></FONT><FONT size=2>{</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Send the data to the driver</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//TODO Res is NEVER checked, this is REALLY bad.</P></FONT></FONT><FONT size=2>
<P>Res = (BOOLEAN)DeviceIoControl(AdapterObject->hFile,</P>
<P>(Sync)?BIOCSENDPACKETSSYNC:BIOCSENDPACKETSNOSYNC,</P>
<P>(PCHAR)PacketBuff + TotBytesTransfered,</P>
<P>Size - TotBytesTransfered,</P>
<P>NULL,</P>
<P>0,</P>
<P>&BytesTransfered,</P>
<P>NULL);</P>
<P>TotBytesTransfered += BytesTransfered;</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Exit from the loop on termination or error</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>(TotBytesTransfered >= Size || Res != TRUE)</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>break</FONT></FONT><FONT size=2>;</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// calculate the time interval to wait before sending the next packet</P></FONT></FONT><FONT size=2>
<P>TargetTicks.QuadPart = StartTicks.QuadPart +</P>
<P>(LONGLONG)</P>
<P>((((</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>struct</FONT></FONT><FONT size=2> timeval*)((PCHAR)PacketBuff + TotBytesTransfered))->tv_sec - BufStartTime.tv_sec) * 1000000 +</P>
<P>(((</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>struct</FONT></FONT><FONT size=2> timeval*)((PCHAR)PacketBuff + TotBytesTransfered))->tv_usec - BufStartTime.tv_usec)) *</P>
<P>(TimeFreq.QuadPart) / 1000000;</P>
<P></P>
<P></FONT><FONT size=2> </P>
<P>}</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Wait until the time interval has elapsed</P></FONT></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>while</FONT></FONT><FONT size=2>( CurTicks.QuadPart <= TargetTicks.QuadPart )</P>
<P>QueryPerformanceCounter(&CurTicks);</P>
<P>}</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>while</FONT></FONT><FONT size=2>(TRUE);</P>
<P>}</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2>
<P>{</P>
<P>TRACE_PRINT1(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Request to write on an unknown device type (%u)"</FONT></FONT><FONT size=2>, AdapterObject->Flags);</P>
<P>TotBytesTransfered = 0;</P>
<P>}</P>
<P>TRACE_EXIT(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"PacketSendPackets"</FONT></FONT><FONT size=2>);</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> TotBytesTransfered;</P>
<P>}</P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>
<P> </P></FONT></FONT></DIV></div></body></html>