Advapi32 Registry lib help

Blitz3D Forums/Blitz3D Userlibs/Advapi32 Registry lib help

_PJ_(Posted 2010) [#1]
I've been using the AdvApi32 registry decls from the code arcs, and until now, it's worked perfectly.
I've tested and can verify that it works and can return values from multiple types of keys.
So I know that the HKEY_CURRENT_USER value of -2147483647 must therefore be correct, and that I am using accurate key and subkey names.

However, when I try to read from HKEY_CURRENT_USER, although it can enumerate subkeys, the values are alweays returned as null ( "" ), regardless of type.

Could this perhaps be a permissions issue? Is there something particular about Keys under HKEY_CURRENT_USER compared to, for instance, HKEY_LOCAL_MACHINE?

What I have noticed, is that in these instances of failure, the "TypeBank" value which theoretically should hold a value corresponding to
REG_SZ, REG_DWORD etc. is populated by RegQUeryValueEx() as equivalent to the HANDLE given to the Key itself by RegOpenKey()

Whether relevant or not, in this instance, that value is 1216 when it ought to be between about 0 and 11....


Can anyone help?


_PJ_(Posted 2010) [#2]
Could a moderator please move this to Windows Discussion? I think it's probably more suited there and will get the 'right kind' of exposure :)

Thanks!


puki(Posted 2010) [#3]
I can't be bothered - you can just create a new thread though and have the best of both worlds.


_PJ_(Posted 2010) [#4]
Okay,. this one's solved/. As usual with things like this, the peroblem was elsewhere.

FileType() doesn't evaluate environment variables in pathnames, so %SYSTEMROOT% wasn't recognised.

I had to replace "%SYSTEMROOT%" with GetEnv("SYSTEMROOT")+"\"