| 1561 | } |
| 1562 | |
| 1563 | STATIC VOID AddCustomEntry(IN UINTN CustomIndex, |
| 1564 | IN XStringW CustomPath, |
| 1565 | IN CUSTOM_LOADER_ENTRY *Custom, |
| 1566 | IN REFIT_MENU_SCREEN *SubMenu) |
| 1567 | { |
| 1568 | UINTN VolumeIndex; |
| 1569 | REFIT_VOLUME *Volume; |
| 1570 | REFIT_DIR_ITER SIter; |
| 1571 | REFIT_DIR_ITER *Iter = &SIter; |
| 1572 | CHAR16 PartUUID[40]; |
| 1573 | BOOLEAN IsSubEntry = (SubMenu != NULL); |
| 1574 | BOOLEAN FindCustomPath = (CustomPath.isEmpty()); |
| 1575 | |
| 1576 | if (Custom == NULL) { |
| 1577 | return; |
| 1578 | } |
| 1579 | |
| 1580 | if (FindCustomPath && (Custom->Type != OSTYPE_LINEFI) && (Custom->Type != OSTYPE_LIN)) { |
| 1581 | // DBG("Custom %lsentry %llu skipped because it didn't have a ", IsSubEntry ? L"sub " : L"", CustomIndex); |
| 1582 | // if (Custom->Type == 0) { |
| 1583 | // DBG("Type.\n"); |
| 1584 | // } else { |
| 1585 | // DBG("Path.\n"); |
| 1586 | // } |
| 1587 | return; |
| 1588 | } |
| 1589 | |
| 1590 | if (OSFLAG_ISSET(Custom->Flags, OSFLAG_DISABLED)) { |
| 1591 | // DBG("Custom %lsentry %llu skipped because it is disabled.\n", IsSubEntry ? L"sub " : L"", CustomIndex); |
| 1592 | return; |
| 1593 | } |
| 1594 | |
| 1595 | // if (!gSettings.ShowHiddenEntries && OSFLAG_ISSET(Custom->Flags, OSFLAG_HIDDEN)) { |
| 1596 | // DBG("Custom %lsentry %llu skipped because it is hidden.\n", IsSubEntry ? L"sub " : L"", CustomIndex); |
| 1597 | // return; |
| 1598 | // } |
| 1599 | |
| 1600 | #if 0 //if someone want to debug this |
| 1601 | DBG("Custom %lsentry %llu ", IsSubEntry ? L"sub " : L"", CustomIndex); |
| 1602 | // if (Custom->Title) { |
| 1603 | DBG("Title:\"%ls\" ", Custom->Title.wc_str()); |
| 1604 | // } |
| 1605 | // if (Custom->FullTitle) { |
| 1606 | DBG("FullTitle:\"%ls\" ", Custom->FullTitle.wc_str()); |
| 1607 | // } |
| 1608 | if (CustomPath) { |
| 1609 | DBG("Path:\"%ls\" ", CustomPath); |
| 1610 | } |
| 1611 | if (Custom->Options != NULL) { |
| 1612 | DBG("Options:\"%ls\" ", Custom->Options); |
| 1613 | } |
| 1614 | DBG("Type:%d Flags:0x%hhX matching ", Custom->Type, Custom->Flags); |
| 1615 | if (Custom->Volume) { |
| 1616 | DBG("Volume:\"%ls\"\n", Custom->Volume); |
| 1617 | } else { |
| 1618 | DBG("all volumes\n"); |
| 1619 | } |
| 1620 | #endif |
no test coverage detected