advapi32/tests: Change the current directory to a place that will be writable.

Francois Gouget fgouget at free.fr
Tue Mar 4 06:56:26 CST 2014


---
 dlls/advapi32/tests/eventlog.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/advapi32/tests/eventlog.c b/dlls/advapi32/tests/eventlog.c
index f71529c..525d606 100644
--- a/dlls/advapi32/tests/eventlog.c
+++ b/dlls/advapi32/tests/eventlog.c
@@ -1123,6 +1123,8 @@ static void cleanup_eventlog(void)
 
 START_TEST(eventlog)
 {
+    char curdir[MAX_PATH], tmpdir[MAX_PATH];
+
     SetLastError(0xdeadbeef);
     CloseEventLog(NULL);
     if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
@@ -1131,6 +1133,10 @@ START_TEST(eventlog)
         return;
     }
 
+    GetCurrentDirectoryA(MAX_PATH, curdir);
+    GetTempPathA(MAX_PATH, tmpdir);
+    SetCurrentDirectoryA(tmpdir);
+
     init_function_pointers();
 
     /* Parameters only */
@@ -1150,4 +1156,6 @@ START_TEST(eventlog)
         test_autocreation();
         cleanup_eventlog();
     }
+
+    SetCurrentDirectoryA(curdir);
 }
-- 
1.8.5.3




More information about the wine-patches mailing list