From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B72DD1A1E15 for ; Tue, 27 Sep 2016 02:29:09 -0700 (PDT) Received: by mail-io0-x233.google.com with SMTP id m79so9912148ioo.3 for ; Tue, 27 Sep 2016 02:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1fPovMwhZ4sksa/PIm4P9QnZ7tZWWs+NGeeEQbn66ME=; b=HnKesO+vSkEhJpHYXE4pG6sef2eiGQJsc67uz4gnSN8+2HPgQc2l0uqQisdxO0aWwC Lq+xLr0SOVmYzSVeHqoyKFf2ccOZIxigBx1BV7o6xOlZ1+xAkIzjjKod3SN2iZkLP55d 2YGmdydYGSaWhN4PIvMabv6r4+XQNm0U58F7iENrYU6UQG/I/DIrDsBOAnFYD7gDQjUm 3zr2aHn4uKc0623JUb+xhCSuxTD3T7oWYPuPXSg7lMACsx2DqFEjflxYBl7+Ulla+6tU sO2+8olh/LP0NtX51h7OCNrqvgYVWAQvbKLmwKOY4TlxQAafUS7WN016uUB4yAoW1pdI X1ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1fPovMwhZ4sksa/PIm4P9QnZ7tZWWs+NGeeEQbn66ME=; b=dJJZkA5MijFwbA30AX8Z+vUE7DGbG8lh/egq6Wg+uRTiQNlJcNpwWj7VdcIRlIQMG3 7kpYSu6vvYga7AVMTqX5aDIkxA5LXsPMpTZnrpA4svafNsMO+PoVdf6OxRrjFOgVmoyM ok+3S1ab35zfNhj/EnwA4Fl3NgLJORHrItZKkpQK4FbighpOOPyi7hFHzePZcaVsifYe 2WNCBKt1wNZ2ebaH1jZGkvm6qVGm/ySk/0e7c9rTGuo/Kam5jjxoOBHvlz+4BVggOan4 5xFkap3moKvbUupRnwg32k0BbB0luZNokNdB96A8soGXyETCSSgBxVzPv/3KAZuz9m1e /ErQ== X-Gm-Message-State: AE9vXwOE2ZtjRuFc1jhO6mFHkA9IQ9R7fFxhxQl5xNv10lKSDnGouwxN4lAedCg+ZYJ/Wub0CKOrrxEKoQUzvA== X-Received: by 10.107.168.225 with SMTP id e94mr31475423ioj.111.1474968549124; Tue, 27 Sep 2016 02:29:09 -0700 (PDT) MIME-Version: 1.0 References: <0B851A39-2877-465C-AE96-13E2F47A6099@apple.com> In-Reply-To: <0B851A39-2877-465C-AE96-13E2F47A6099@apple.com> From: GN Keshava Date: Tue, 27 Sep 2016 09:28:58 +0000 Message-ID: To: Andrew Fish Cc: "edk2-devel@lists.01.org" , "edk2-devel@lists.sourceforge.net" X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: How to open a file by it's full path in UEFI X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2016 09:29:10 -0000 Content-Type: text/plain; charset=UTF-8 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 wrote: > On Sep 27, 2016, at 2:03 AM, GN Keshava 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 > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > > >