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've just observed a strange behavior when writing a WDMAudio driver with Visual Studio 2019 : the IUnknown implementation is not the expected one for the COM components used in the driver.
A WDMAudio driver heavily uses COM in the Kernel with all the associated IUknown stuff. To ease the development, some helpers exist. One of them (DECLARE_STD_UNKNOWN()) will declares/defines inline the IUknown's services implementations. When the component (COM object) is instanciated, the IUknown services implementations set in the __vfptr array are not the ones defined by the helper. They are randomly set to others COM componenents' IUknown implementations.
And of course, this leads to BSOD.
Investigating thhis issue, I've found that it's related to inlined methods' addresses resolution by the compiler. To overcome this, I've expanded the DECLARE_STD_UNKNOWN() as declarations in the .h file and definitions in the .cpp file. Then everything went fine.
But this is a workaround as a the documentation only uses the helpers.
Googling around, I've found no one else with this issue.
Could you confirm the issue or is it my mistake ?
I suppose this is a matter of how the compiler handle the address of an inlined method which by nature doesn't even exist.
The same kind of driver (WDMAudio) is correctly built with the WINDDK 7600.16385.1 toolchain.
I can provide a code sample to reproduce/investigate if needed.
|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!|
|Internals & Software Drivers||15 November 2021||Live, Online|
|Writing WDF Drivers||TBD||Live, Online|
|Developing Minifilters||7 February 2022||Live, Online|
|Kernel Debugging||21 March 2022||Live, Online|