Skip to content

Commit 647d351

Browse files
committed
[DISKPART] Use the MBR_MAGIC to check for a valid MBR
1 parent 8972448 commit 647d351

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

base/system/diskpart/partlist.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
#define PARTITION_TBL_SIZE 4
3939

40+
#define MBR_MAGIC 0xAA55
41+
4042
#include <pshpack1.h>
4143

4244
typedef struct _PARTITION
@@ -870,7 +872,7 @@ AddDiskToList(
870872
DiskEntry->BiosFound = FALSE;
871873

872874
/* Check if this disk has a valid MBR */
873-
if (Mbr->BootCode[0] == 0 && Mbr->BootCode[1] == 0)
875+
if (Mbr->Magic != MBR_MAGIC)
874876
DiskEntry->NoMbr = TRUE;
875877
else
876878
DiskEntry->NoMbr = FALSE;

0 commit comments

Comments
 (0)