O
O_TEXT
Why the last line?
NTSTATUS
STDCALL
RtlAppendUnicodeStringToString(
IN OUT PUNICODE_STRING Destination,
IN PUNICODE_STRING Source)
{
if ((Source->Length + Destination->Length) >=
Destination->MaximumLength)
return STATUS_BUFFER_TOO_SMALL;
memcpy((PVOID)Destination->Buffer + Destination->Length,
Source->Buffer, Source->Length);
Destination->Length += Source->Length;
if( Destination->MaximumLength > Destination->Length )
Destination->Buffer[Destination->Length / sizeof(WCHAR)] = 0;
return STATUS_SUCCESS;
}
drivers/filesystems/fastfat/fcb.c (extraits):
PathNameLength = directoryFCB->PathNameU.Length +
max(DirContext->LongNameU.Length,
DirContext->ShortNameU.Length);
if (!vfatFCBIsRoot (directoryFCB))
{
PathNameLength += sizeof(WCHAR);
}
if (PathNameLength > LONGNAME_MAX_LENGTH * sizeof(WCHAR))
{
return STATUS_OBJECT_NAME_INVALID;
}
PathNameBuffer = ExAllocatePoolWithTag(NonPagedPool,
PathNameLength + sizeof(WCHAR), TAG_FCB);
if (!PathNameBuffer)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
NameU.Buffer = PathNameBuffer;
NameU.Length = 0;
NameU.MaximumLength = PathNameLength;
RtlCopyUnicodeString(&NameU, &directoryFCB->PathNameU);
if (!vfatFCBIsRoot (directoryFCB))
{
RtlAppendUnicodeToString(&NameU, L"\\");
}
hash = vfatNameHash(0, &NameU);
if (DirContext->LongNameU.Length > 0)
{
RtlAppendUnicodeStringToString(&NameU,
&DirContext->LongNameU);
}
else
{
RtlAppendUnicodeStringToString(&NameU,
&DirContext->ShortNameU);
}
NameU.Buffer[NameU.Length / sizeof(WCHAR)] = 0;
NTSTATUS
STDCALL
RtlAppendUnicodeStringToString(
IN OUT PUNICODE_STRING Destination,
IN PUNICODE_STRING Source)
{
if ((Source->Length + Destination->Length) >=
Destination->MaximumLength)
return STATUS_BUFFER_TOO_SMALL;
memcpy((PVOID)Destination->Buffer + Destination->Length,
Source->Buffer, Source->Length);
Destination->Length += Source->Length;
if( Destination->MaximumLength > Destination->Length )
Destination->Buffer[Destination->Length / sizeof(WCHAR)] = 0;
return STATUS_SUCCESS;
}
drivers/filesystems/fastfat/fcb.c (extraits):
PathNameLength = directoryFCB->PathNameU.Length +
max(DirContext->LongNameU.Length,
DirContext->ShortNameU.Length);
if (!vfatFCBIsRoot (directoryFCB))
{
PathNameLength += sizeof(WCHAR);
}
if (PathNameLength > LONGNAME_MAX_LENGTH * sizeof(WCHAR))
{
return STATUS_OBJECT_NAME_INVALID;
}
PathNameBuffer = ExAllocatePoolWithTag(NonPagedPool,
PathNameLength + sizeof(WCHAR), TAG_FCB);
if (!PathNameBuffer)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
NameU.Buffer = PathNameBuffer;
NameU.Length = 0;
NameU.MaximumLength = PathNameLength;
RtlCopyUnicodeString(&NameU, &directoryFCB->PathNameU);
if (!vfatFCBIsRoot (directoryFCB))
{
RtlAppendUnicodeToString(&NameU, L"\\");
}
hash = vfatNameHash(0, &NameU);
if (DirContext->LongNameU.Length > 0)
{
RtlAppendUnicodeStringToString(&NameU,
&DirContext->LongNameU);
}
else
{
RtlAppendUnicodeStringToString(&NameU,
&DirContext->ShortNameU);
}
NameU.Buffer[NameU.Length / sizeof(WCHAR)] = 0;