+ // USB flash drives appear as hard disks with certain media flags set.
+ // Look for this, and if present, pass it on with the (technically
+ // incorrect, but internally useful) BBS_TYPE_USB flag set.
+ if (DiskType == BBS_HARDDISK) {
+ if (SearchingForUsb && (BbsDevicePath->StatusFlag & (BBS_MEDIA_PRESENT | BBS_MEDIA_MAYBE_PRESENT))) {
+ AddLegacyEntryUEFI(BdsOption, BBS_USB);
+ } else if (!SearchingForUsb && !(BbsDevicePath->StatusFlag & (BBS_MEDIA_PRESENT | BBS_MEDIA_MAYBE_PRESENT))) {
+ AddLegacyEntryUEFI(BdsOption, DiskType);
+ }
+ } else {
+ AddLegacyEntryUEFI(BdsOption, DiskType);
+ } // if/else
+ } // if
+ } // if (BdsOption != NULL)