From 33b45cf98df116f927d25c76824fdb7d343fc9db Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Tue, 16 Mar 2010 19:21:08 +0100 Subject: [PATCH] shlwapi/tests: Fix some test failures on XP/Vista. --- dlls/shlwapi/tests/istream.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/shlwapi/tests/istream.c b/dlls/shlwapi/tests/istream.c index 9501cd8a58f..4a36b3ab0ba 100644 --- a/dlls/shlwapi/tests/istream.c +++ b/dlls/shlwapi/tests/istream.c @@ -432,6 +432,11 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm) stream = NULL; ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, template, &stream); + if (ret == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED)) { + win_skip("File probably locked by Anti-Virus/Spam software, trying again\n"); + Sleep(1000); + ret = (*pSHCreateStreamOnFileEx)(test_file, mode, 0, FALSE, template, &stream); + } ok( ret == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || ret == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), "SHCreateStreamOnFileEx: expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) or " @@ -491,6 +496,11 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm) stream = NULL; ret = (*pSHCreateStreamOnFileEx)(test_file, mode | STGM_CREATE | stgm, 0, FALSE, NULL, &stream); + if (ret == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED)) { + win_skip("File probably locked by Anti-Virus/Spam software, trying again\n"); + Sleep(1000); + ret = (*pSHCreateStreamOnFileEx)(test_file, mode | STGM_CREATE | stgm, 0, FALSE, NULL, &stream); + } ok(ret == S_OK, "SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n", ret); ok(stream != NULL, "SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n"); @@ -507,6 +517,11 @@ static void test_SHCreateStreamOnFileEx(DWORD mode, DWORD stgm) stream = NULL; ret = (*pSHCreateStreamOnFileEx)(test_file, mode | STGM_CREATE | stgm, 0, TRUE, NULL, &stream); + if (ret == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED)) { + win_skip("File probably locked by Anti-Virus/Spam software, trying again\n"); + Sleep(1000); + ret = (*pSHCreateStreamOnFileEx)(test_file, mode | STGM_CREATE | stgm, 0, TRUE, NULL, &stream); + } ok(ret == S_OK, "SHCreateStreamOnFileEx: expected S_OK, got 0x%08x\n", ret); ok(stream != NULL, "SHCreateStreamOnFileEx: expected a valid IStream object, got NULL\n"); -- 2.11.4.GIT