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/
So ZFS has an idea of "hostid", just a 32bit unique identifier that is stamped into the pool, so it can issue a warning when
you attempt to import pool on a "different" host. Hostid should stay the same between reboots, but where to draw the line in the sand
beyond that is flexible (to me). Reinstalling OS could change it, or changing parts of the hardware.
Anyway, I looked around for various things to use as hostid, and settled on
I then use fnv_32a hash, and set it. All is well, I thought.
Then I rebooted with my driver installed and unfortunately RtlQueryRegistryValues() returns
My guess is that not all of the Registry is loaded and ready to be used during boot. My driver uses
ServiceType = 1
StartType = 1
ErrorControl = 1
LoadOrderGroup = "File System"
Naturally, I could simply probe until it is available, then set it, if I was desperate. But perhaps
there is an event or callback that happens when the Registry is available, that I could plug into and
do all my Registry reads there (I only have one other,
"\REGISTRY\MACHINE\HARDWARE\RESOURCEMAP\System Resources\Physical Memory"
which thankfully appears to work, even during boot).
But after Googling for a bit, it seems perhaps I should not be reading the Registry at all? Would
reading MachineGuid be considered "uncool" ?
Another option would be to use the Driver's own Registry (currently not used at all), and if hostid
does not exist, randomly generate one, and write it in for future reboots. (Assuming I am allowed to write to it
during boot, or I have the same "event" question as above.)
What is recommended here, as best practise? I rely on you fine Windows-devops to show
me the right path
|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||30 Nov 2020||LIVE ONLINE|
|Writing WDF Drivers||7 Dec 2020||LIVE ONLINE|
|Developing Minifilters||Early 2021||LIVE ONLINE|