Solved

need help writing REGDB_BINARY value to registry

Posted on 2007-04-09
9
837 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
  • 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Among others, I monitor the Windows Installer zone and Installer zone. I find that many of the questions could be answered much more quickly if a Windows Installer verbose log were submitted with the question.   However, I do not always have t…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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