diff options
author | Roderick W. Smith <rodsmith@rodsbooks.com> | 2013-08-31 17:40:15 -0400 |
---|---|---|
committer | Roderick W. Smith <rodsmith@rodsbooks.com> | 2013-08-31 17:40:15 -0400 |
commit | 042f38a2f716fd4a3b9b03c35951e69f1d1bc942 (patch) | |
tree | 2628e199bacf8e8a52bac80c7df075c837d05cf8 /basicmbr.cc | |
parent | af39cb48d06f5776855b213b1ef292ddff42821b (diff) | |
download | sgdisk-042f38a2f716fd4a3b9b03c35951e69f1d1bc942.tar.gz |
Check for boot/active flag on 0xEE protective partition in verify
function.
Diffstat (limited to 'basicmbr.cc')
-rw-r--r-- | basicmbr.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/basicmbr.cc b/basicmbr.cc index 7483734..080de76 100644 --- a/basicmbr.cc +++ b/basicmbr.cc @@ -921,6 +921,18 @@ int BasicMBRData::IsLegal(void) { return allOK; } // BasicMBRData::IsLegal() +// Returns 1 if the 0xEE partition in the protective/hybrid MBR is marked as +// active/bootable. +int BasicMBRData::IsEEActive(void) { + int i, IsActive = FALSE; + + for (i = 0; i < MAX_MBR_PARTS; i++) { + if (partitions[i].GetStatus() & 0x80) + IsActive = TRUE; + } + return IsActive; +} // BasicMBRData::IsEEActive() + // Finds the next in-use partition, starting with start (will return start // if it's in use). Returns -1 if no subsequent partition is in use. int BasicMBRData::FindNextInUse(int start) { |