This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
RE: [Patch] regtool: Add load/unload commands and --binary option
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: <cygwin-patches at cygwin dot com>
- Date: Fri, 3 Mar 2006 13:12:01 -0000
- Subject: RE: [Patch] regtool: Add load/unload commands and --binary option
On 03 March 2006 09:46, Corinna Vinschen wrote:
>
> Btw., since you seem to be interested in hacking the registry... would
> you also be interested to introduce registry write access below
> /proc/registry inside of the Cygwin DLL? That would be extra cool.
> I'm not quite sure how to handle the mapping from file types to
> registry key types, but there might be some simple way which I'm just
> too blind to see.
Hey, how about using pseudo filename-extensions on the pseudo-files that
represent registry keys?
i.e
$ echo "Foo" >/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.sz
creates /proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName, type
REG_SZ, content "Foo<NUL>"
$ echo "%WINDIR%"
>/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.xsz
creates /proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName as
REG_EXPAND_SZ
$ echo "23"
>/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.dword
$ echo "0x17"
>/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.dword
$ dd bs=1024 count=3 if=/dev/random
of=/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.bin
$ touch /proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.none
etc etc ? (We might even want a $CYGWIN option to make the extension show up
in dir listings, but it wouldn't be backwardly-compatible to do so in
general).
Hmm, and how about for MULTI_SZ taking account of the open mode?
$ echo "String1"
>/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.msz
$ echo "String2"
>>/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.msz
$ echo "String3"
>>/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.msz
$ echo "String4"
>>/proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.msz
$ od -c < /proc/registry/HKEY_CURRENT_USER/Software/App/Key/ValueName.msz
String1\0String2\0String3\0String4\0\0
cheers,
DaveK
--
Can't think of a witty .sigline today....