Problem about ProtocolReceive()

Hi everyone,

I came across a problem when I wrote a protocol driver. From Win2k DDK, I understand if I receive a packet from ProtocolRecievePacket(), I can hold the packet by returning a non-zero to the lower driver. And then I can call NdisReturnPackets() later on, if I want to return the packet. But How about if I receive packet from PorotocolReceive() function. Can I hold a packet received from ProtocolReceive()? If I can’t get the ownership of this packet, then that means I have to do a memory copy!!!
Do I have no choice, except memory copy???

Thanks in advance!!!

Elton

The protocol owns the packet indicated by ProtocolReceive. The miniport does not know on this NDIS_PACKET at all.
The ProtocolReceive path must a) check the header in the lookahead data b) build NDIS_PACKET and NDIS_BUFFER c) copy the lookahead there d) call NdisTransferData.
In the TransferDataComplete function, NDIS_PACKET is yours and you can do anything with it. NDIS does not know on it at all.

Max

----- Original Message -----
From: Li Dong
To: NT Developers Interest List
Sent: Tuesday, April 16, 2002 8:58 AM
Subject: [ntdev] Problem about ProtocolReceive()

Hi everyone,

I came across a problem when I wrote a protocol driver. From Win2k DDK, I understand if I receive a packet from ProtocolRecievePacket(), I can hold the packet by returning a non-zero to the lower driver. And then I can call NdisReturnPackets() later on, if I want to return the packet. But How about if I receive packet from PorotocolReceive() function. Can I hold a packet received from ProtocolReceive()? If I can’t get the ownership of this packet, then that means I have to do a memory copy!!!
Do I have no choice, except memory copy???

Thanks in advance!!!

Elton

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

You cannot hold a packet received by ProtocolReceive. This packet
(assuming you called NdisGetReceivedPacket) is only valid in the context
of ProtocolReceive. Unless you are simply inspecting packets (in other
words you do not modify it in any way), you must make a copy.

Dave

Li Dong wrote:

Hi everyone, I came across a problem when I wrote a protocol driver.
From Win2k DDK, I understand if I receive a packet from
ProtocolRecievePacket(), I can hold the packet by returning a non-zero
to the lower driver. And then I can call NdisReturnPackets() later on,
if I want to return the packet. But How about if I receive packet from
PorotocolReceive() function. Can I hold a packet received from
ProtocolReceive()? If I can’t get the ownership of this packet, then
that means I have to do a memory copy!!!Do I have no choice, except
memory copy??? Thanks in advance!!! Elton—
You are currently subscribed to ntdev as: xxxxx@okena.com
To unsubscribe send a blank email to %%email.unsub%%

Thank u very much!!!
----- Original Message -----
From: Maxim S. Shatskih
To: NT Developers Interest List
Sent: Tuesday, April 16, 2002 8:07 PM
Subject: [ntdev] Re: Problem about ProtocolReceive()

The protocol owns the packet indicated by ProtocolReceive. The miniport does not know on this NDIS_PACKET at all.
The ProtocolReceive path must a) check the header in the lookahead data b) build NDIS_PACKET and NDIS_BUFFER c) copy the lookahead there d) call NdisTransferData.
In the TransferDataComplete function, NDIS_PACKET is yours and you can do anything with it. NDIS does not know on it at all.

Max

----- Original Message -----
From: Li Dong
To: NT Developers Interest List
Sent: Tuesday, April 16, 2002 8:58 AM
Subject: [ntdev] Problem about ProtocolReceive()

Hi everyone,

I came across a problem when I wrote a protocol driver. From Win2k DDK, I understand if I receive a packet from ProtocolRecievePacket(), I can hold the packet by returning a non-zero to the lower driver. And then I can call NdisReturnPackets() later on, if I want to return the packet. But How about if I receive packet from PorotocolReceive() function. Can I hold a packet received from ProtocolReceive()? If I can’t get the ownership of this packet, then that means I have to do a memory copy!!!
Do I have no choice, except memory copy???

Thanks in advance!!!

Elton

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntdev as: xxxxx@cwc.nus.edu.sg
To unsubscribe send a blank email to %%email.unsub%%

Thank you very much!!!
----- Original Message -----
From: Dave McCowan
To: NT Developers Interest List
Sent: Tuesday, April 16, 2002 8:11 PM
Subject: [ntdev] Re: Problem about ProtocolReceive()

You cannot hold a packet received by ProtocolReceive. This packet (assuming you called NdisGetReceivedPacket) is only valid in the context of ProtocolReceive. Unless you are simply inspecting packets (in other words you do not modify it in any way), you must make a copy.
Dave

Li Dong wrote:

Hi everyone, I came across a problem when I wrote a protocol driver. From Win2k DDK, I understand if I receive a packet from ProtocolRecievePacket(), I can hold the packet by returning a non-zero to the lower driver. And then I can call NdisReturnPackets() later on, if I want to return the packet. But How about if I receive packet from PorotocolReceive() function. Can I hold a packet received from ProtocolReceive()? If I can’t get the ownership of this packet, then that means I have to do a memory copy!!!Do I have no choice, except memory copy??? Thanks in advance!!! Elton—
You are currently subscribed to ntdev as: xxxxx@okena.com
To unsubscribe send a blank email to %%email.unsub%%

You are currently subscribed to ntdev as: xxxxx@cwc.nus.edu.sg
To unsubscribe send a blank email to %%email.unsub%%