On 03/16/2010 03:56 PM, Paul Vriens wrote:
On 03/16/2010 03:20 PM, Reece Dunn wrote:
On 16 March 2010 13:27, Paul Vriens<paul.vriens.w...@gmail.com> wrote:
Hi,

I was wondering why I (out of all those boxes) had several failures for
these tests on some of my XP and Vista boxes.

I was wondering the same.

Turns out that you get these failures when MSE is active. I just ran the
tests on a clean XP-SP3 box (up-to-date) and no failures. Installing MSE
(and downloading the latest signatures) is enough to show a multitude of
test failures. Turning 'real time monitoring' off or excluding the test
executable makes the tests succeed again.

Most of the failures are of the E_ACCESSDENIED nature btw.

This is interesting. I wonder if it is because MSE is locking the file
so it can scan it for viruses, so when the next test gets run, the
istream test cannot access that file and so gets an E_ACCESSDENIED
back.

I never had this issue with either "Microsoft Defender" or the Avast!
Home Edition virus scanner.


Does this make sense?

Yes.

If the test failures are valid, should I change the tests to cope
with this?

The test failures look valid in this case (MSE may be installed on a
test system), so a change similar to
http://source.winehq.org/git/wine.git/?a=commitdiff;h=1571337c0366b27e819851d7cdec4a7bc1ce7690

should be done.

The thing is that depending on the mode/flag the failures start at a
different place. I'll see if I can create something generic or whether
the flags indicate something (don't think so as several runs produces
different output).


The attached patch fixes the issue on my boxes. Looks like it's just a timing issue (MSE being sllloooowww I guess).

I should maybe raise the timeout to something higher, it's only affecting a handful of boxes anyway?

--
Cheers,

Paul.
diff --git a/dlls/shlwapi/tests/istream.c b/dlls/shlwapi/tests/istream.c
index 9501cd8..d30132a 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("Probably blocked 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,12 @@ 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("Probably blocked 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 +518,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("Probably blocked 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");
 


Reply via email to