advapi32.dll -> RegCreateKeyExA & Normal user

G

Guest

I am trying to access the registry from a normal user by the following code
.... but failed!! However, it works under admin user logon.

I think I need to grant some access right to the normal user, but I don't
know how! Can anyone give me a hand please?

Many Thanks!! ^_^

' ---- Code start
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOp ...
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "Re ...

nRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, Section, 0&, KEY_ALL_ACCESS, hKey)
If nRet = ERROR_SUCCESS Then
nRet = RegQueryValueEx(hKey, key, 0&, nType, ByVal Buffer, nBytes)
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top