Reduced the size of the copy buffer.

svn path=/trunk/; revision=3988
This commit is contained in:
Hartmut Birr 2003-01-11 16:03:55 +00:00
parent 99a3325875
commit 6dac0c12b1

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: filesup.c,v 1.2 2002/11/23 01:55:27 ekohl Exp $ /* $Id: filesup.c,v 1.3 2003/01/11 16:03:55 hbirr Exp $
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup * PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/filesup.c * FILE: subsys/system/usetup/filesup.c
@ -102,7 +102,6 @@ SetupCopyFile(PWCHAR SourceFileName,
NTSTATUS Status; NTSTATUS Status;
Buffer = NULL; Buffer = NULL;
RegionSize = 0x1000000;
RtlInitUnicodeString(&FileName, RtlInitUnicodeString(&FileName,
SourceFileName); SourceFileName);
@ -203,6 +202,11 @@ CHECKPOINT1;
return(Status); return(Status);
} }
RegionSize = PAGE_ROUND_UP(FileStandard.EndOfFile.u.LowPart);
if (RegionSize > 0x100000)
{
RegionSize = 0x100000;
}
Status = NtAllocateVirtualMemory(NtCurrentProcess(), Status = NtAllocateVirtualMemory(NtCurrentProcess(),
(PVOID *)&Buffer, (PVOID *)&Buffer,
2, 2,