Page 1 of 1 1
Topic Options
#33731 - 2002-11-29 07:35 PM Write String as REG_BINARY?
Anonymous
Unregistered


Binary data is a bit harder to browse in the registry, so one may want to store a string as a binary data type to make it harder to see. That said, does understand this:

$ = WriteValue ("HKEY_LOCAL_MACHINE\SYSTEM", "Test", "text string", REG_FULL_RESOURCE_DESCRIPTOR)
? ReadValue ("HKEY_LOCAL_MACHINE\SYSTEM", "Test")

The above is able to return the text string fine.

$ = WriteValue ("HKEY_LOCAL_MACHINE\SYSTEM", "Test", "text string", REG_BINARY)
? ReadValue ("HKEY_LOCAL_MACHINE\SYSTEM", "Test")

When using the REG_BINARY type above, the string appears as hex in the registry and is returned by KiXtart as a hex string.

Is KiXtart modfying the data on write when the type is specified as REG_BINARY?

Top
#33732 - 2002-11-29 07:54 PM Re: Write String as REG_BINARY?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
The registry APIs do this work I believe. If you tell the OS to write to the registry as REG_BINARY then it does. I would suggest you search the board for one of our previous Kixgolf contests. It dealt with reading and writing to the registry.

Here are some links:
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=003606
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=003633

[ 29. November 2002, 19:54: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#33733 - 2002-11-29 07:56 PM Re: Write String as REG_BINARY?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure!

as binary is not the same as string.
so it translates your string to binary.

it's not hard to translate it back, is it?

there is also our golf 3 (use search to find) which did these things.
check the udf library (address in my sig) for baseconverter
_________________________
!

download KiXnet

Top
#33734 - 2002-11-29 08:12 PM Re: Write String as REG_BINARY?
Anonymous
Unregistered


I just found it strange that REG_FULL_RESOURCE_DESCRIPTOR writes in string but REG_BINARY does not. Becuase when looking in REGEDIT, they both appear as binary values, only REG_BINARY is written in as hex and REG_FULL_RESORUCE_DESCRIPTOR is written in as a string.

Thanks

Top
#33735 - 2002-11-29 08:18 PM Re: Write String as REG_BINARY?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Well I don't think you should be using such a data type for your code.

quote:
REG_FULL_RESOURCE_DESCRIPTOR
A list of hardware resources that a physical device is using, detected and written into the \HardwareDescription tree by the system

_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.051 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org