?
Solved

need help writing REGDB_BINARY value to registry

Posted on 2007-04-09
9
Medium Priority
?
861 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Installations often have prerequisites, such as “Microsoft .Net framework is required for this product”. The usual implementation in MSI installations is system search for a particular registry setting representing the required prerequisite, followe…
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 …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

771 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