ShellPkg/Shell: Preserve multi-instance device paths

EfiShellGetMapFromDevicePath() stops at any end-type node and
converts an end-instance node into an end-entire node. This truncates a
multi-instance device path and modifies the protocol data in place.

Walk until the end-entire node instead. This leaves intermediate
instances and the original device path unchanged.

Signed-off-by: JinKang <2371488344@qq.com>
This commit is contained in:
JinKang 2026-08-10 07:44:01 -04:00 committed by pierregondois
parent 2c2f74a581
commit cc9a0425a2

View file

@ -290,17 +290,9 @@ EfiShellGetMapFromDevicePath (
}
if (PathForReturn != NULL) {
while (!IsDevicePathEndType (*DevicePath)) {
while (!IsDevicePathEnd (*DevicePath)) {
*DevicePath = NextDevicePathNode (*DevicePath);
}
//
// Do not call SetDevicePathEndNode() if the device path node is already the
// end of an entire device path.
//
if (!IsDevicePathEnd (*DevicePath)) {
SetDevicePathEndNode (*DevicePath);
}
}
/*