From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) (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 938F48240A for ; Thu, 22 Dec 2016 20:07:01 -0800 (PST) Received: by mail-lf0-x235.google.com with SMTP id b14so131015339lfg.2 for ; Thu, 22 Dec 2016 20:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=qDtr52cxVITe9T/2v/RWknQacL96BjmDCb9lx7EoN+8=; b=jzXaC/3F7ArAHFSbThVGi99Kg0ZlcCi43TlAEDyauiENv5Fkla8uWA8k9k78WtuJqP RFfBdYZThxbCtUidVH19zv6/+FU/wBva35vwCZHaAsN3A9Mn2bMMDnY8RTpF2NH1deAi y0ePUF91Hi+3IfdRD0T7hzeRSN1utbj3sgsv45K+JeKOycNjAqGnwV94IIVzk/6xk3d7 MakSS++0PQJLfCWPXmOhi69OmnWPLJHjfwzUXdCErBRoNZWVLuZtE6v/sQs7vAYhYHTA ivoCYNmZATsC8MdfarJtuekXEIjKryBJ0ZrM2l95QzJcoJAHYR4y+4CmcV9TAiOrv0Dq mraA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=qDtr52cxVITe9T/2v/RWknQacL96BjmDCb9lx7EoN+8=; b=F3ey49AXMz/kN9IY6FJusdVQroCS4EEADbaUd89RZMkQ/F3h2mP61/GZDoM4EghfT2 ELjUcF64uluV6pyjlUr1GmTTQKacT4ZT2OvRONYp04uIJ3HnEdLm10akxyX2D4vnnsDK MCUpnZioNXv6Hp0PESaShZM/vmJ8RQwftiQrpQUFjr38tvf/O5fX8rl1TtSUHVzjoPGF L6uyEwQyEojUK1cuZHNYsyHHT/EMUByn1faHjSfmJsfKuX7+KUyW4xWE6N/DjfZZJXHo hRCe+ufV92PhIxEX9qMNJj0m7gwptcVj+NZtvz1IwQABclb8hm1V3+AGNDnkS2cHXx8Q Lyzw== X-Gm-Message-State: AIkVDXIZeUqrWtIlkXIuzy3/6KZVHRETfIy0nre2DojFAmHP0aaSnekB87c1hn/VKsv6ZPyVi+Rs0twDGHpYyA== X-Received: by 10.25.87.149 with SMTP id l143mr5059379lfb.61.1482466019753; Thu, 22 Dec 2016 20:06:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: GN Keshava Date: Fri, 23 Dec 2016 04:06:48 +0000 Message-ID: To: "Carsey, Jaben" , "edk2-devel@lists.01.org" X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: LocateHandle for gEfiShellProtocolGuid is failing in my application 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: Fri, 23 Dec 2016 04:07:02 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Jaben, Version is 2.31... Revision is 4.653 Thanks. Regards, Keshava On Thu, 22 Dec 2016 at 22:26 Carsey, Jaben wrote: > That function is not in the shell library. > > > > LocateHandle would be useful is you wanted to find the image handle for > the shell binary whereas LocaetProtocol would be just getting a pointer t= o > the protocol. > > > > Which version of the UEFI Shell are you using? (what does =E2=80=9Cver= =E2=80=9D command > say) > > > > -Jaben > > > > *From:* GN Keshava [mailto:keshava.gn@gmail.com] > *Sent:* Thursday, December 22, 2016 2:07 AM > *To:* Carsey, Jaben ; edk2-devel@lists.01.org > *Subject:* Re: [edk2] LocateHandle for gEfiShellProtocolGuid is failing > in my application > *Importance:* High > > > > Hi Jaben and Andrew, Thanks for the replies. Here's a small update. > > > > I tried using *LocateProtocol*, and I get "*Status Not Found*" (%r would > print "Status Not Found"). > > I'm getting the same error status for *LocateHandle *too. I'm using > *BufferSize=3D0* and *Buffer=3DNULL* for getting the BufferSize. > > What this would mean? Is there any specific requirement my application > should meet, to use ShellProtocol? Or, as I mentioned in previous mail, I > want to use GetMapFromDevicePath function. Is there any alternate way to = do > it? > > > > Thanks for your help. > > Regards, > > Keshava > > > > On Thu, 22 Dec 2016 at 15:01 GN Keshava wrote: > > Hi Jaben, > > > > *>> Is there a reason that you are not using ShellLib to facilitate your > app functionality? That library makes lots of things a lot easier.* > > > > I want to use EFI_SHELL_PROTOCOL->*GetMapFromDevicePath* in my app. Is > there any way to use it using ShellLib ? > > > > *>> Why do you use LocateHandle and not LocateProtocol?* > > > > Got LocateHandle in my reference. I would like to know more about > difference and usage of these in different scenario. > > > > *>> Are you running the UEFI Shell and then your application?* > > > > Yes. I'm running my application from UEFI shell as : > > > > *fs1:\> MyApp.exe Arg1 Arg2* > > > > Thanks for the help.. > > > > Regards, > > Keshava > > > > On Thu, 22 Dec 2016 at 00:06 Carsey, Jaben wrote= : > > Hi Keshava, > > few questions: > Is there a reason that you are not using ShellLib to facilitate your app > functionality? That library makes lots of things a lot easier. > Why do you use LocateHandle and not LocateProtocol? > Are you sure about that return code? Usually most-sig-bit is set for > error returns. > > Does the following snippet of code find a valid instance? > > Status =3D gBS->LocateProtocol( > &gEfiShellProtocolGuid, > NULL, > (VOID **)&gEfiShellProtocol > ); > if (EFI_ERROR(Status)) { > gEfiShellProtocol =3D NULL; > } > > Are you running the UEFI Shell and then your application? > > > -Jaben > > > > > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > GN Keshava > > Sent: Tuesday, December 20, 2016 11:32 PM > > To: edk2-devel@lists.01.org > > Subject: [edk2] LocateHandle for gEfiShellProtocolGuid is failing in my > > application > > Importance: High > > > > Hi, > > > > I'm developing a shell application. A call to LocateHandle for > > gEfiShellProtocolGuid is failing with Status 0x0E. > > > > Below is my code. Please let me know what I'm doing wrong. > > > > Status =3D gBS->LocateHandle(ByProtocol, &gEfiShellProtocolGuid, NULL, > > &BufferSize, Buffer); // Get BufferSize > > if (EFI_ERROR(Status)) > > Print(L"LocateHandle Status 0x%x\n",Status); > > > > Status =3D gBS->AllocatePool(EfiBootServicesData, BufferSize, > > (void**)&Buffer); > > if (EFI_ERROR(Status)) > > Print(L"AllocatePool Status 0x%x\n",Status); > > > > Status =3D gBS->LocateHandle(ByProtocol, &gEfiShellProtocolGuid, NULL, > > &BufferSize, Buffer); > > if (EFI_ERROR(Status)) > > Print(L"LocateHandle Status 0x%x\n",Status); > > > > All calls failing with Status being 0x0E. Please help me to solve this. > Is > > there any special requirement for using this protocol? > > > > Thanks. > > Regards, > > Keshava > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > >