Hi Andrew, Thanks for the reply.
Can you tell more about (or some links) about the Shell APIs that you have mentioned? Is it possible to access these from my C code? (not script, its C code for my .efi app). Also, can you give more idea about how I can map my volume name to device path in my C file? Thanks. With regards, Keshava On Tue, 27 Sep 2016 at 14:37 Andrew Fish <[email protected]> wrote: > On Sep 27, 2016, at 2:03 AM, GN Keshava <[email protected]> wrote: > > Hi all, > > > I'm trying to open a file from my UEFI application. The path of file is > > fs1:/myfolder/myfile.txt > > > Keshava, > > The volume names are EFI Shell concepts, not UEFI Firmware concepts. > Basically the Shell uses "fs1:" to match one of the Simple File System > Handles. There is also an EFI Device Path on the handle with the Simple > File System Handle and that is what maps to "fs1". > > So if you want to use these shell volume names you need to use Shell APIs. > > Thanks, > > Andrew Fish > > > The code : > > efiStatus = bs->LocateHandleBuffer(ByProtocol, > &sfspGuid, > NULL, > &handleCount, > &handles); > > for (index = 0; index < (int)handleCount; ++ index) > { > EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL; > > efiStatus = bs->HandleProtocol( > handles[index], > &sfspGuid, > (void**)&fs); > > EFI_FILE_PROTOCOL* root = NULL; > ... > efiStatus = fs->OpenVolume(fs, &root); > > EFI_FILE_PROTOCOL* token = NULL; > > efiStatus = root->Open( > root, > &token, > L"myfolder\\myfile.txt", > EFI_FILE_MODE_READ, > EFI_FILE_READ_ONLY | EFI_FILE_HIDDEN | EFI_FILE_SYSTEM); > } > > But using this method, I can only go through all the file system handles > and open each volume and try opening my file. > > But I want to give full path to my file and open it in it's volume. > > How can I acheive this? > Thanks. > With regards, > Keshava GN > > _______________________________________________ > edk2-devel mailing list > [email protected] > https://lists.01.org/mailman/listinfo/edk2-devel > > > _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

