Author: dchapyshev Date: Wed Jul 15 17:27:59 2009 New Revision: 41971
URL: http://svn.reactos.org/svn/reactos?rev=41971&view=rev Log: - Currently, SearchPathW fails with path such as subdir\binary.exe. This patch is there to address it. It permits VBoxService to launch, and probably others. Patch by zefklop (jerome.gardou@laposte.net) See issue #4697 for more details.
Modified: trunk/reactos/dll/win32/kernel32/file/dir.c
Modified: trunk/reactos/dll/win32/kernel32/file/dir.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/dir... ============================================================================== --- trunk/reactos/dll/win32/kernel32/file/dir.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/file/dir.c [iso-8859-1] Wed Jul 15 17:27:59 2009 @@ -1006,23 +1006,26 @@ PWCHAR EnvironmentBufferW = NULL; PWCHAR AppPathW = NULL; WCHAR Buffer; - BOOL HasExtension; + BOOL HasExtension = FALSE, IsAbsolute = FALSE; LPCWSTR p; PWCHAR Name;
TRACE("SearchPath\n");
- HasExtension = FALSE; p = lpFileName + wcslen(lpFileName); while (lpFileName < p && L'\' != *(p - 1) && - L'/' != *(p - 1) && - L':' != *(p - 1)) + L'/' != *(p - 1)) { HasExtension = HasExtension || L'.' == *(p - 1); + if (p >= lpFileName && L'\' == *(p-1)) + { + if (':' == *p) + IsAbsolute = TRUE; + } p--; } - if (lpFileName < p) + if (IsAbsolute) { if (HasExtension || NULL == lpExtension) { @@ -1041,7 +1044,7 @@ } wcscat(wcscpy(Name, lpFileName), lpExtension); } - if (RtlDoesFileExists_U(Name)) + if (RtlDoesFileExists_U(Name)) { retCode = RtlGetFullPathName_U (Name, nBufferLength * sizeof(WCHAR),