--- old/registry.c 2008-07-11 17:55:55.000000000 +0200 +++ registry.c 2008-07-18 01:39:21.000000000 +0200 @@ -1466,6 +1466,8 @@ * expanded and pdwType is set to REG_SZ instead. * - Restrictions are applied after expanding, using RRF_RT_REG_EXPAND_SZ * without RRF_NOEXPAND is thus not allowed. + * An exception is the case where RRF_RT_ANY is specified, because then + * RRF_NOEXPAND is allowed. */ LSTATUS WINAPI RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, @@ -1481,7 +1483,8 @@ if (pvData && !pcbData) 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)) return ERROR_INVALID_PARAMETER; if (pszSubKey && pszSubKey[0]) @@ -1576,7 +1579,8 @@ if (pvData && !pcbData) 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)) return ERROR_INVALID_PARAMETER; if (pszSubKey && pszSubKey[0])