Alexandre Julliard : kernel32/tests: Run file tests in the temp directory if we don' t have access to the drive root.

Alexandre Julliard julliard at winehq.org
Wed May 27 09:26:53 CDT 2009


Module: wine
Branch: master
Commit: 9ccc9bd6a957c9f3bafc336387901ba4eff6a8eb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9ccc9bd6a957c9f3bafc336387901ba4eff6a8eb

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed May 27 12:47:33 2009 +0200

kernel32/tests: Run file tests in the temp directory if we don't have access to the drive root.

---

 dlls/kernel32/tests/file.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 86ad4e5..2328d37 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -1376,7 +1376,12 @@ static void test_FindFirstFileA(void)
 
     /* try FindFirstFileA on "C:\foo\" */
     SetLastError( 0xdeadbeaf );
-    GetTempFileNameA( buffer, "foo", 0, nonexistent );
+    if (!GetTempFileNameA( buffer, "foo", 0, nonexistent ) && GetLastError() == ERROR_ACCESS_DENIED)
+    {
+        char tmp[MAX_PATH];
+        GetTempPathA( sizeof(tmp), tmp );
+        GetTempFileNameA( tmp, "foo", 0, nonexistent );
+    }
     DeleteFileA( nonexistent );
     strcpy(buffer2, nonexistent);
     strcat(buffer2, "\\");




More information about the wine-cvs mailing list