mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 09:24:11 +00:00
- 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. svn path=/trunk/; revision=41971
This commit is contained in:
parent
179d9487dd
commit
bfb7dae4a2
|
@ -1006,23 +1006,26 @@ SearchPathW (
|
|||
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 @@ SearchPathW (
|
|||
}
|
||||
wcscat(wcscpy(Name, lpFileName), lpExtension);
|
||||
}
|
||||
if (RtlDoesFileExists_U(Name))
|
||||
if (RtlDoesFileExists_U(Name))
|
||||
{
|
||||
retCode = RtlGetFullPathName_U (Name,
|
||||
nBufferLength * sizeof(WCHAR),
|
||||
|
|
Loading…
Reference in a new issue