mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[USETUP]: Fix the primary/extended partitions creation checks introduced in r63392 : indeed this is if there are *already* 4 (primary) partitions in the table that we cannot create new primary/extended partitions.
Otherwise with the old (broken) checks, we allowed creating more than 4 partitions, and then we overflowed over memory and corrupted the partition list structures. svn path=/trunk/; revision=74516
This commit is contained in:
parent
af645ee7a2
commit
3acad0e9e5
1 changed files with 4 additions and 4 deletions
|
@ -3550,8 +3550,8 @@ PrimaryPartitionCreationChecks(
|
|||
if (PartEntry->IsPartitioned == TRUE)
|
||||
return ERROR_NEW_PARTITION;
|
||||
|
||||
/* Fail if there are more than 4 partitions in the list */
|
||||
if (GetPrimaryPartitionCount(DiskEntry) > 4)
|
||||
/* Fail if there are already 4 primary partitions in the list */
|
||||
if (GetPrimaryPartitionCount(DiskEntry) >= 4)
|
||||
return ERROR_PARTITION_TABLE_FULL;
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
|
@ -3572,8 +3572,8 @@ ExtendedPartitionCreationChecks(
|
|||
if (PartEntry->IsPartitioned == TRUE)
|
||||
return ERROR_NEW_PARTITION;
|
||||
|
||||
/* Fail if there are more than 4 partitions in the list */
|
||||
if (GetPrimaryPartitionCount(DiskEntry) > 4)
|
||||
/* Fail if there are already 4 primary partitions in the list */
|
||||
if (GetPrimaryPartitionCount(DiskEntry) >= 4)
|
||||
return ERROR_PARTITION_TABLE_FULL;
|
||||
|
||||
/* Fail if there is another extended partition in the list */
|
||||
|
|
Loading…
Reference in a new issue