Re: Question about modifing the NDIS packet?
From: Rajesh Gupta (guptar_at_gmail.com)
Date: 07/07/04
- Next message: Rajesh Gupta: "Retrieving the MAC address of remote machine in NDIS IM driver?"
- Previous message: Shalini: "ZwCreateFile problem"
- In reply to: William Ingle: "Re: Question about modifing the NDIS packet?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Jul 2004 10:16:19 -0700
Thanks a lot Bill,
I was able to sucessfully modify the packet. thanks a lot for your response.
Rajesh
"William Ingle" <williamingle@comcast.net> wrote in message
news:l2eGc.28809$Oq2.8881@attbi_s52...
> Rajesh
>
> A complete answer to your question requires us to know the OS you are
> targeting because there are some differences between win98/ME, Win2k,
WinXP
> and Win2003
>
> In general you need to allocate your own buffers if you are re-trasmitting
a
> packet FROM a miniport BACK of the net. If your driver is an intermediate
> driver and it merely modifies the packet on its way to the protocol driver
> or to a miniport then you only need to allocate a new buffer if
>
> 1. you driver changes the length of the ndis packet buffer - here you
> allocate the appropriate packet buffer, not the packet structure
> 2. your driver changes the length of the ip header or oob data - here you
> allocate the data buffer
> 3. your driver is not a registered ndis driver. In general ndis doesn't
> notify a miniport or protocol to release buffers until all consumers have
> indicated they are done with it. But you would have to be a registered
> consumer (i.e. a miniport, protocol or intermediate driver) so ndis knew
you
> were part of the data flow.
>
> If you are merely querying the packet from ndis through IoCallDriver or
> DeviceIoControl then ndis assumes you are done with it when you return.
> Futhermore modifications you make to the ndis packet may or may not be
> passed on to other ndis drivers. This is why you should register your
> driver with ndis during initialization and support one of the ndis driver
> types.
>
> This is a simplification because protocols often allocate data in their
own
> buffer pools and perform buffer integrity checks (like checking the
internal
> pointers of complex structures). Miniports often use memory on the card
to
> reduce the number of buffer copies. So if you are going to change some of
> the internal pointers in the ndis packet structure you may want to create
> your own copy if you can't re-assign the original pointer value when the
> consumer returns. I haven't played with this in over a year so please
> perform your own tests.
>
> Have a great day
> Bill
>
> "Rajesh Gupta" <guptar@gmail.com> wrote in message
> news:uXzZ5dWWEHA.3988@tk2msftngp13.phx.gbl...
> > Hi everyone,
> >
> > I am trying to modify the NDIS packet. Do i need to allocate new
buffers?
> >
>
>
- Next message: Rajesh Gupta: "Retrieving the MAC address of remote machine in NDIS IM driver?"
- Previous message: Shalini: "ZwCreateFile problem"
- In reply to: William Ingle: "Re: Question about modifing the NDIS packet?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|