From 57c3c75356dd4b73709a264eb91b106924a71a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Fri, 11 Jun 2004 20:15:07 +0000 Subject: [PATCH] Set MaximumLength to size of allocated memory svn path=/trunk/; revision=9658 --- reactos/subsys/win32k/ntuser/misc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/misc.c b/reactos/subsys/win32k/ntuser/misc.c index b64f7878c93..68cfe18e24b 100644 --- a/reactos/subsys/win32k/ntuser/misc.c +++ b/reactos/subsys/win32k/ntuser/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.76 2004/05/28 21:33:41 gvg Exp $ +/* $Id: misc.c,v 1.77 2004/06/11 20:15:07 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -1138,7 +1138,8 @@ IntSafeCopyUnicodeString(PUNICODE_STRING Dest, if(Dest->Length > 0 && Src) { - Dest->Buffer = ExAllocatePoolWithTag(NonPagedPool, Dest->Length, TAG_STRING); + Dest->MaximumLength = Dest->Length; + Dest->Buffer = ExAllocatePoolWithTag(NonPagedPool, Dest->MaximumLength, TAG_STRING); if(!Dest->Buffer) { return STATUS_NO_MEMORY; @@ -1183,7 +1184,8 @@ IntSafeCopyUnicodeStringTerminateNULL(PUNICODE_STRING Dest, if(Dest->Length > 0 && Src) { - Dest->Buffer = ExAllocatePoolWithTag(NonPagedPool, Dest->Length + sizeof(WCHAR), TAG_STRING); + Dest->MaximumLength = Dest->Length + sizeof(WCHAR); + Dest->Buffer = ExAllocatePoolWithTag(NonPagedPool, Dest->MaximumLength, TAG_STRING); if(!Dest->Buffer) { return STATUS_NO_MEMORY;