You need to think of this as if you were creating your own packet
(NET_BUFFER) from scratch. So please read and understand the WDK topics
related to "Sending Network Data".
You will need to construct your own NET_BUFFER (for the packet) and
NET_BUFFER_LIST (the packet list).
You must modify the link and network address headers in your new NET_BUFFER
(packet) to have the correct source and destination addresses. There is no
facility at the NDIS level that will do this for you automatically.
If you study the NET_BUFFER description and buffer management functions
carefully you can associate the payload MDLs of the received NET_BUFFER with
the new NET_BUFFER that you will be sending. A simpler approach might be to
create a copy of the payload in memory that you allocate yourself.
You will need to use the context area of your new NET_BUFFER_LIST (or some
other scheme...) to keep a reference to the original received
NET_BUFFER_LIST.
When your send completes you will need to examine the send NET_BUFFER_LIST
context to fetch the original receive NET_BUFFER_LIST and return it. Then
recycle the NET_BUFFER_LIST and other resources that you allocated to send
the redirected packet.
This chat assumes that you are "forwarding" a packet to a different node on
the network (a remote host).
The Devil is in the details, which you must learn for yourself.
Good luck,
Thomas F. Divine
http://www.pcausa.com
"ttan" <> wrote in message
news:E984395D-CCAA-450F-A2FB-...
> Hi,
>
> I'm had IM driver with 2 NICs. How do I forward a packet in PtReceiveNBL?
>
> What I'm trying to do is: If I receive a packet, I do checked if this
> packet
> for me I indicated it up. If it not for me I forward the packet on to
> another node.
>
> What I have tried and didn't work:
> duplicate the packet and used
> NdisSendNetBufferLists(pAdapt->BindingHandle,
> CurrentNetBufferList,
> PortNumber,
> SendFlags);
> to forward this packet.
>
> Can someone help me to get this work? I'm really appreciated.
>
>