From f6abb6c7ac83fcab55946f1f23f4e6a25c56558b Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 4 May 2012 10:32:49 +0000 Subject: [PATCH] [KERNEL32] - Fix SetCurrentDirectoryA to return success when setting the current directory again See issue #6874 for more details. svn path=/trunk/; revision=56490 --- reactos/dll/win32/kernel32/client/path.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/path.c b/reactos/dll/win32/kernel32/client/path.c index 38520b33d38..c22dcd80eaf 100644 --- a/reactos/dll/win32/kernel32/client/path.c +++ b/reactos/dll/win32/kernel32/client/path.c @@ -1372,7 +1372,7 @@ SearchPathW(IN LPCWSTR lpPath, /* Create the string that describes the output buffer from the caller */ CallerBuffer.Length = 0; CallerBuffer.Buffer = lpBuffer; - + /* How much space does the caller have? */ if (nBufferLength <= UNICODE_STRING_MAX_CHARS) { @@ -1407,7 +1407,7 @@ SearchPathW(IN LPCWSTR lpPath, Status); DbgPrint(" Path = %wZ\n", &PathString); } - + /* Check if the failure was due to a small buffer */ if (Status == STATUS_BUFFER_TOO_SMALL) { @@ -1425,7 +1425,7 @@ SearchPathW(IN LPCWSTR lpPath, { /* It worked! Write the file part now */ if (lpFilePart) *lpFilePart = &lpBuffer[FilePartSize]; - + /* Convert the final result length */ Result = CallerBuffer.Length / sizeof(WCHAR); } @@ -2205,7 +2205,7 @@ SetCurrentDirectoryA(IN LPCSTR lpPathName) DirName = Basep8BitStringToStaticUnicodeString(lpPathName); if (!DirName) return FALSE; - if (CheckForSameCurdir(DirName)) return FALSE; + if (CheckForSameCurdir(DirName)) return TRUE; Status = RtlSetCurrentDirectory_U(DirName); if (NT_SUCCESS(Status)) return TRUE;