* 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.
This commit is contained in:
parent
abd9f14c3b
commit
a4bc548973
@ -1,3 +1,12 @@
|
|||||||
|
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>
|
2000-05-19 DJ Delorie <dj@cygnus.com>
|
||||||
|
|
||||||
* cygpath.cc: add --windir/--sysdir options
|
* cygpath.cc: add --windir/--sysdir options
|
||||||
|
@ -167,7 +167,7 @@ void translate(char *key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
find_key(int howmanyparts)
|
find_key(int howmanyparts, REGSAM access)
|
||||||
{
|
{
|
||||||
char *n = argv[0], *e, c;
|
char *n = argv[0], *e, c;
|
||||||
int i;
|
int i;
|
||||||
@ -211,7 +211,7 @@ find_key(int howmanyparts)
|
|||||||
key = wkprefixes[i].key;
|
key = wkprefixes[i].key;
|
||||||
return;
|
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)
|
if (rv != ERROR_SUCCESS)
|
||||||
Fail(rv);
|
Fail(rv);
|
||||||
//printf("key `%s' value `%s'\n", n, value);
|
//printf("key `%s' value `%s'\n", n, value);
|
||||||
@ -228,7 +228,7 @@ cmd_list()
|
|||||||
DWORD i, j, m, n, t;
|
DWORD i, j, m, n, t;
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
find_key(1);
|
find_key(1, KEY_READ);
|
||||||
RegQueryInfoKey(key, 0, 0, 0, &num_subkeys, &maxsubkeylen, &maxclasslen,
|
RegQueryInfoKey(key, 0, 0, 0, &num_subkeys, &maxsubkeylen, &maxclasslen,
|
||||||
&num_values, &maxvalnamelen, &maxvaluelen, 0, 0);
|
&num_values, &maxvalnamelen, &maxvaluelen, 0, 0);
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ cmd_list()
|
|||||||
int
|
int
|
||||||
cmd_add()
|
cmd_add()
|
||||||
{
|
{
|
||||||
find_key(2);
|
find_key(2, KEY_ALL_ACCESS);
|
||||||
HKEY newkey;
|
HKEY newkey;
|
||||||
DWORD newtype;
|
DWORD newtype;
|
||||||
int rv = RegCreateKeyEx(key, value, 0, (char *)"", REG_OPTION_NON_VOLATILE,
|
int rv = RegCreateKeyEx(key, value, 0, (char *)"", REG_OPTION_NON_VOLATILE,
|
||||||
@ -323,7 +323,7 @@ cmd_add()
|
|||||||
int
|
int
|
||||||
cmd_remove()
|
cmd_remove()
|
||||||
{
|
{
|
||||||
find_key(2);
|
find_key(2, KEY_ALL_ACCESS);
|
||||||
DWORD rv = RegDeleteKey(key, value);
|
DWORD rv = RegDeleteKey(key, value);
|
||||||
if (rv != ERROR_SUCCESS)
|
if (rv != ERROR_SUCCESS)
|
||||||
Fail(rv);
|
Fail(rv);
|
||||||
@ -335,7 +335,7 @@ cmd_remove()
|
|||||||
int
|
int
|
||||||
cmd_check()
|
cmd_check()
|
||||||
{
|
{
|
||||||
find_key(1);
|
find_key(1, KEY_READ);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("key %s exists\n", argv[0]);
|
printf("key %s exists\n", argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
@ -347,7 +347,7 @@ cmd_set()
|
|||||||
int i, n;
|
int i, n;
|
||||||
DWORD v, rv;
|
DWORD v, rv;
|
||||||
char *a = argv[1], *data;
|
char *a = argv[1], *data;
|
||||||
find_key(2);
|
find_key(2, KEY_ALL_ACCESS);
|
||||||
|
|
||||||
if (key_type == KT_AUTO)
|
if (key_type == KT_AUTO)
|
||||||
{
|
{
|
||||||
@ -400,7 +400,7 @@ cmd_set()
|
|||||||
int
|
int
|
||||||
cmd_unset()
|
cmd_unset()
|
||||||
{
|
{
|
||||||
find_key(2);
|
find_key(2, KEY_ALL_ACCESS);
|
||||||
DWORD rv = RegDeleteValue(key, value);
|
DWORD rv = RegDeleteValue(key, value);
|
||||||
if (rv != ERROR_SUCCESS)
|
if (rv != ERROR_SUCCESS)
|
||||||
Fail(rv);
|
Fail(rv);
|
||||||
@ -412,7 +412,7 @@ cmd_unset()
|
|||||||
int
|
int
|
||||||
cmd_get()
|
cmd_get()
|
||||||
{
|
{
|
||||||
find_key(2);
|
find_key(2, KEY_READ);
|
||||||
DWORD vtype, dsize, rv;
|
DWORD vtype, dsize, rv;
|
||||||
char *data, *vd;
|
char *data, *vd;
|
||||||
rv = RegQueryValueEx(key, value, 0, &vtype, 0, &dsize);
|
rv = RegQueryValueEx(key, value, 0, &vtype, 0, &dsize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user