Aptio UEFI returns File DevPath as 2 nodes (dir, file) and DevicePathToStr connects them with /, but we need '\\'
| 37 | // Aptio UEFI returns File DevPath as 2 nodes (dir, file) |
| 38 | // and DevicePathToStr connects them with /, but we need '\\' |
| 39 | CHAR16 *FileDevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *DevPath) |
| 40 | { |
| 41 | CHAR16 *FilePath; |
| 42 | CHAR16 *Char; |
| 43 | CHAR16 *Tail; |
| 44 | |
| 45 | FilePath = DevicePathToStr(DevPath); |
| 46 | // fix / into '\\' |
| 47 | if (FilePath != NULL) { |
| 48 | for (Char = FilePath; *Char != L'\0'; Char++) { |
| 49 | if (*Char == L'/') { |
| 50 | *Char = L'\\'; |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | // "\\\\" into '\\' |
| 55 | Char = StrStr(FilePath, L"\\\\"); |
| 56 | while (Char != NULL) { |
| 57 | Tail = Char + 1; |
| 58 | while (*Tail != 0) { |
| 59 | *(Char++) = *(Tail++); |
| 60 | } |
| 61 | // StrCpyS(Char, 4, Char + 1); //can't overlap! |
| 62 | Char = StrStr(FilePath, L"\\\\"); |
| 63 | } |
| 64 | return FilePath; |
| 65 | } |
| 66 | |
| 67 | #if 0 |
| 68 | /** |
no test coverage detected