--- tests/old/registry.c 2008-07-11 17:55:54.000000000 +0200 +++ tests/registry.c 2008-07-17 21:12:33.000000000 +0200 @@ -858,6 +858,16 @@ /* Query REG_EXPAND_SZ using RRF_RT_REG_EXPAND_SZ (not allowed without RRF_NOEXPAND) */ ret = pRegGetValueA(hkey_main, NULL, "TP1_EXP_SZ", RRF_RT_REG_EXPAND_SZ, NULL, NULL, NULL); ok(ret == ERROR_INVALID_PARAMETER, "ret=%d\n", ret); + + /* Query REG_EXPAND_SZ using (RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ) without RRF_NOEXPAND */ + buf[0] = 0; type = 0xdeadbeef; size = sizeof(buf); + ret = pRegGetValueA(hkey_main, NULL, "TP1_EXP_SZ", RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ, &type, buf, &size); + ok(ret == ERROR_SUCCESS, "ret=%d\n", ret); + /* At least v5.2.3790.1830 (2003 SP1) returns the unexpanded sTestpath1 length + 1 here. */ + ok(size == strlen(expanded)+1 || broken(size == strlen(sTestpath1)+1), + "strlen(expanded)=%d, strlen(sTestpath1)=%d, size=%d\n", lstrlenA(expanded), lstrlenA(sTestpath1), size); + ok(type == REG_SZ, "type=%d\n", type); + ok(!strcmp(expanded, buf), "expanded=\"%s\" buf=\"%s\"\n", expanded, buf); } static void test_reg_open_key(void)