If some Windows services stop while testing EnumServicesStatusW()'s resume handle support, one possibility is that the still running services all fit in the specified buffer, invalidating the test so there is a retry in place. But in some cases the second call just returns fewer tests than expected. So retry in that case too.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53460
--- This fixes the remaining failures on Windows 8.
From: Francois Gouget fgouget@codeweavers.com
If some Windows services stop while testing EnumServicesStatusW()'s resume handle support, one possibility is that the still running services all fit in the specified buffer, invalidating the test so there is a retry in place. But in some cases the second call just returns fewer tests than expected. So retry in that case too.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53460 --- This fixes the remaining failures on Windows 8. --- dlls/advapi32/tests/service.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c index 4e6aebb445d..3fb1bda1d7d 100644 --- a/dlls/advapi32/tests/service.c +++ b/dlls/advapi32/tests/service.c @@ -1370,6 +1370,8 @@ static BOOL test_enum_svc(int attempt) goto retry; /* service start race condition */ ok(ret, "Expected success, got error %lu\n", GetLastError()); ok(needed == 0, "Expected 0 needed bytes as we are done, got %lu\n", needed); + if (returned < missing && strcmp(winetest_platform, "wine") && attempt) + goto retry; /* service stop race condition */ todo_wine ok(returned == missing, "Expected %lu remaining services, got %lu\n", missing, returned); ok(resume == 0, "Expected the resume handle to be 0\n");