Zebediah Figura : comdlg32/tests: Use GetTempPathA() instead of the current directory in test_extension().

Alexandre Julliard julliard at winehq.org
Wed Jan 15 16:26:48 CST 2020


Module: wine
Branch: master
Commit: 9024549fe147e884737c561232b77a150e7837d7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9024549fe147e884737c561232b77a150e7837d7

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Jan 15 09:58:11 2020 -0600

comdlg32/tests: Use GetTempPathA() instead of the current directory in test_extension().

For some reason, a previous test sets the current directory to
C:\windows\system32\ on my Windows 10 machine, which prompts message boxes as
the path is not writable.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comdlg32/tests/filedlg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c
index bf4d1f22eb..165b5cd8bd 100644
--- a/dlls/comdlg32/tests/filedlg.c
+++ b/dlls/comdlg32/tests/filedlg.c
@@ -1051,7 +1051,7 @@ static void test_extension(void)
 {
     OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A };
     char filename[1024] = {0};
-    char curdir[MAX_PATH];
+    char dir[MAX_PATH];
     unsigned int i;
     BOOL boolret;
 
@@ -1070,14 +1070,14 @@ static void test_extension(void)
         NULL    /* is a test, not an endmark! */
     };
 
-    boolret = GetCurrentDirectoryA(sizeof(curdir), curdir);
+    boolret = GetTempPathA(sizeof(dir), dir);
     ok(boolret, "Failed to get current dir err %d\n", GetLastError());
 
     ofn.hwndOwner = NULL;
     ofn.lpstrFile = filename;
     ofn.nMaxFile = MAX_PATH;
     ofn.Flags = OFN_EXPLORER | OFN_ENABLEHOOK;
-    ofn.lpstrInitialDir = curdir;
+    ofn.lpstrInitialDir = dir;
     ofn.lpfnHook = test_extension_wndproc;
     ofn.nFileExtension = 0;
 




More information about the wine-cvs mailing list