From 80917907170f47399948cf633eb928dcac97bae9 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Wed, 4 May 2005 09:47:56 +0000 Subject: [PATCH] Remove the corresponding registry entry when deleting a drive. --- programs/winecfg/drive.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/programs/winecfg/drive.c b/programs/winecfg/drive.c index d81b8d2e3c6..85c31971cdd 100644 --- a/programs/winecfg/drive.c +++ b/programs/winecfg/drive.c @@ -357,6 +357,9 @@ void apply_drive_changes() } else if(foundDrive && !drives[i].in_use) { + HKEY hKey; + char driveValue[256]; + /* remove this drive */ if(!DefineDosDevice(DDD_REMOVE_DEFINITION, devicename, drives[i].unixpath)) { @@ -369,6 +372,18 @@ void apply_drive_changes() WINE_TRACE("removed devicename of '%s', targetpath of '%s'\n", devicename, drives[i].unixpath); } + + retval = RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Wine\\Drives", &hKey); + if (retval != ERROR_SUCCESS) + { + WINE_TRACE("Unable to open '%s'\n", "Software\\Wine\\Drives"); + } + else + { + snprintf(driveValue, sizeof(driveValue), "%c:", toupper(drives[i].letter)); + + retval = RegDeleteValue(hKey, driveValue); + } } else if(drives[i].in_use) /* foundDrive must be false from the above check */ {