mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
It was a bad idea to manipulate the length of the given unicode string if we don't like the the starting back slash.
svn path=/trunk/; revision=15912
This commit is contained in:
parent
d101bc4e2d
commit
83ff161361
1 changed files with 6 additions and 7 deletions
|
@ -1015,22 +1015,21 @@ ObInsertObject(IN PVOID Object,
|
|||
/* FIXME: TEMPORARY HACK This will go in ObFindObject in the next commit */
|
||||
PVOID NewName;
|
||||
PWSTR BufferPos = RemainingPath.Buffer;
|
||||
ULONG Delta = 0;
|
||||
|
||||
NewName = ExAllocatePool(NonPagedPool, RemainingPath.MaximumLength);
|
||||
ObjectNameInfo = HEADER_TO_OBJECT_NAME(Header);
|
||||
|
||||
if (BufferPos[0] == L'\\')
|
||||
{
|
||||
BufferPos++;
|
||||
RemainingPath.Length -= 2;
|
||||
RemainingPath.MaximumLength -= 2;
|
||||
Delta = sizeof(WCHAR);
|
||||
}
|
||||
|
||||
RtlMoveMemory(NewName, BufferPos, RemainingPath.MaximumLength);
|
||||
NewName = ExAllocatePool(NonPagedPool, RemainingPath.MaximumLength - Delta);
|
||||
RtlMoveMemory(NewName, BufferPos, RemainingPath.MaximumLength - Delta);
|
||||
if (ObjectNameInfo->Name.Buffer) ExFreePool(ObjectNameInfo->Name.Buffer);
|
||||
ObjectNameInfo->Name.Buffer = NewName;
|
||||
ObjectNameInfo->Name.Length = RemainingPath.Length;
|
||||
ObjectNameInfo->Name.MaximumLength = RemainingPath.MaximumLength;
|
||||
ObjectNameInfo->Name.Length = RemainingPath.Length - Delta;
|
||||
ObjectNameInfo->Name.MaximumLength = RemainingPath.MaximumLength - Delta;
|
||||
DPRINT("Name: %S\n", ObjectNameInfo->Name.Buffer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue