There might be some other way to get to these values that doesn't
involve reading the current user registry settings, but in terms of
reading HKEY_CURRENT_USER from a driver, AFAIK the only way to do that
is to do it in the context of a user thread (mostly because otherwise,
how would the driver know which "user" is meant by "\\Registry\\User"?).
The DDK says you can just pass in RTL_REGISTRY_USER as the RelativeTo
path, but that doesn't work unless there's a user context for it.
Well, ok, I just checked and the docs have been improved to clarify
that a SYSTEM thread would already read from the default user, which
usually isn't what you want.
Typically this is done by having some kind of user-mode process that
sends an IOCTL (or other IRP) to the driver during which the driver
can then read the user portion of the registry as documented in the DDK.
If the driver needs to initiate the registry read during operation, I
don't know of any other way than to set up a signalling mechanism (via
an event or pended IRP or whatever) to instruct an "always running"
user mode app to send an IOCTL down to the driver.
mich wrote: