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

Function AddToolEntry

rEFIt_UEFI/entry_scan/tool.cpp:76–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74#endif
75
76STATIC BOOLEAN AddToolEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle,
77 IN REFIT_VOLUME *Volume, const XIcon& Image,
78 IN CHAR16 ShortcutLetter, IN CONST XString8Array& Options)
79{
80 REFIT_MENU_ENTRY_LOADER_TOOL *Entry;
81 // Check the loader exists
82 if ((LoaderPath.isEmpty()) || (Volume == NULL) || (Volume->RootDir == NULL) ||
83 !FileExists(Volume->RootDir, LoaderPath)) {
84 return FALSE;
85 }
86 // Allocate the entry
87 Entry = new REFIT_MENU_ENTRY_LOADER_TOOL();
88 if (Entry == NULL) {
89 return FALSE;
90 }
91
92 if (FullTitle) {
93 Entry->Title.takeValueFrom(FullTitle);
94 } else {
95 Entry->Title.SWPrintf("Start %ls", LoaderTitle);
96 }
97// Entry->Tag = TAG_TOOL;
98 Entry->Row = 1;
99 Entry->ShortcutLetter = ShortcutLetter;
100 Entry->Image = Image;
101// Entry->ImageHover = ImageHover;
102 Entry->LoaderPath = LoaderPath;
103 Entry->DevicePath = FileDevicePath(Volume->DeviceHandle, Entry->LoaderPath);
104 Entry->DevicePathString = FileDevicePathToXStringW(Entry->DevicePath);
105 Entry->LoadOptions = Options;
106 //actions
107 Entry->AtClick = ActionSelect;
108 Entry->AtDoubleClick = ActionEnter;
109 Entry->AtRightClick = ActionHelp;
110
111 DBG("found tool %ls\n", LoaderPath.s());
112 MainMenu.AddMenuEntry(Entry, true);
113 return TRUE;
114}
115
116STATIC VOID AddCloverEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume)
117{

Callers 2

ScanToolFunction · 0.85
AddCustomToolFunction · 0.85

Calls 7

FileExistsFunction · 0.85
FileDevicePathToXStringWFunction · 0.85
SWPrintfMethod · 0.80
sMethod · 0.80
AddMenuEntryMethod · 0.80
FileDevicePathFunction · 0.50
isEmptyMethod · 0.45

Tested by

no test coverage detected