Fixed possible infinite loop in delete_key.

This commit is contained in:
Alexandre Julliard 2002-09-12 20:46:06 +00:00
parent 7e252cb5ef
commit 5587d39e9c

View file

@ -33,7 +33,13 @@ static DWORD delete_key( HKEY hkey )
while (!(ret = RegEnumKeyW(hkey, 0, name, sizeof(name))))
{
if ((ret = delete_key( hkey ))) break;
HKEY tmp;
if (!(ret = RegOpenKeyExW( hkey, name, 0, KEY_ENUMERATE_SUB_KEYS, &tmp )))
{
ret = delete_key( tmp );
RegCloseKey( tmp );
}
if (ret) break;
}
if (ret != ERROR_NO_MORE_ITEMS) return ret;
RegDeleteKeyA( hkey, NULL );