kernel32/tests: Use shared Windows directory on TS to find regedit.exe.
authorGe van Geldorp <ge@gse.nl>
Sun, 28 Dec 2008 16:26:41 +0000 (17:26 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 29 Dec 2008 11:11:41 +0000 (12:11 +0100)
dlls/kernel32/tests/file.c

index 338ba464ec5df3cdbac036a495132f802cb9dd04..e8e5c8fac028800e657854128073ce4f3c1bb4e5 100644 (file)
@@ -35,6 +35,7 @@
 static HANDLE (WINAPI *pFindFirstFileExA)(LPCSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD);
 static BOOL (WINAPI *pReplaceFileA)(LPCSTR, LPCSTR, LPCSTR, DWORD, LPVOID, LPVOID);
 static BOOL (WINAPI *pReplaceFileW)(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPVOID, LPVOID);
+static UINT (WINAPI *pGetSystemWindowsDirectoryA)(LPSTR, UINT);
 
 /* keep filename and filenameW the same */
 static const char filename[] = "testfile.xxx";
@@ -58,6 +59,7 @@ static void InitFunctionPointers(void)
     pFindFirstFileExA=(void*)GetProcAddress(hkernel32, "FindFirstFileExA");
     pReplaceFileA=(void*)GetProcAddress(hkernel32, "ReplaceFileA");
     pReplaceFileW=(void*)GetProcAddress(hkernel32, "ReplaceFileW");
+    pGetSystemWindowsDirectoryA=(void*)GetProcAddress(hkernel32, "GetSystemWindowsDirectoryA");
 }
 
 static void test__hread( void )
@@ -1752,7 +1754,10 @@ static void test_OpenFile(void)
     UINT length;
     
     /* Check for existing file */
-    length = GetWindowsDirectoryA(buff, MAX_PATH);
+    if (!pGetSystemWindowsDirectoryA)
+        length = GetWindowsDirectoryA(buff, MAX_PATH);
+    else
+        length = pGetSystemWindowsDirectoryA(buff, MAX_PATH);
 
     if (length + sizeof(file) < MAX_PATH)
     {