[Winpcap-users] Anyone have current Packet32 source?

Dennis Drew drewcrewof2 at yahoo.com
Thu Aug 13 11:59:56 PDT 2009

Hmmm... the "find" function cannot detect that embedded within () I guess. Thanks GV...

So do you have any idea how at this low level I could determine the packet count so I could display it on my application screen? There is a byte count but that is not the same...


From: Gianluca Varenni <gianluca.varenni at cacetech.com>
To: winpcap-users at winpcap.org
Sent: Thursday, August 13, 2009 11:35:04 AM
Subject: Re: [Winpcap-users] Anyone have current Packet32 source?

The code in the compiled DLL is the same as the one that we ship as a source package (I'm the person who builds the packages). Remember that the same sources generate different binaries, depending on the build configuration you use (NT4, NT5x, NT6x). 
The code you sent actually makes use of the Sync flag, here
Res = (BOOLEAN)DeviceIoControl(AdapterObject->hFile,
(PCHAR)PacketBuff + TotBytesTransfered,
Size - TotBytesTransfered,
Have a nice day
----- Original Message ----- 
>From: Dennis Drew 
>To: winpcap-users at winpcap.org 
>Sent: Thursday, August 13, 2009 11:03 AM
>Subject: [Winpcap-users] Anyone have current Packet32 source?
>Anyone have current Packet32 source?
>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 "do{" must be broken.
>Any help on pointing me to a fully functional packet dll will be appreciated.
>Dennis (The other Dennis!)
>INT PacketSendPackets( EMCallBack CB, LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync)
>DWORD BytesTransfered, TotBytesTransfered=0;
>LARGE_INTEGER StartTicks, CurTicks, TargetTicks, TimeFreq;
>TRACE_ENTER(structtimeval BufStartTime;intnCt = 0, nCount = 0;"PacketSendPackets");#ifdef
>}HAVE_WANPACKET_APIif(AdapterObject->Flags == INFO_FLAG_NDISWAN_ADAPTER)"PacketSendPackets: packet sending not allowed on wan adapters");"PacketSendPackets");return0;#endif// HAVE_WANPACKET_API#ifdefHAVE_NPFIM_APIif(AdapterObject->Flags == INFO_FLAG_NPFIM_DEVICE)
>TRACE_PRINT("PacketSendPackets: packet sending not allowed on npfim adapters");
>return 0;
>}#endif// HAVE_NPFIM_API#ifdef
>}HAVE_AIRPCAP_APIif(AdapterObject->Flags == INFO_FLAG_AIRPCAP_CARD)"PacketSendPackets: packet sending not allowed on airpcap adapters");"PacketSendPackets");return0;#endif// HAVE_AIRPCAP_API{if(AdapterObject->Flags == INFO_FLAG_NDIS_ADAPTER)// Obtain starting timestamp of the bufferBufStartTime.tv_sec = ((
>BufStartTime.tv_usec = ((structtimeval*)(PacketBuff))->tv_sec;structtimeval*)(PacketBuff))->tv_usec;// Retrieve the reference time countersQueryPerformanceCounter(&StartTicks);
>CurTicks.QuadPart = StartTicks.QuadPart;do{// Send the data to the driver//TODO Res is NEVER checked, this is REALLY bad.Res = (BOOLEAN)DeviceIoControl(AdapterObject->hFile,
>(PCHAR)PacketBuff + TotBytesTransfered,
>Size - TotBytesTransfered,
>TotBytesTransfered += BytesTransfered;// Exit from the loop on termination or errorif(TotBytesTransfered >= Size || Res != TRUE)break;// calculate the time interval to wait before sending the next packetTargetTicks.QuadPart = StartTicks.QuadPart +
>(TimeFreq.QuadPart) / 1000000;
>}structtimeval*)((PCHAR)PacketBuff + TotBytesTransfered))->tv_sec - BufStartTime.tv_sec) * 1000000 +structtimeval*)((PCHAR)PacketBuff + TotBytesTransfered))->tv_usec - BufStartTime.tv_usec)) * // Wait until the time interval has elapsedQueryPerformanceCounter(&CurTicks);
>}while( CurTicks.QuadPart <= TargetTicks.QuadPart )while(TRUE);else{
>TotBytesTransfered = 0;
>}"Request to write on an unknown device type (%u)", AdapterObject->Flags);"PacketSendPackets");returnTotBytesTransfered; 
>Winpcap-users mailing list
>Winpcap-users at winpcap.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20090813/ff1f4caf/attachment.htm 

More information about the Winpcap-users mailing list