[iso] fix file extraction for GRUB/Grub4DOS based ISOs

* We were switching the global boot type variable to something other than BT_IMAGE,
  which prevented ISO extraction whenever a GRUB secondary boot record was written.
* Closes #1145
This commit is contained in:
Pete Batard 2018-06-04 12:10:23 +01:00
parent 0b4146af56
commit b274388f95
2 changed files with 9 additions and 9 deletions

View file

@ -996,7 +996,7 @@ static BOOL WriteSBR(HANDLE hPhysicalDrive)
{
// TODO: Do we need anything special for 4K sectors?
DWORD size, max_size, mbr_size = 0x200;
int r;
int r, sub_type = bt;
unsigned char* buf = NULL;
FAKE_FD fake_fd = { 0 };
FILE* fp = (FILE*)&fake_fd;
@ -1010,12 +1010,12 @@ static BOOL WriteSBR(HANDLE hPhysicalDrive)
// Syslinux has precedence over Grub
if ((bt == BT_IMAGE) && (!HAS_SYSLINUX(img_report))) {
if (img_report.has_grub4dos)
bt = BT_GRUB4DOS;
sub_type = BT_GRUB4DOS;
if (img_report.has_grub2)
bt = BT_GRUB2;
sub_type = BT_GRUB2;
}
switch (bt) {
switch (sub_type) {
case BT_GRUB4DOS:
uprintf("Writing Grub4Dos SBR");
buf = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_GR_GRUB_GRLDR_MBR), _RT_RCDATA, "grldr.mbr", &size, FALSE);