From 850a4ff289c92aa614c5d36340c28ce063b0e418 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 7 Nov 2021 15:28:41 +0200 Subject: [PATCH] Do direct harddrive mount after hotswap due to Windows drive letter change only if Lock option is ticked or controller is not UAE. --- od-win32/hardfile_win32.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/od-win32/hardfile_win32.cpp b/od-win32/hardfile_win32.cpp index fe8ad3a0..6b5b6293 100644 --- a/od-win32/hardfile_win32.cpp +++ b/od-win32/hardfile_win32.cpp @@ -3544,10 +3544,12 @@ int win32_hardfile_media_change (const TCHAR *drvname, int inserted) int reopen = 0; if (!hfd || !(hfd->flags & HFD_FLAGS_REALDRIVE)) continue; - for (j = 0; j < currprefs.mountitems; j++) { - if (currprefs.mountconfig[j].configoffset == i) { - hmc_check (hfd, &currprefs.mountconfig[j], &rescanned, &reopen, &gotinsert, drvname, inserted); - break; + if (hfd->ci.lock || hfd->ci.controller_type != HD_CONTROLLER_TYPE_UAE) { + for (j = 0; j < currprefs.mountitems; j++) { + if (currprefs.mountconfig[j].configoffset == i) { + hmc_check(hfd, &currprefs.mountconfig[j], &rescanned, &reopen, &gotinsert, drvname, inserted); + break; + } } } } @@ -3555,9 +3557,11 @@ int win32_hardfile_media_change (const TCHAR *drvname, int inserted) extern struct hd_hardfiledata *pcmcia_disk; int reopen = 0; struct uaedev_config_data *uci = &currprefs.mountconfig[i]; - const struct expansionromtype *ert = get_unit_expansion_rom(uci->ci.controller_type); - if (ert && (ert->deviceflags & EXPANSIONTYPE_PCMCIA) && pcmcia_disk) { - hmc_check (&pcmcia_disk->hfd, uci, &rescanned, &reopen, &gotinsert, drvname, inserted); + if (uci->ci.lock || uci->ci.controller_type != HD_CONTROLLER_TYPE_UAE) { + const struct expansionromtype *ert = get_unit_expansion_rom(uci->ci.controller_type); + if (ert && (ert->deviceflags & EXPANSIONTYPE_PCMCIA) && pcmcia_disk) { + hmc_check(&pcmcia_disk->hfd, uci, &rescanned, &reopen, &gotinsert, drvname, inserted); + } } } //write_log (_T("win32_hardfile_media_change returned %d\n"), gotinsert); -- 2.47.3