One note: if you are operating on the receive path (which I inferred from the phrases “a packet from an NBL received …” and “the NB’s that are to be sent up”), and if you are located just underneath TCPIP, then you don’t need to worry about more than one NB per NBL.
The recently-clarified verbiage on http://msdn.microsoft.com/en-us/library/ff554851(VS.85).aspx is illuminating:
“The typical Ethernet miniport must assign exactly one NET_BUFFER structure to a NET_BUFFER_LIST structure when receiving data. This restriction applies only to the Ethernet receive path; it’s not applicable to Native Wifi or NDIS in general.”
If you meet these conditions, then that should rather greatly simplify your algorithm, since 1 NET_BUFFER is always easier to handle than n NET_BUFFERs!
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Friday, October 22, 2010 10:08 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to drop a Network Buffer from a NBL
I am not sure I know what you mean by ‘copy the pointer over’ but so long as you return what you get, you are fine.
If you know which NBs you wish to omit, you can remove them from the indicated NBL before cloning it, I suppose, then put them back immediately
after the clone operation. The original NBL will be ‘as indicated’ the
clone NBL will have only the NBs (clones of them actually) you wish to
indicate. I think that is legal. But for sure, Thomas’ approach works
because I know he has tested it!
Good Luck,
Dave Cattley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@spherecom.com
Sent: Friday, October 22, 2010 12:39 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How to drop a Network Buffer from a NBL
Hi Dave,
I was suggesting that I could use NdisAllocateNetBufferAndNetBufferList() to create an empty NBL then iterate over the original NBL copying the pointers to the NB’s that are to be sent up
When the NBL is returned I would reset all the NB pointers back to NULL and call NdisFreeNetBufferList() then send the original NBL back to the driver as usual.
Am I missing something?
Alan
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer