×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Registry manipulation

Registry manipulation

Registry manipulation

(OP)
I'm trying to retrieve a value from the registry. Some values within the same key allow me to view them while others abort the program with an "Access Violation" error.

Oddly enough, I can manually change the entry to which I was programatically denied access (using regedit).

The key I'm trying to retrieve is:

"HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters"
the actual value I want is "NameServer"

Can anyone shed some light on this?

RE: Registry manipulation

Is there some reason why you're querying ControlSet001, and not CurrentControlSet? The latter should show the values for the current configuration, and not a configuration the machine may or may not be in.

Other than that, there shouldn't be any problems with doing your typical RegQueryValueEx(). If you were trying to change it, I can see having to have Administrator authority.

Chip H.

RE: Registry manipulation

One other thought I had as I was debugging something like this for a client... If DHCP is enabled, then when the system logs into the domain, NT may be setting this information automatically based on the DHCP settings on the PDC it connected to. So even if you do change it, next time the machine logs in, it's possible that it will be reset.

Steve Meier
sdmeier@jcn1.com

RE: Registry manipulation

(OP)
Thanks Chip and Steve,

I now understand the difference between ControlSet001 and CurrentControlSet.

I was able to get the code to work using APIs (really cool); HOWEVER, as Chip mentioned, I was unable to change the value of an entry unless I was logged on as an administrator.

We basically have a DSL connection and we have a website that we want a group of users to have access to. We normally don't allow that group of users to access the web at all. So my thinking was to (within the VB app) change some registry entry to allow the users to access the web, go to the desired site then change the registry entry again -- this way, they'll have access to the web only when we allow them to do so.

It works great if we're logged in as Admin but "regular" users don't have the authority to change the registry.

Any suggestions?

Tarek

RE: Registry manipulation

(OP)
Eric,

Can you expand on that!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close