shlwapi/tests: Fix a test failure on Windows 10.

Francois Gouget fgouget at free.fr
Thu Mar 17 17:38:42 CDT 2016


AssocQueryString() can return S_FALSE with the size of the required buffer.

Signed-off-by: Francois Gouget <fgouget at free.fr>
---
 dlls/shlwapi/tests/assoc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/shlwapi/tests/assoc.c b/dlls/shlwapi/tests/assoc.c
index cbc40ce..266f3fd 100644
--- a/dlls/shlwapi/tests/assoc.c
+++ b/dlls/shlwapi/tests/assoc.c
@@ -102,9 +102,11 @@ static void test_getstring_bad(void)
     hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotBad, open, NULL, &len);
     ok(hr == E_FAIL ||
        hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ ||
-       hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), /* Win8 */
+       hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND) /* Win8 */ ||
+       hr == S_FALSE, /* Win10 */
        "Unexpected result : %08x\n", hr);
-    ok(len == 0xdeadbeef, "got %u\n", len);
+    ok((hr == S_FALSE && len < sizeof(buf)/sizeof(buf[0])) || len == 0xdeadbeef,
+       "got hr=%08x and len=%u\n", hr, len);
 
     len = 0xdeadbeef;
     hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, invalid, NULL, &len);
-- 
2.7.0




More information about the wine-patches mailing list