Solved

need help writing REGDB_BINARY value to registry

Posted on 2007-04-09
9
827 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
Comment Utility
hmmm ... hopefully another 250 points will entice someone to give me a hand  :)
0
 
LVL 3

Expert Comment

by:pee_cee
Comment Utility
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
Comment Utility
0
 

Author Comment

by:trs28
Comment Utility
none of these answers are correct ..... i have figured out the solution to this problem long ago .... this question can be removed
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Expert Comment

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

Author Comment

by:trs28
Comment Utility
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
Comment Utility
Ok. That solution will help future Googlers!
0
 

Author Comment

by:trs28
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now