Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

need help writing REGDB_BINARY value to registry

Posted on 2007-04-09
9
Medium Priority
?
866 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

If you don't know how to downgrade, my instructions below should be helpful.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

604 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