forked from KolibriOS/kolibrios
Enable capacity checks for Protective MBR and GPT
git-svn-id: svn://kolibrios.org@6844 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
dbe9918dc6
commit
e828b2c8b5
@ -923,10 +923,9 @@ endl
|
|||||||
sub eax, dword[_mylba+0]
|
sub eax, dword[_mylba+0]
|
||||||
sbb edx, dword[_mylba+4]
|
sbb edx, dword[_mylba+4]
|
||||||
cmp eax, dword[ebx+GPTH.AlternateLBA+0]
|
cmp eax, dword[ebx+GPTH.AlternateLBA+0]
|
||||||
; DISK.MediaInfo.Capacity is -1 for ATA devices, disable this check for now.
|
jnz .fail_free_gpt
|
||||||
; jnz .fail_free_gpt
|
|
||||||
cmp edx, dword[ebx+GPTH.AlternateLBA+4]
|
cmp edx, dword[ebx+GPTH.AlternateLBA+4]
|
||||||
; jnz .fail_free_gpt
|
jnz .fail_free_gpt
|
||||||
|
|
||||||
; Compute GPT Partition Entry Array (GPEA) length in bytes
|
; Compute GPT Partition Entry Array (GPEA) length in bytes
|
||||||
mov eax, [ebx+GPTH.NumberOfPartitionEntries]
|
mov eax, [ebx+GPTH.NumberOfPartitionEntries]
|
||||||
@ -1022,15 +1021,14 @@ is_protective_mbr:
|
|||||||
jnz .exit
|
jnz .exit
|
||||||
cmp dword[ecx+8], 1
|
cmp dword[ecx+8], 1
|
||||||
jnz .exit
|
jnz .exit
|
||||||
; DISK.MediaInfo.Capacity is -1 for ATA devices, disable this check for now.
|
cmp dword[esi+DISK.MediaInfo.Capacity+4], eax
|
||||||
; cmp dword[esi+DISK.MediaInfo.Capacity+4], eax
|
mov edi, 0xFFFFFFFF
|
||||||
; mov edi, 0xFFFFFFFF
|
jnz @f
|
||||||
; jnz @f
|
mov edi, dword[esi+DISK.MediaInfo.Capacity+0]
|
||||||
; mov edi, dword[esi+DISK.MediaInfo.Capacity+0]
|
dec edi
|
||||||
; dec edi
|
@@:
|
||||||
;@@:
|
cmp dword[ecx+12], edi
|
||||||
; cmp dword[ecx+12], edi
|
jnz .exit
|
||||||
; jnz .exit
|
|
||||||
|
|
||||||
; Check that partition records 1-3 are filled with zero
|
; Check that partition records 1-3 are filled with zero
|
||||||
lea edi, [ecx+16]
|
lea edi, [ecx+16]
|
||||||
|
Loading…
Reference in New Issue
Block a user