Doron,
Typically a WDM driver takes short cuts which can blow up in the edge cases
(like how the wdm toaster sample tracks pnp state) , but if you wrote a fully
functioning WDM driver with the same (I would say advanced) feature set, the
cycles come out to about the same.
Sorry, but the above statement looks really funny. According to MSFT side of a story, overhead that using of KMDF implies is not that significant, and I know that you will never say otherwise, no matter what and no matter how. However, it looks like in this particular case you went a way too far - you started arguing against both common sense and math…
KMDF does not have its own *actual* functionality, does it??? Instead, it just acts as a wrapper for the system exports that give an actual functionality to your driver. Therefore, if you want WDM and KMDF versions of your driver to be identical in terms of functionality, they have to make exactly the same system calls - the only difference is that WDM driver makes them directly while KMDF one goes via an extra layer, i.e. KMDF wrapper.
It is understandable that that more complex and advanced a driver is, the more system calls it makes. If calling a kernel export takes X cycles ( WDM drivers call kernel exports directly, don’t they) and KMDF wrapper adds Y extra cycles, by making N calls to KMDF functions, your are going to get (X+Y)*N cycles, as opposed to X*N cycles if you called kernel exports directly. Therefore, according to the basic rules of math, the higher the value of N, the more significant overhead becomes.
Therefore, according to the basic logic and math, the move advanced your driver is, the less beneficial use of KMDF becomes. However, you seem to claim exactly the opposite (which is hardly surprising, taking into account the fact that you are MSFT employee). The only thing left to find out is to which extent the above applies - after all, MSFT does not seem to be willing to disclose KMDF source, does it???
Anton Bassov