Author: tfaber Date: Fri May 4 10:32:49 2012 New Revision: 56490
URL: http://svn.reactos.org/svn/reactos?rev=56490&view=rev Log: [KERNEL32] - Fix SetCurrentDirectoryA to return success when setting the current directory again See issue #6874 for more details.
Modified: trunk/reactos/dll/win32/kernel32/client/path.c
Modified: trunk/reactos/dll/win32/kernel32/client/path.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/p... ============================================================================== --- trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] Fri May 4 10:32:49 2012 @@ -1372,7 +1372,7 @@ /* 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 @@ 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 @@ { /* 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 @@ 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;