mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[NPFS]
- Don't truncate pipe name in the RootPipe case in NpCreateFcb. Found by Windows's RtlInsertUnicodePrefix implementation -- which might indicate that ours is broken. svn path=/trunk/; revision=64763
This commit is contained in:
parent
32f8a44f8e
commit
e67bbc79a9
1 changed files with 11 additions and 5 deletions
|
@ -218,7 +218,6 @@ NpCreateFcb(IN PNP_DCB Dcb,
|
|||
PNP_FCB Fcb;
|
||||
BOOLEAN RootPipe;
|
||||
PWCHAR NameBuffer;
|
||||
ULONG BufferOffset;
|
||||
USHORT Length, MaximumLength;
|
||||
PAGED_CODE();
|
||||
|
||||
|
@ -233,6 +232,7 @@ NpCreateFcb(IN PNP_DCB Dcb,
|
|||
RootPipe = FALSE;
|
||||
if (PipeName->Buffer[0] != OBJ_NAME_PATH_SEPARATOR)
|
||||
{
|
||||
Length += sizeof(OBJ_NAME_PATH_SEPARATOR);
|
||||
MaximumLength += sizeof(OBJ_NAME_PATH_SEPARATOR);
|
||||
RootPipe = TRUE;
|
||||
if (MaximumLength < sizeof(WCHAR))
|
||||
|
@ -262,15 +262,21 @@ NpCreateFcb(IN PNP_DCB Dcb,
|
|||
|
||||
InsertTailList(&Dcb->FcbList, &Fcb->DcbEntry);
|
||||
|
||||
BufferOffset = 0;
|
||||
if (RootPipe)
|
||||
{
|
||||
NameBuffer[0] = OBJ_NAME_PATH_SEPARATOR;
|
||||
BufferOffset = 1;
|
||||
RtlCopyMemory(NameBuffer + 1,
|
||||
PipeName->Buffer,
|
||||
PipeName->Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlCopyMemory(NameBuffer,
|
||||
PipeName->Buffer,
|
||||
PipeName->Length);
|
||||
}
|
||||
|
||||
RtlCopyMemory(NameBuffer + BufferOffset, PipeName->Buffer, Length);
|
||||
NameBuffer[BufferOffset + (Length / sizeof(WCHAR))] = UNICODE_NULL;
|
||||
NameBuffer[Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||
|
||||
Fcb->FullName.Length = Length;
|
||||
Fcb->FullName.MaximumLength = MaximumLength;
|
||||
|
|
Loading…
Reference in a new issue