mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[RTL]: Makes sure there is a curdir handle.
svn path=/trunk/; revision=52728
This commit is contained in:
parent
16163bbc4a
commit
1fdc23fa32
1 changed files with 10 additions and 7 deletions
|
@ -593,14 +593,17 @@ RtlpDosPathNameToRelativeNtPathName_Ustr(IN BOOLEAN HaveRelative,
|
|||
PCURDIR cd;
|
||||
UNICODE_STRING us;
|
||||
cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectory.DosPath);
|
||||
RtlInitUnicodeString(&us, Buffer);
|
||||
if (RtlEqualUnicodeString(&us, &cd->DosPath, TRUE))
|
||||
if (cd->Handle)
|
||||
{
|
||||
Length = ((cd->DosPath.Length / sizeof(WCHAR)) - PrefixCut) + ((InputPathType == 1) ? 8 : 4);
|
||||
RelativeName->RelativeName.Buffer = NewBuffer + Length;
|
||||
RelativeName->RelativeName.Length = NtName->Length - (Length * sizeof(WCHAR));
|
||||
RelativeName->RelativeName.MaximumLength = RelativeName->RelativeName.Length;
|
||||
RelativeName->ContainingDirectory = cd->Handle;
|
||||
RtlInitUnicodeString(&us, Buffer);
|
||||
if (RtlEqualUnicodeString(&us, &cd->DosPath, TRUE))
|
||||
{
|
||||
Length = ((cd->DosPath.Length / sizeof(WCHAR)) - PrefixCut) + ((InputPathType == 1) ? 8 : 4);
|
||||
RelativeName->RelativeName.Buffer = NewBuffer + Length;
|
||||
RelativeName->RelativeName.Length = NtName->Length - (Length * sizeof(WCHAR));
|
||||
RelativeName->RelativeName.MaximumLength = RelativeName->RelativeName.Length;
|
||||
RelativeName->ContainingDirectory = cd->Handle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue