[SHELL32:WINE] Improve ROS-specific registry opening in SHRestricted() (#4275)

This commit is contained in:
Hermès Bélusca-Maïto 2022-01-10 20:17:08 +01:00
parent 9513d18f93
commit ea3e66d748
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -1377,10 +1377,10 @@ DWORD WINAPI SHRestricted (RESTRICTIONS policy)
if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS)
#else // FIXME: Actually this *MUST* use shlwapi!SHRestrictionLookup()
// See http://www.geoffchappell.com/studies/windows/shell/shell32/api/util/shrestricted.htm
retval = RegOpenKeyA(HKEY_LOCAL_MACHINE, regstr, &xhkey);
retval = RegOpenKeyExA(HKEY_LOCAL_MACHINE, regstr, 0, KEY_READ, &xhkey);
if (retval != ERROR_SUCCESS)
{
retval = RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey);
retval = RegOpenKeyExA(HKEY_CURRENT_USER, regstr, 0, KEY_READ, &xhkey);
if (retval != ERROR_SUCCESS)
return 0;
}