mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:45:44 +00:00
[MOUNTMGR] Fix three more bugs in MountMgrQueryDosVolumePath() (#6990)
- When trying to find a device, don't fail with STATUS_NOT_FOUND if no
associated symbolic links are present. Instead, that test was wrong,
and should go out of the search loop to do the drive-letter processing.
Addendum to commit f9f5a78715
.
- In addition, when using the associated-device method, fix the list
used to retrieve the corresponding device.
- In the TryWithVolumeName: block, reset DeviceString to NULL after
freeing, so that we can correctly fail with STATUS_NOT_FOUND if no
suitable device was found, before initializing the output data.
This commit is contained in:
parent
28c3533d11
commit
8bb7cd286b
1 changed files with 6 additions and 9 deletions
|
@ -887,20 +887,16 @@ MountMgrQueryDosVolumePath(IN PDEVICE_EXTENSION DeviceExtension,
|
|||
}
|
||||
}
|
||||
|
||||
/* We didn't find, break */
|
||||
if (SymlinksEntry == &(DeviceInformation->SymbolicLinksListHead))
|
||||
{
|
||||
return STATUS_NOT_FOUND;
|
||||
}
|
||||
/* If we've found a device via drive letter, do default processing */
|
||||
if (SymlinksEntry != &(DeviceInformation->SymbolicLinksListHead))
|
||||
break;
|
||||
|
||||
/* It doesn't have associated device, go to fallback method */
|
||||
/* If it doesn't have an associated device, go to fallback method */
|
||||
if (IsListEmpty(&DeviceInformation->AssociatedDevicesHead))
|
||||
{
|
||||
goto TryWithVolumeName;
|
||||
}
|
||||
|
||||
/* Create a string with the information about the device */
|
||||
AssociatedDevice = CONTAINING_RECORD(&(DeviceInformation->SymbolicLinksListHead), ASSOCIATED_DEVICE_ENTRY, AssociatedDevicesEntry);
|
||||
AssociatedDevice = CONTAINING_RECORD(&(DeviceInformation->AssociatedDevicesHead), ASSOCIATED_DEVICE_ENTRY, AssociatedDevicesEntry);
|
||||
OldLength = DeviceLength;
|
||||
OldBuffer = DeviceString;
|
||||
DeviceLength += AssociatedDevice->String.Length;
|
||||
|
@ -967,6 +963,7 @@ TryWithVolumeName:
|
|||
if (DeviceString)
|
||||
{
|
||||
FreePool(DeviceString);
|
||||
DeviceString = NULL;
|
||||
DeviceLength = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue