ULONG i;
PLIST_ENTRY ListEntry;
PBIOSDISKENTRY BiosDiskEntry;
+ ULONG LayoutBufferSize;
Status = NtDeviceIoControlFile (FileHandle,
NULL,
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;
NULL,
0,
LayoutBuffer,
- 8192);
+ LayoutBufferSize);
if (NT_SUCCESS (Status))
{
if (LayoutBuffer->PartitionCount == 0)