* Makefile.in: Fix copyright date.

* cygcheck.cc (scan_registry): Take additional parameter and add code
	to avoid recursion in Wow6432Node subkey.  Rename variable cygnus to
	cygwin.  Scan for "Cygwin" instead of for "cygnus" substring.
	(dump_sysinfo): Drop unused calls to scan_registry.  Drop scanning
	HKEY_CURRENT_CONFIG.
This commit is contained in:
Corinna Vinschen 2009-01-17 11:59:16 +00:00
parent 40255b64d4
commit 2ac273a946
3 changed files with 28 additions and 19 deletions

View File

@ -1,3 +1,12 @@
2009-01-17 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in: Fix copyright date.
* cygcheck.cc (scan_registry): Take additional parameter and add code
to avoid recursion in Wow6432Node subkey. Rename variable cygnus to
cygwin. Scan for "Cygwin" instead of for "cygnus" substring.
(dump_sysinfo): Drop unused calls to scan_registry. Drop scanning
HKEY_CURRENT_CONFIG.
2009-01-16 Corinna Vinschen <corinna@vinschen.de> 2009-01-16 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (dump_sysinfo): Raise size of osname. Add Windows 7 * cygcheck.cc (dump_sysinfo): Raise size of osname. Add Windows 7

View File

@ -1,6 +1,6 @@
# Makefile for Cygwin utilities # Makefile for Cygwin utilities
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008 Red Hat, Inc. # 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
# This file is part of Cygwin. # This file is part of Cygwin.

View File

@ -921,7 +921,7 @@ show_reg (RegInfo * ri, int nest)
} }
static void static void
scan_registry (RegInfo * prev, HKEY hKey, char *name, int cygnus) scan_registry (RegInfo * prev, HKEY hKey, char *name, int cygwin, bool wow64)
{ {
RegInfo ri; RegInfo ri;
ri.prev = prev; ri.prev = prev;
@ -930,8 +930,8 @@ scan_registry (RegInfo * prev, HKEY hKey, char *name, int cygnus)
char *cp; char *cp;
for (cp = name; *cp; cp++) for (cp = name; *cp; cp++)
if (strncasecmp (cp, "cygnus", 6) == 0) if (strncasecmp (cp, "Cygwin", 6) == 0)
cygnus = 1; cygwin = 1;
DWORD num_subkeys, max_subkey_len, num_values; DWORD num_subkeys, max_subkey_len, num_values;
DWORD max_value_len, max_valdata_len, i; DWORD max_value_len, max_valdata_len, i;
@ -948,7 +948,7 @@ scan_registry (RegInfo * prev, HKEY hKey, char *name, int cygnus)
return; return;
} }
if (cygnus) if (cygwin)
{ {
show_reg (&ri, 0); show_reg (&ri, 0);
@ -1001,10 +1001,18 @@ scan_registry (RegInfo * prev, HKEY hKey, char *name, int cygnus)
ERROR_SUCCESS) ERROR_SUCCESS)
{ {
HKEY sKey; HKEY sKey;
/* Don't recurse more than one level into the WOW64 subkey since
that would lead to an endless recursion. */
if (!strcasecmp (subkey_name, "Wow6432Node"))
{
if (wow64)
continue;
wow64 = true;
}
if (RegOpenKeyEx (hKey, subkey_name, 0, KEY_READ, &sKey) if (RegOpenKeyEx (hKey, subkey_name, 0, KEY_READ, &sKey)
== ERROR_SUCCESS) == ERROR_SUCCESS)
{ {
scan_registry (&ri, sKey, subkey_name, cygnus); scan_registry (&ri, sKey, subkey_name, cygwin, wow64);
if (RegCloseKey (sKey) != ERROR_SUCCESS) if (RegCloseKey (sKey) != ERROR_SUCCESS)
display_error ("scan_registry: RegCloseKey()"); display_error ("scan_registry: RegCloseKey()");
} }
@ -1505,19 +1513,11 @@ dump_sysinfo ()
if (registry) if (registry)
{ {
if (givehelp) if (givehelp)
printf ("Scanning registry for keys with 'Cygnus' in them...\n"); printf ("Scanning registry for keys with 'Cygwin' in them...\n");
#if 0 scan_registry (0, HKEY_CURRENT_USER,
/* big and not generally useful */ (char *) "HKEY_CURRENT_USER", 0, false);
scan_registry (0, HKEY_CLASSES_ROOT, (char *) "HKEY_CLASSES_ROOT", 0); scan_registry (0, HKEY_LOCAL_MACHINE,
#endif (char *) "HKEY_LOCAL_MACHINE", 0, false);
scan_registry (0, HKEY_CURRENT_CONFIG,
(char *) "HKEY_CURRENT_CONFIG", 0);
scan_registry (0, HKEY_CURRENT_USER, (char *) "HKEY_CURRENT_USER", 0);
scan_registry (0, HKEY_LOCAL_MACHINE, (char *) "HKEY_LOCAL_MACHINE", 0);
#if 0
/* the parts we need are duplicated in HKEY_CURRENT_USER anyway */
scan_registry (0, HKEY_USERS, (char *) "HKEY_USERS", 0);
#endif
printf ("\n"); printf ("\n");
} }
else else