Hello All,
I am developing an intermediate driver based on passthru sample. I also
use code from "Extending passthru part 1 & 2". I need to check entire
received packets before I pass it upper - simply filter also packet
payload. I receive almost all packets in PtReceive routine. My
lookaheadbuffer is max 512 - when packet lenght is over 512 then
PacketSize > LookahedBufferSize. I have few questions :
1. Is there a way to receive all packets in PtReceivePacket, not in
PtReceive. Can I change it or it just depends on my NIC.
2. Can I implement NdisTranferData and all its stuff for PtReceive in
the same way as its in ndisuio sample - or should I do it in a
different way because passthru is intermediate and ndisuio is protocol
driver.
3. NdisTranferData should be before or after NdisMEthIndicateReceive,
or just instead of it?

Best regards, Matt

Re: NdisTransferData in Passthru sample by Stephan

Stephan
Fri May 19 08:18:48 CDT 2006

mathias_k14@yahoo.com wrote:
> 1. Is there a way to receive all packets in PtReceivePacket, not in
> PtReceive. Can I change it or it just depends on my NIC.

It only depends on the NDIS miniport driver of your NIC.

> 2. Can I implement NdisTranferData and all its stuff for PtReceive in
> the same way as its in ndisuio sample - or should I do it in a
> different way because passthru is intermediate and ndisuio is protocol
> driver.

An intermediate (IM) driver implements both a miniport and a protocol.
There is nothing special about the protocol or miniport part of an IM.

> 3. NdisTranferData should be before or after NdisMEthIndicateReceive,
> or just instead of it?

I don't get your point. PASSTHRU and other NDIS samples in the DDK
handle "TransferData" correctly:

NIC miniport
-NdisMEthIndicateReceive()-> NDIS
-PtReceive()-> PASSTHRU
-NdisMEthIndicateReceive-> NDIS
-ProtocolReceive()-> other protocol(s)
-NdisTransferData()-> NDIS
-MPTransferData()-> PASSTHRU
-NdisTransferData()-> NDIS
-MiniportTransferData()-> NIC miniport

Stephan


Re: NdisTransferData in Passthru sample by Maxim

Maxim
Fri May 19 12:35:11 CDT 2006

> 1. Is there a way to receive all packets in PtReceivePacket, not in
> PtReceive. Can I change it or it just depends on my NIC.

No. Depends on NIC and its current load. Some NICs will always indicate to
PtReceive.

> 3. NdisTranferData should be before or after NdisMEthIndicateReceive,

After, only in the case if not all packet is within the lookahead indicated by
NdisMEthIndicateReceive.

Then you must allocate memory for a packet, NDIS_BUFFER to describe this
memory, NDIS_PACKET with this buffer, and call NdisTransferData.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com