mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
Fix FsRtlDissectName(). Pierre Schweitzer.
svn path=/trunk/; revision=42722
This commit is contained in:
parent
bc80314293
commit
961afecdd8
1 changed files with 7 additions and 3 deletions
|
@ -142,6 +142,10 @@ FsRtlDissectName(IN UNICODE_STRING Name,
|
||||||
ULONG FirstPosition, i;
|
ULONG FirstPosition, i;
|
||||||
ULONG SkipFirstSlash = 0;
|
ULONG SkipFirstSlash = 0;
|
||||||
|
|
||||||
|
/* Zero the strings before continuing */
|
||||||
|
RtlZeroMemory(FirstPart, sizeof(UNICODE_STRING));
|
||||||
|
RtlZeroMemory(RemainingPart, sizeof(UNICODE_STRING));
|
||||||
|
|
||||||
/* Just quit if the string is empty */
|
/* Just quit if the string is empty */
|
||||||
if (!Name.Length) return;
|
if (!Name.Length) return;
|
||||||
|
|
||||||
|
@ -169,14 +173,14 @@ FsRtlDissectName(IN UNICODE_STRING Name,
|
||||||
/* Set up the first result string */
|
/* Set up the first result string */
|
||||||
FirstPart->Buffer = Name.Buffer + SkipFirstSlash;
|
FirstPart->Buffer = Name.Buffer + SkipFirstSlash;
|
||||||
FirstPart->Length = (FirstPosition - SkipFirstSlash) * sizeof(WCHAR);
|
FirstPart->Length = (FirstPosition - SkipFirstSlash) * sizeof(WCHAR);
|
||||||
FirstPart->MaximumLength = Name.MaximumLength - FirstPart->Length;
|
FirstPart->MaximumLength = FirstPart->Length;
|
||||||
|
|
||||||
/* And second one, if necessary */
|
/* And second one, if necessary */
|
||||||
if (FirstPosition < (Name.Length / sizeof(WCHAR)))
|
if (FirstPosition < (Name.Length / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
RemainingPart->Buffer = Name.Buffer + FirstPosition + 1;
|
RemainingPart->Buffer = Name.Buffer + FirstPosition + 1;
|
||||||
RemainingPart->Length = (Name.Length - FirstPosition) * sizeof(WCHAR);
|
RemainingPart->Length = Name.Length - (FirstPosition + 1) * sizeof(WCHAR);
|
||||||
RemainingPart->MaximumLength = Name.MaximumLength - RemainingPart->Length;
|
RemainingPart->MaximumLength = RemainingPart->Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue