feat: add --permissive-medium-type option

This option can be useful to try to work with normally unsupported media types.
Namely the Windows 10 default iso mounter (and virtual drive) is tagged DVD-DROM,
even if it mounts bare iso images. Useful for debugging (requires --debug).
This commit is contained in:
Stéphane Lesimple
2020-09-04 23:37:59 +02:00
parent be2f7b67b9
commit 1a9416f7b2
3 changed files with 14 additions and 2 deletions

View File

@@ -92,6 +92,7 @@ typedef enum
MODIFIER_NO_BDR_DEFECT_MANAGEMENT,
MODIFIER_NO_PROGRESS,
MODIFIER_OLD_DS_MARKER,
MODIFIER_PERMISSIVE_MEDIUM_TYPE,
MODIFIER_PREFETCH_SECTORS,
MODIFIER_RANDOM_SEED,
MODIFIER_RAW_MODE,
@@ -249,6 +250,7 @@ int main(int argc, char *argv[])
{"no-bdr-defect-management", 0, 0, MODIFIER_NO_BDR_DEFECT_MANAGEMENT },
{"no-progress", 0, 0, MODIFIER_NO_PROGRESS },
{"old-ds-marker", 0, 0, MODIFIER_OLD_DS_MARKER },
{"permissive-medium-type", 0, 0, MODIFIER_PERMISSIVE_MEDIUM_TYPE },
{"prefetch-sectors", 1, 0, MODIFIER_PREFETCH_SECTORS },
{"prefix", 1, 0, 'p'},
{"random-errors", 1, 0, MODE_RANDOM_ERR },
@@ -524,6 +526,10 @@ int main(int argc, char *argv[])
case MODIFIER_OLD_DS_MARKER:
Closure->dsmVersion = 0;
break;
case MODIFIER_PERMISSIVE_MEDIUM_TYPE:
Closure->permissiveMediumType = TRUE;
debug_mode_required = TRUE;
break;
case MODIFIER_PREFETCH_SECTORS:
Closure->prefetchSectors = atoi(optarg);
if( Closure->prefetchSectors < 32
@@ -982,6 +988,7 @@ int main(int argc, char *argv[])
{ PrintCLI("\n");
PrintCLI(_("Debugging options (purposefully undocumented and possibly harmful)\n"));
PrintCLI(_(" --debug - enables the following options\n"));
PrintCLI(_(" --permissive-medium-type - allow more media types, even theoretically unsupported ones\n"));
PrintCLI(_(" --byteset s,i,b - set byte i in sector s to b\n"));
PrintCLI(_(" --cdump - creates C #include file dumps instead of hexdumps\n"));
PrintCLI(_(" --compare-images a,b - compare sectors in images a and b\n"));

View File

@@ -265,6 +265,7 @@ typedef struct _GlobalClosure
int fixedSpeedValues;/* output fixed speed reading to make comparing debugging output easier */
int noBdrDefectManagement;/* if true, enable use of the BD*_NODM sizes, default: false */
int ignoreRS03header; /* if true, ignore the RS03 header when repairing, forcing a full search (debug only) */
int permissiveMediumType; /* if true, don't bail out on some UNSUPPORTED medium types (debug only) */
char *homeDir; /* path to users home dir */
char *dotFile; /* path to .dvdisaster file */
char *logFile; /* path to logfile */

View File

@@ -922,13 +922,17 @@ static int query_dvd(DeviceHandle *dh, int probe_only)
}
dh->typeDescr = g_strdup("DVD-ROM");
dh->subType = UNSUPPORTED;
/* this also happens to be the detected medium type for the Windows 10 iso mounter,
if you want to use it to test dvdisaster, use --permissive-medium-type */
if (!Closure->permissiveMediumType)
dh->subType = UNSUPPORTED;
break;
}
default:
dh->typeDescr = g_strdup_printf("DVD book type 0x%02x",(phy_info4>>4) & 0x0f);
dh->subType = UNSUPPORTED;
if (!Closure->permissiveMediumType)
dh->subType = UNSUPPORTED;
break;
}