From e359a3c8881b1ebb1a96080ba456c94d7f17f95c Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 19 Oct 2019 16:53:45 +0200 Subject: [PATCH] [MOUNTMGR] Fix interpretation of QueryDeviceInformation GptDriveLetter Being TRUE doesn't mean the device is GPT and has a drive letter. It just means that it's not a GPT device with GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER attribute. In short, if TRUE, it means that the device can receive a drive letter mount point. This fixes MountMgrNextDriveLetterWorker bailing out for any attempt to assign a drive letter to a device. --- drivers/filters/mountmgr/device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/filters/mountmgr/device.c b/drivers/filters/mountmgr/device.c index 4f3f9d2974e..ec9a04d063d 100644 --- a/drivers/filters/mountmgr/device.c +++ b/drivers/filters/mountmgr/device.c @@ -524,11 +524,12 @@ MountMgrNextDriveLetterWorker(IN PDEVICE_EXTENSION DeviceExtension, } /* If we didn't find a drive letter online - * ensure there's no GPT drive letter nor no drive entry + * ensure this is not a no drive entry + * by querying GPT attributes & database */ if (NextEntry == &(DeviceInformation->SymbolicLinksListHead)) { - if (GptDriveLetter || HasNoDriveLetterEntry(DeviceInformation->UniqueId)) + if (!GptDriveLetter || HasNoDriveLetterEntry(DeviceInformation->UniqueId)) { DriveLetterInfo->DriveLetterWasAssigned = FALSE; DriveLetterInfo->CurrentDriveLetter = 0; -- 2.17.1