[Patch] regtool: Add load/unload commands and --binary option

Igor Peshansky pechtcha@cs.nyu.edu
Fri Mar 3 22:18:00 GMT 2006

On Fri, 3 Mar 2006, Christian Franke wrote:

> In fact I had the idea to hack the registry, in particular fix the read
> access to registry values starting with backslash:
> $ cd /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/MountedDevices
> $ ls
> ...
> \DosDevices\C:
> \DosDevices\D:
> ...
> $ cat \\DosDevices\\C:
> cat: \DosDevices\C:: No such file or directory

This is more likely a problem with Cygwin's path handling, which treats
any path with an embedded '\' as a Windows path that doesn't get
translated into POSIX (so you're not trying to open
but '\DosDevices\C:'.  Look at the strace to confirm it.  Maybe Cygwin
should check if a path starts with /proc/registry (or any virtual
filesystem) before deciding to not translate it...

> Using a URL-like "%XX" encoding for invalid characters (/\?%) may be the
> right thing to do.
> $ ls
> ...
> %5cDosDevices%5cC:

Yep, in effect making /proc/registry a managed mount.  You'd need
something like this anyway to process values that have '/'s in them.

> I found that all standard ascii chars except ^ % ` are used in value names
> > 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.
> Because POSIX has no notion about file types, the type has to be somehow
> encoded into the name if a new key is created.

What's wrong with using open() flags?

> The major drawback of this approach is that the read path is different
> from the write path.
> I would suggest to add a second R/W view to the registry where both path
> are identical.
> A type extension should be added via a rarely used character:
> $ ls /proc/registry/SUBKEY
> reg_sz_value
> reg_binary_value
> reg_dword_value
> $ ls /proc/registry-rw/SUBKEY
> reg_sz_value,sz
> reg_binary_value,bin
> reg_dword_value,dword

Yep, except I suggested ':'.

> Then you should have the ability to copy subkeys to file trees and vice
> versa:
> cp -r /dev/registry-rw/SUBKEY /tmp/SUBKEY
> rm -r /dev/registry-rw/SUBKEY
> cp -r /tmp/SUBKEY /dev/registry-rw/SUBKEY
> Suggest to start a new thread for this discussion....

Right, good idea, except not on this list (as Dave pointed out).  What
would be a good place -- cygwin-developers?
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

More information about the Cygwin-patches mailing list