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
It looks like you're new here. If you want to get involved, click one of these buttons!
|Upcoming OSR Seminars|
|Developing Minifilters||29 July 2019||OSR Seminar Space|
|Writing WDF Drivers||23 Sept 2019||OSR Seminar Space|
|Kernel Debugging||21 Oct 2019||OSR Seminar Space|
|Internals & Software Drivers||18 Nov 2019||Dulles, VA|