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:
authorPierre Humblet <phumblet@phumblet.no-ip.org>2004-10-26 05:53:27 +0400
committerPierre Humblet <phumblet@phumblet.no-ip.org>2004-10-26 05:53:27 +0400
commitfdf4ad73e1cccdcc9f9a03a2605615ef4835013c (patch)
tree687a08aff78bb97397bda4dc15b7e657fe09985e /winsup/cygwin/registry.cc
parent9a0fdd231511a19e99b04ecae7e272f7eb4b840e (diff)
2004-10-26 Pierre Humblet <pierre.humblet@ieee.org>
* registry.cc (get_registry_hive_path): Simplify and add a debug_printf in case of failure. (load_registry_hive): Revert the 2004-04-19 change.
Diffstat (limited to 'winsup/cygwin/registry.cc')
-rw-r--r--winsup/cygwin/registry.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/winsup/cygwin/registry.cc b/winsup/cygwin/registry.cc
index bb47c48a7..bf80245a7 100644
--- a/winsup/cygwin/registry.cc
+++ b/winsup/cygwin/registry.cc
@@ -211,14 +211,15 @@ get_registry_hive_path (const PSID psid, char *path)
char buf[256];
DWORD type, siz;
- key[0] = '\0';
+ path[0] = '\0';
if (!RegQueryValueExA (hkey, "ProfileImagePath", 0, &type,
- (BYTE *)buf, (siz = 256, &siz)))
- ExpandEnvironmentStringsA (buf, key, 256);
+ (BYTE *)buf, (siz = sizeof (buf), &siz)))
+ ExpandEnvironmentStringsA (buf, path, CYG_MAX_PATH + 1);
RegCloseKey (hkey);
- if (key[0])
- return strcpy (path, key);
+ if (path[0])
+ return path;
}
+ debug_printf ("HKLM\\%s not found", key);
return NULL;
}
@@ -241,7 +242,8 @@ load_registry_hive (PSID psid)
RegCloseKey (hkey);
return;
}
- enable_restore_privilege ();
+ /* This is only called while deimpersonated */
+ set_process_privilege (SE_RESTORE_NAME);
if (get_registry_hive_path (psid, path))
{
strcat (path, "\\NTUSER.DAT");