+Fri May 20 0:01:00 2000 Corinna Vinschen <corinna@vinschen.de>
+
+ * regtool.cc (find_key): Add parameter `access'.
+ Call `RegOpenKeyEx' with that desired access.
+ (cmd_add, cmd_remove, cmd_set, cmd_unset): Call
+ `find_key' with KEY_ALL_ACCESS access.
+ (cmd_list, cmd_check, cmd_get): Call `find_key'
+ with KEY_READ access.
+
2000-05-19 DJ Delorie <dj@cygnus.com>
* cygpath.cc: add --windir/--sysdir options
}
void
-find_key(int howmanyparts)
+find_key(int howmanyparts, REGSAM access)
{
char *n = argv[0], *e, c;
int i;
key = wkprefixes[i].key;
return;
}
- int rv = RegOpenKeyEx(wkprefixes[i].key, n, 0, KEY_ALL_ACCESS, &key);
+ int rv = RegOpenKeyEx(wkprefixes[i].key, n, 0, access, &key);
if (rv != ERROR_SUCCESS)
Fail(rv);
//printf("key `%s' value `%s'\n", n, value);
DWORD i, j, m, n, t;
int v;
- find_key(1);
+ find_key(1, KEY_READ);
RegQueryInfoKey(key, 0, 0, 0, &num_subkeys, &maxsubkeylen, &maxclasslen,
&num_values, &maxvalnamelen, &maxvaluelen, 0, 0);
int
cmd_add()
{
- find_key(2);
+ find_key(2, KEY_ALL_ACCESS);
HKEY newkey;
DWORD newtype;
int rv = RegCreateKeyEx(key, value, 0, (char *)"", REG_OPTION_NON_VOLATILE,
int
cmd_remove()
{
- find_key(2);
+ find_key(2, KEY_ALL_ACCESS);
DWORD rv = RegDeleteKey(key, value);
if (rv != ERROR_SUCCESS)
Fail(rv);
int
cmd_check()
{
- find_key(1);
+ find_key(1, KEY_READ);
if (verbose)
printf("key %s exists\n", argv[0]);
return 0;
int i, n;
DWORD v, rv;
char *a = argv[1], *data;
- find_key(2);
+ find_key(2, KEY_ALL_ACCESS);
if (key_type == KT_AUTO)
{
int
cmd_unset()
{
- find_key(2);
+ find_key(2, KEY_ALL_ACCESS);
DWORD rv = RegDeleteValue(key, value);
if (rv != ERROR_SUCCESS)
Fail(rv);
int
cmd_get()
{
- find_key(2);
+ find_key(2, KEY_READ);
DWORD vtype, dsize, rv;
char *data, *vd;
rv = RegQueryValueEx(key, value, 0, &vtype, 0, &dsize);