> On May 19, 2015, at 6:25 AM, KSilva <kaleb.si...@iatecam.org.br> wrote:
> 
> I am developing a UEFI application AND I need  list all the files stored in
> the USB device.
> 
> I am using the  DevicePath Protocol,  but I did not get success.
> 
> Someone can help me?
> 

Don’t search based on device path. Device paths are not designed to be an easy 
way to search, they are designed to be a way to store in NVRAM the exact path 
to the boot device. A device path is designed so that it is still valid even 
after a reconfiguration, so it does not even include things like a PCI bus (it 
could change if you plugged another PCI card in the system). 

A common mistake is trying to use device path nodes to “match”.  You can’t 
match on a node, you can only match on a device path that exists in the system. 
The nodes are about how device paths are constructed. A DXE driver will produce 
a handle with a device path (usually an ACPI node for a PCI root bridge). Then 
UEFI Driver Model drivers will create children (new handles). On the new child 
handle a device path is installed, it is a copy of the parents device path with 
new node(s) describing the child added. 

What you want to do is gBS->LocateHandleBuffer(), ByProtocol, on the 
gEfiSimpleFileSystemProtocolGuid. This will give you an array of EFI_HANDLE. 
You can gBS->HandleProtocol() to get the device path protocol on these handles 
if you want to figure out which one is on a USB Device. 

Another common thing to do is find files from the same device your application 
was loaded from. This can be done via the EFI_LOADED_IMAGE_PROTOCOL that is on 
the image handle (The one passed into the entry point of your code). 
EFI_LOADED_IMAGE_PROTOCOL.DeviceHandle represents the device your application 
was loaded from.

Thanks,

Andrew Fish

> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to