MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / FileDevicePathToStr

Function FileDevicePathToStr

Library/GenericBdsLib/DevicePath.c:39–65  ·  view source on GitHub ↗

Aptio UEFI returns File DevPath as 2 nodes (dir, file) and DevicePathToStr connects them with /, but we need '\\'

Source from the content-addressed store, hash-verified

37// Aptio UEFI returns File DevPath as 2 nodes (dir, file)
38// and DevicePathToStr connects them with /, but we need '\\'
39CHAR16 *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/**

Callers 15

LocateSerialIoFunction · 0.85
GetConsoleMenuFunction · 0.85
BOpt_FindFileSystemFunction · 0.85
BOpt_GetBootOptionsFunction · 0.85
BOpt_FindDriversFunction · 0.85
BOpt_GetDriverOptionsFunction · 0.85
Var_UpdateDriverOptionFunction · 0.85
Var_UpdateBootOptionFunction · 0.85
CallDriverHealthFunction · 0.85
CallBootManagerFunction · 0.85
EnableSecureBootFunction · 0.85

Calls 2

DevicePathToStrFunction · 0.85
StrStrFunction · 0.85

Tested by

no test coverage detected