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/
C2981 : the dynamic form of 'keyword' is not supported with /kernel
To give a jist:
A good and simple example of doing this in user mode is here: https://stackoverflow.com/questions/1023511/multiple-interfaces-inhertience-casting-from-one-to-another/1023517
and a good explanation here : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1105r0.html (search the keyword C2981)
Out of curiosity, I tried reinterpret_cast, which obviously doesn't work, and the subsequent use of the vtable lands in random functions inside the object.
Short of building a COM like QI interface mechanism, is there a workaround?
I do not want to expose the underlying object instead of the interface, as that will require changes in many places inside the driver, neither do I like the visitor pattern described in the stackoverflow page.
If there is another elegant solution to this one, kindly suggest.
|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!|
|Developing Minifilters||24 May 2021||Live, Online|
|Writing WDF Drivers||14 June 2021||Live, Online|
|Internals & Software Drivers||2 August 2021||Live, Online|
|Kernel Debugging||27 Sept 2021||Live, Online|