From c7905ffebce8cd72625b4b5f707fac876a9a9a28 Mon Sep 17 00:00:00 2001 From: Ge van Geldorp Date: Sun, 28 Dec 2008 17:26:41 +0100 Subject: [PATCH] kernel32/tests: Use shared Windows directory on TS to find regedit.exe. --- dlls/kernel32/tests/file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 338ba464ec5..e8e5c8fac02 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -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) {