Solved

need help writing REGDB_BINARY value to registry

Posted on 2007-04-09
9
854 Views
Last Modified: 2013-11-14
I'm trying to write a binary value to the registry .... In the registry, I need to change the Driver Signing key value ("Policy") to 0 and then eventually back to 1 (key type is regdb_binary).

I'm having trouble writing it though .... I'm setting the key value via RegDBSetKeyValueEx, but I'm not getting the result I'm looking for...   Can anyone give me a hand w/ how I would want to write that?!?!
0
Comment
Question by:trs28
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 

Author Comment

by:trs28
ID: 18897901
hmmm ... hopefully another 250 points will entice someone to give me a hand  :)
0
 
LVL 3

Expert Comment

by:pee_cee
ID: 18914833
From memory (so check for any syntax errors!!)

you should be doing something like:

STRING szKey, szName, szValue;
NUMBER nType, nSize, nResult;

szKey = "Your\\Software\\Key"
szName = "TheName" (e.g. Policy)
nType = REGDB_BINARY;
szValue = "0" //value to set, 0 or 1 in your question
nSize = 1 //with REGDB_BINARY and REGDB_STRING_MULTI, you must always specify the number of bytes of binary data that you are storing.

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); //change as appropriate
nResult = RegDBSetKeyValueEx ( szKey, szName, nType, szValue, nSize );

This should work.

Post up actual code snippet if this isn't quite what you are trying to do.
0
 
LVL 3

Expert Comment

by:pee_cee
ID: 18914834
0
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 

Author Comment

by:trs28
ID: 19261817
none of these answers are correct ..... i have figured out the solution to this problem long ago .... this question can be removed
0
 
LVL 3

Expert Comment

by:pee_cee
ID: 19261909
What was wrong with the answer given and what was the solution you found?
0
 

Author Comment

by:trs28
ID: 19261966
when you said about setting the szValue = "0" or "1", well, that was the part that was somewhat incorrect.    

The correction is ....
szValue = 0x00;
or
szValue = 0x01;

Without going over your suggestion again, I believe everything else was fine.  I do appreciate the help you gave in regards to this problem.  :)
0
 
LVL 3

Accepted Solution

by:
pee_cee earned 500 total points
ID: 19262025
Ok. That solution will help future Googlers!
0
 

Author Comment

by:trs28
ID: 19262821
you've helped me before, and if it weren't for you asking me what was wrong, this answer would have never been out there for anyone else ...so, i'd have to say you pretty much deserve the points afterall.  Thanks again & take care.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the frequent problems with the installations is when some file or registry entry is not removed from the system upon un-installation of the product. Clean removal is always highly desirable. One major reason for that is badly authored inst…
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question