473,385 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

advapi32.dll -> RegCreateKeyExA & Normal user

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
Mar 28 '07 #1
1 4679
Jck,

Your code is not dotNet but windows.

Have a look at the dotNet registry code.
http://msdn2.microsoft.com/en-us/lib....registry.aspx

Cor

"Jck" <Jc*@discussions.microsoft.comschreef in bericht
news:D3**********************************@microsof t.com...
>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

Mar 28 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rich | last post by:
I have a block of code that encrypts passwords before storing them it an access database. It works fine on my pc, however on my client they get the following error on the last line of code when...
1
by: Blacksheep | last post by:
Can anyone help me with the following problem : I'm just trying to have the API call LogonUserA run correctly. Each run ends up with the following message : "The instruction at 0x77.. referenced...
0
by: norman.dumont | last post by:
The exact message is presented in a popup as follows: The procedure entry point MD5Final could not be located in the dynamic link library ADVAPI32.dll. This only happens on Win2000. The .NET...
1
by: aiKeith | last post by:
Could you tell me how (or what tools) I can use to view the available methods of a dll that is not .net - such as the advapi32.dll?
3
by: mrzt | last post by:
the following codes won't work. ============================== using System; using System.Runtime; using System.Runtime.InteropServices; namespace Shutdown { /// <summary> /// Class1...
0
by: caldera | last post by:
hi, I want to forms authentication with windows password. So that I import advapi32.dll. Import code like this public static extern bool LogonUser(String lpszUsername,String lpszDomain,String...
3
by: Scottie_do | last post by:
I have a IntPtr to a Sid and I'd like to convert that to a string, but I can't figure out how to get a "pointer to a pointer to a buffer that will contain a string". Im also afraid of memory...
2
by: Podi | last post by:
I have ctypes version 0.9.6 and Python 2.4.2 running on Windows XP Professional. When I tried to use some functions in the Advapi32.dll, some functions are available and some are not. Is this a...
1
by: raam_kimi | last post by:
Hi All I got some problem in importing advapi32.dll when i call the LogonUser method it throws an error like this 'Unable to find an entry point named LogonUser in DLL advapi32.dll.' ...
0
MikeJaskov
by: MikeJaskov | last post by:
Hi all. Like you know I'm working on some project so I need something to know. I was serching on internet and found some uses of Kernel32,advapi32 and rundll32. So I use API Text Viwer but there are...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.