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 written a virtual display driver, and I'm using SwDeviceCreate to enumerate/create multiple instances. After each device is started (CM_NOTIFY_ACTION_DEVICEINSTANCESTARTED), Windows recognizes it and does something (based up cached info or lack thereof in the registry). Since I'm creating multiple instances, there's considerable chaos as Windows encounters these new displays and potentially adds them to the desktop.
Enumerating/creating these devices seems to take considerably longer than just enabling a previously-created device in the disabled state. What I'd like to do is defer all of that "Windows desktop chaos" until I have all adapters created in a disabled state, then quickly enable them and set their display settings all at once.
I could call
CM_Disable_DevNode right after I see the Started notification, but I've seen timing issues previously where such calls sometimes fail silently.
SwDeviceCreate to enumerate the devices, and Microsoft's documentation is really minimal. You can pass in an array of
DEVPROPERTIES to set the device's initial state, but looking through the
DEVPKEY_Device_* values, I don't see anything obvious that would govern whether the device is initially disabled or enabled.
Can anyone offer suggestions, or point me to prior art? (Google for SwDeviceCreate, and you'll pretty much hear crickets)
Windows Developer since 1989
|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!||Kernel Debugging||30 Mar 2020||OSR Seminar Space|
|Developing Minifilters||15 Jun 2020||LIVE ONLINE|
|Writing WDF Drivers||22 June 2020||LIVE ONLINE|
|Internals & Software Drivers||28 Sept 2020||Dulles, VA|