--- old/registry.c 2008-07-11 17:55:55.000000000 +0200 +++ registry.c 2008-07-17 21:17:41.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 that both the RRF_RT_REG_EXPAND_SZ and the + * RRF_RT_REG_SZ flags are set, where RRF_NOEXPAND is allowed. */ LSTATUS WINAPI RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, @@ -1481,7 +1483,7 @@ 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 | RRF_RT_REG_SZ))) return ERROR_INVALID_PARAMETER; if (pszSubKey && pszSubKey[0]) @@ -1576,7 +1578,7 @@ 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 | RRF_RT_REG_SZ))) return ERROR_INVALID_PARAMETER; if (pszSubKey && pszSubKey[0])