From 3100fc899593b8b461106e84c303af6ed4eec6bd Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 7 Sep 2010 15:21:06 +0000 Subject: [PATCH] [USETUP] Allocate a drive layout buffer that is large enough to keep a primary partition table (4 partition entries) plus 26 logical drives (2 partition entries each). Total 56 partition entries. This should be enough for everybody until we support GPT partition tables. ;-) See issue #5270 for more details. svn path=/trunk/; revision=48722 --- reactos/base/setup/usetup/partlist.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/reactos/base/setup/usetup/partlist.c b/reactos/base/setup/usetup/partlist.c index 3fc799af1c7..7e2c7510976 100644 --- a/reactos/base/setup/usetup/partlist.c +++ b/reactos/base/setup/usetup/partlist.c @@ -701,6 +701,7 @@ AddDiskToList (HANDLE FileHandle, ULONG i; PLIST_ENTRY ListEntry; PBIOSDISKENTRY BiosDiskEntry; + ULONG LayoutBufferSize; Status = NtDeviceIoControlFile (FileHandle, NULL, @@ -870,9 +871,15 @@ AddDiskToList (HANDLE FileHandle, InsertAscendingList(&List->DiskListHead, DiskEntry, DISKENTRY, ListEntry, BiosDiskNumber); + /* + * Allocate a buffer for 26 logical drives (2 entries each == 52) + * plus the main partiton table (4 entries). Total 56 entries. + */ + LayoutBufferSize = sizeof(DRIVE_LAYOUT_INFORMATION) + + ((56 - ANYSIZE_ARRAY) * sizeof(PARTITION_INFORMATION)); LayoutBuffer = (DRIVE_LAYOUT_INFORMATION*)RtlAllocateHeap (ProcessHeap, 0, - 8192); + LayoutBufferSize); if (LayoutBuffer == NULL) { return; @@ -887,7 +894,7 @@ AddDiskToList (HANDLE FileHandle, NULL, 0, LayoutBuffer, - 8192); + LayoutBufferSize); if (NT_SUCCESS (Status)) { if (LayoutBuffer->PartitionCount == 0)