- MapPathCopy = NULL;\r
- DevicePathCopy = NULL;\r
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, Node->MapName, 0);\r
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L";", 0);\r
- break;\r
- }\r
- }\r
- //\r
- // now add on the non-consistent mappings\r
- //\r
- for ( Node = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)\r
- ; !IsNull(&gShellMapList.Link, &Node->Link)\r
- ; Node = (SHELL_MAP_LIST *)GetNextNode(&gShellMapList.Link, &Node->Link)\r
- ){\r
- if ((Node->Flags & SHELL_MAP_FLAGS_CONSIST) != 0) {\r
- continue;\r
+ DevicePathCopy = DuplicateDevicePath(*DevicePath);\r
+ ASSERT(DevicePathCopy != NULL);\r
+ Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &DevicePathCopy, &PathHandle);\r
+ ASSERT_EFI_ERROR(Status);\r
+ //\r
+ // check each of the device paths we have to get the root of the path for consist mappings\r
+ //\r
+ for ( Node = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)\r
+ ; !IsNull(&gShellMapList.Link, &Node->Link)\r
+ ; Node = (SHELL_MAP_LIST *)GetNextNode(&gShellMapList.Link, &Node->Link)\r
+ ){\r
+ if ((Node->Flags & SHELL_MAP_FLAGS_CONSIST) == 0) {\r
+ continue;\r
+ }\r
+ MapPathCopy = DuplicateDevicePath(Node->DevicePath);\r
+ ASSERT(MapPathCopy != NULL);\r
+ Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &MapPathCopy, &MapHandle);\r
+ if (MapHandle == PathHandle) {\r
+\r
+ *DevicePath = DevicePathCopy;\r
+\r
+ MapPathCopy = NULL;\r
+ DevicePathCopy = NULL;\r
+ PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, Node->MapName, 0);\r
+ PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L";", 0);\r
+ break;\r
+ }\r