mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +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;
|
PNP_FCB Fcb;
|
||||||
BOOLEAN RootPipe;
|
BOOLEAN RootPipe;
|
||||||
PWCHAR NameBuffer;
|
PWCHAR NameBuffer;
|
||||||
ULONG BufferOffset;
|
|
||||||
USHORT Length, MaximumLength;
|
USHORT Length, MaximumLength;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
@ -233,6 +232,7 @@ NpCreateFcb(IN PNP_DCB Dcb,
|
||||||
RootPipe = FALSE;
|
RootPipe = FALSE;
|
||||||
if (PipeName->Buffer[0] != OBJ_NAME_PATH_SEPARATOR)
|
if (PipeName->Buffer[0] != OBJ_NAME_PATH_SEPARATOR)
|
||||||
{
|
{
|
||||||
|
Length += sizeof(OBJ_NAME_PATH_SEPARATOR);
|
||||||
MaximumLength += sizeof(OBJ_NAME_PATH_SEPARATOR);
|
MaximumLength += sizeof(OBJ_NAME_PATH_SEPARATOR);
|
||||||
RootPipe = TRUE;
|
RootPipe = TRUE;
|
||||||
if (MaximumLength < sizeof(WCHAR))
|
if (MaximumLength < sizeof(WCHAR))
|
||||||
|
@ -262,15 +262,21 @@ NpCreateFcb(IN PNP_DCB Dcb,
|
||||||
|
|
||||||
InsertTailList(&Dcb->FcbList, &Fcb->DcbEntry);
|
InsertTailList(&Dcb->FcbList, &Fcb->DcbEntry);
|
||||||
|
|
||||||
BufferOffset = 0;
|
|
||||||
if (RootPipe)
|
if (RootPipe)
|
||||||
{
|
{
|
||||||
NameBuffer[0] = OBJ_NAME_PATH_SEPARATOR;
|
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[Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
NameBuffer[BufferOffset + (Length / sizeof(WCHAR))] = UNICODE_NULL;
|
|
||||||
|
|
||||||
Fcb->FullName.Length = Length;
|
Fcb->FullName.Length = Length;
|
||||||
Fcb->FullName.MaximumLength = MaximumLength;
|
Fcb->FullName.MaximumLength = MaximumLength;
|
||||||
|
|
Loading…
Reference in a new issue