mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[LDR] Actually allocate what is asked for
This commit is contained in:
parent
3e9cf62470
commit
aa912422e5
1 changed files with 4 additions and 4 deletions
|
@ -52,7 +52,7 @@ LdrpAllocateUnicodeString(IN OUT PUNICODE_STRING StringOut,
|
|||
/* Allocate the string*/
|
||||
StringOut->Buffer = RtlAllocateHeap(LdrpHeap,
|
||||
0,
|
||||
StringOut->Length + sizeof(WCHAR));
|
||||
Length + sizeof(WCHAR));
|
||||
if (!StringOut->Buffer)
|
||||
{
|
||||
/* Fail */
|
||||
|
@ -61,13 +61,13 @@ LdrpAllocateUnicodeString(IN OUT PUNICODE_STRING StringOut,
|
|||
}
|
||||
|
||||
/* Null-terminate it */
|
||||
StringOut->Buffer[StringOut->Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||
StringOut->Buffer[Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||
|
||||
/* Check if this is a maximum-sized string */
|
||||
if (StringOut->Length != UNICODE_STRING_MAX_BYTES)
|
||||
if (Length != UNICODE_STRING_MAX_BYTES)
|
||||
{
|
||||
/* It's not, so set the maximum length to be one char more */
|
||||
StringOut->MaximumLength = StringOut->Length + sizeof(UNICODE_NULL);
|
||||
StringOut->MaximumLength = Length + sizeof(UNICODE_NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue