Commit 7c0ba900 authored by Serge Gautherie's avatar Serge Gautherie Committed by Alexandre Julliard

kernelbase: Handle RegGetValue() RRF_SUBKEY_WOW64??KEY flags.

parent 27d1ef75
...@@ -1699,13 +1699,22 @@ LSTATUS WINAPI RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, ...@@ -1699,13 +1699,22 @@ LSTATUS WINAPI RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue,
if (pvData && !pcbData) if (pvData && !pcbData)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
if ((dwFlags & RRF_RT_REG_EXPAND_SZ) && !(dwFlags & RRF_NOEXPAND) && if ((dwFlags & RRF_RT_REG_EXPAND_SZ) && !(dwFlags & RRF_NOEXPAND) &&
((dwFlags & RRF_RT_ANY) != RRF_RT_ANY)) ((dwFlags & RRF_RT_ANY) != RRF_RT_ANY))
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
if ((dwFlags & RRF_WOW64_MASK) == RRF_WOW64_MASK)
return ERROR_INVALID_PARAMETER;
if (pszSubKey && pszSubKey[0]) if (pszSubKey && pszSubKey[0])
{ {
ret = RegOpenKeyExW(hKey, pszSubKey, 0, KEY_QUERY_VALUE, &hKey); REGSAM samDesired = KEY_QUERY_VALUE;
if (dwFlags & RRF_WOW64_MASK)
samDesired |= (dwFlags & RRF_SUBKEY_WOW6432KEY) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
ret = RegOpenKeyExW(hKey, pszSubKey, 0, samDesired, &hKey);
if (ret != ERROR_SUCCESS) return ret; if (ret != ERROR_SUCCESS) return ret;
} }
...@@ -1795,13 +1804,22 @@ LSTATUS WINAPI RegGetValueA( HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, ...@@ -1795,13 +1804,22 @@ LSTATUS WINAPI RegGetValueA( HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue,
if (pvData && !pcbData) if (pvData && !pcbData)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
if ((dwFlags & RRF_RT_REG_EXPAND_SZ) && !(dwFlags & RRF_NOEXPAND) && if ((dwFlags & RRF_RT_REG_EXPAND_SZ) && !(dwFlags & RRF_NOEXPAND) &&
((dwFlags & RRF_RT_ANY) != RRF_RT_ANY)) ((dwFlags & RRF_RT_ANY) != RRF_RT_ANY))
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
if ((dwFlags & RRF_WOW64_MASK) == RRF_WOW64_MASK)
return ERROR_INVALID_PARAMETER;
if (pszSubKey && pszSubKey[0]) if (pszSubKey && pszSubKey[0])
{ {
ret = RegOpenKeyExA(hKey, pszSubKey, 0, KEY_QUERY_VALUE, &hKey); REGSAM samDesired = KEY_QUERY_VALUE;
if (dwFlags & RRF_WOW64_MASK)
samDesired |= (dwFlags & RRF_SUBKEY_WOW6432KEY) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
ret = RegOpenKeyExA(hKey, pszSubKey, 0, samDesired, &hKey);
if (ret != ERROR_SUCCESS) return ret; if (ret != ERROR_SUCCESS) return ret;
} }
......
...@@ -81,6 +81,9 @@ typedef LONG LSTATUS; ...@@ -81,6 +81,9 @@ typedef LONG LSTATUS;
#define RRF_RT_DWORD (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD) #define RRF_RT_DWORD (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD)
#define RRF_RT_QWORD (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD) #define RRF_RT_QWORD (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD)
#define RRF_RT_ANY 0xffff #define RRF_RT_ANY 0xffff
#define RRF_SUBKEY_WOW6464KEY (1 << 16)
#define RRF_SUBKEY_WOW6432KEY (1 << 17)
#define RRF_WOW64_MASK (RRF_SUBKEY_WOW6432KEY | RRF_SUBKEY_WOW6464KEY)
#define RRF_NOEXPAND (1 << 28) #define RRF_NOEXPAND (1 << 28)
#define RRF_ZEROONFAILURE (1 << 29) #define RRF_ZEROONFAILURE (1 << 29)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment