Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2000-06-22 22:54:26 +0400
committerCorinna Vinschen <corinna@vinschen.de>2000-06-22 22:54:26 +0400
commit98a3dc3bc5984a1689815ea092f2a62509653180 (patch)
tree73ebbe6ae728b53857c642871643610ad724ea55 /winsup/cygwin
parent42030c97d70b39d55bc09b4f56e255c892df6b13 (diff)
* registry.cc (load_registry_hive): Use HKEY_USERS when checking
for existing user hive. Use MAX_PATH instead of numerical constant for array size. Use return code of RegLoadKeyA instead of GetLastError for error output.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/registry.cc11
2 files changed, 13 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1b4346a4e..d36d10985 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+Thu Jun 22 20:45:00 2000 Corinna Vinschen <corinna@vinschen.de>
+
+ * registry.cc (load_registry_hive): Use HKEY_USERS when checking
+ for existing user hive.
+ Use MAX_PATH instead of numerical constant for array size.
+ Use return code of RegLoadKeyA instead of GetLastError for error output.
+
Thu Jun 22 14:27:04 2000 Christopher Faylor <cgf@cygnus.com>
* Makefile.in: Add new-libcygwin.a back to all_host target.
diff --git a/winsup/cygwin/registry.cc b/winsup/cygwin/registry.cc
index 31ee183da..e4439663b 100644
--- a/winsup/cygwin/registry.cc
+++ b/winsup/cygwin/registry.cc
@@ -210,13 +210,14 @@ void
load_registry_hive (PSID psid)
{
char sid[256];
- char path[256];
+ char path[MAX_PATH + 1];
HKEY hkey;
+ LONG ret;
if (!psid)
return;
- /* Check if user hive already exists */
- if (!RegOpenKeyExA (HKEY_LOCAL_MACHINE, convert_sid_to_string_sid (psid, sid),
+ /* Check if user hive is already loaded. */
+ if (!RegOpenKeyExA (HKEY_USERS, convert_sid_to_string_sid (psid, sid),
0, KEY_READ, &hkey))
{
debug_printf ("User registry hive for %s already exists", sid);
@@ -226,8 +227,8 @@ load_registry_hive (PSID psid)
if (get_registry_hive_path (psid, path))
{
strcat (path, "\\NTUSER.DAT");
- if (RegLoadKeyA (HKEY_USERS, sid, path))
- debug_printf ("Loading user registry hive for %s failed: %E", sid);
+ if ((ret = RegLoadKeyA (HKEY_USERS, sid, path)) != ERROR_SUCCESS)
+ debug_printf ("Loading user registry hive for %s failed: %d", sid, ret);
}
}