Fix save_check_tainted to properly scan the tree so that all tainted

branches get saved.
This commit is contained in:
Huw D M Davies 1999-11-12 00:58:15 +00:00 committed by Alexandre Julliard
parent 8eec66b213
commit f49cb52c69

View File

@ -533,7 +533,7 @@ static void split_keypath( LPCWSTR wp, LPWSTR **wpv, int *wpc)
for (i=1;i<len;i++) for (i=1;i<len;i++)
if (ws[i-1]==0) { if (ws[i-1]==0) {
(*wpv)[j++]=ws+i; (*wpv)[j++]=ws+i;
/* TRACE(reg, " Subitem %d = %s\n",j-1,debugstr_w((*wpv)[j-1])); */ /*TRACE_(reg) (" Subitem %d = %s\n",j-1,debugstr_w((*wpv)[j-1]));*/
} }
(*wpv)[j]=NULL; (*wpv)[j]=NULL;
@ -574,7 +574,7 @@ static void REGISTRY_Init(void) {
* string SysContact * string SysContact
* string SysLocation * string SysLocation
* SysServices * SysServices
*/ */
if (-1!=gethostname(buf,200)) { if (-1!=gethostname(buf,200)) {
RegCreateKey16(HKEY_LOCAL_MACHINE,"System\\CurrentControlSet\\Control\\ComputerName\\ComputerName",&hkey); RegCreateKey16(HKEY_LOCAL_MACHINE,"System\\CurrentControlSet\\Control\\ComputerName\\ComputerName",&hkey);
RegSetValueEx16(hkey,"ComputerName",0,REG_SZ,buf,strlen(buf)+1); RegSetValueEx16(hkey,"ComputerName",0,REG_SZ,buf,strlen(buf)+1);
@ -618,19 +618,13 @@ static void REGISTRY_Init(void) {
*/ */
static int _save_check_tainted( LPKEYSTRUCT lpkey ) static int _save_check_tainted( LPKEYSTRUCT lpkey )
{ {
int tainted; int tainted = 0;
if (!lpkey)
return 0;
if (lpkey->flags & REG_OPTION_TAINTED)
tainted = 1;
else
tainted = 0;
while (lpkey) { while (lpkey) {
if (_save_check_tainted(lpkey->nextsub)) { if (_save_check_tainted(lpkey->nextsub))
lpkey->flags |= REG_OPTION_TAINTED; lpkey->flags |= REG_OPTION_TAINTED;
tainted = 1; if (lpkey->flags & REG_OPTION_TAINTED)
} tainted = 1;
lpkey = lpkey->next; lpkey = lpkey->next;
} }
return tainted; return tainted;