mirror of
https://github.com/reactos/reactos.git
synced 2024-10-07 01:44:21 +00:00
[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
This commit is contained in:
parent
340a34cec4
commit
3100fc8995
|
@ -701,6 +701,7 @@ AddDiskToList (HANDLE FileHandle,
|
||||||
ULONG i;
|
ULONG i;
|
||||||
PLIST_ENTRY ListEntry;
|
PLIST_ENTRY ListEntry;
|
||||||
PBIOSDISKENTRY BiosDiskEntry;
|
PBIOSDISKENTRY BiosDiskEntry;
|
||||||
|
ULONG LayoutBufferSize;
|
||||||
|
|
||||||
Status = NtDeviceIoControlFile (FileHandle,
|
Status = NtDeviceIoControlFile (FileHandle,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -870,9 +871,15 @@ AddDiskToList (HANDLE FileHandle,
|
||||||
|
|
||||||
InsertAscendingList(&List->DiskListHead, DiskEntry, DISKENTRY, ListEntry, BiosDiskNumber);
|
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,
|
LayoutBuffer = (DRIVE_LAYOUT_INFORMATION*)RtlAllocateHeap (ProcessHeap,
|
||||||
0,
|
0,
|
||||||
8192);
|
LayoutBufferSize);
|
||||||
if (LayoutBuffer == NULL)
|
if (LayoutBuffer == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -887,7 +894,7 @@ AddDiskToList (HANDLE FileHandle,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
LayoutBuffer,
|
LayoutBuffer,
|
||||||
8192);
|
LayoutBufferSize);
|
||||||
if (NT_SUCCESS (Status))
|
if (NT_SUCCESS (Status))
|
||||||
{
|
{
|
||||||
if (LayoutBuffer->PartitionCount == 0)
|
if (LayoutBuffer->PartitionCount == 0)
|
||||||
|
|
Loading…
Reference in a new issue