The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I know this might sound like a strange question. I've waffled between being convinced one way and then the other and then to not sure and back.
Background: I'm working on an NDIS 6.0 driver for Windows Embedded Compact 7. There are minor differences, mostly relaxed requirements, but very similar to desktop Windows NDIS.
When performing the processing for preparing a NET_BUFFER (ethernet frame) for processing, I scan the MDL in the NET_BUFFER structure. I do some optimizations to determine if I need to allocate a Scatter-Gather List or if the packets are small enough, just copy them to a preallocated shared-memory buffer. Sometimes I have to create a Scatter-Gather list to process to send to my hardware. If the supplied buffer is not aligned on a 64-byte boundary (hardware requirement) I have to use both. I'm not really wanting to get into the details further than that.
Now for the question:
Is there a 1-to-1 relationship between the number of MDLs and the number of elements in the SGL? The documentation doesn't address this specifically that I can tell.
My first assumption is the relationship is 1:1. I base this upon a comment in wdm.h that states "An MDL describes pages in a virtual buffer in terms of physical pages". This would lead me to believe there is a 1:1 relationship because each SGL Element represents a group of contiguous pages and so does an MDL.
Any NDIS Internals experts have a better insight?
|Upcoming OSR Seminars|
|OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!|
|Writing WDF Drivers||7 Dec 2020||LIVE ONLINE|
|Internals & Software Drivers||25 Jan 2021||LIVE ONLINE|
|Developing Minifilters||8 March 2021||LIVE ONLINE|