From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::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 AD6418237B for ; Thu, 22 Dec 2016 02:07:25 -0800 (PST) Received: by mail-lf0-x233.google.com with SMTP id t196so115704198lff.3 for ; Thu, 22 Dec 2016 02:07:25 -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=aIWjw16P8xXUIYyhZ2GljnxG0xIY5x7Fk/5/L16tEGc=; b=fe+/nPpYLNAVAiRQVkLGt8eSUgBPvxoBxUvlS+g7Kif2doy3DsQHadl00dzyw/uA3C 2tI+PTdZxHnf5YDpBwx16uHKmpKPZd+YsoOR8JEt5gLkQGZMfcRGkuVKlRR627Uq6NjH 8WhLMS0HkyyiuEsXz2J3afGHs3b3dSh96Vd+6T5KdW+zfalYIbt05SdALsAHYB+F1OUG KYRmJRxXUY6rqkzzzpCjZPZfLPyGmiJBJvbNKiK2GfjlrYM8GGgtdBaiCIFljWdfEi3S Hpkb6gmmABgYKpWQ7K3bEbFw2f/YGlmQLcpMIppfDELXkpWz7J3P+khdUSvsfqUlVL/B ktdg== 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=aIWjw16P8xXUIYyhZ2GljnxG0xIY5x7Fk/5/L16tEGc=; b=Pt960XeVDhvL56oIR4aaBC5CCfErimvFDnasE8w1xqGWf90Ow/dc9aavUwQ9l4+qCW Q9oixHGcHKnApU6cJDDTI66zPi8cWzNwXLRZ7k2gNe95I88hhY5J6jk5SlCRCDnuS7aY 7dnbrr1y6LpLyrrUCnRNfVoo8vbbfZ/jT+oTKZdSb6DpO6oRZEB0CoZQwMD5/zo9IFbp vQ7toUCTqr0dEITXhWLqRT0E1AJrThHE8l+tDD4SgZ9THN49sqKVAS59oKluLTEH0n2Q l4ZeKK/jPq4rxbzMRlJbdKT+PZ0WBa7DRS1p9sSCmv3c6VNFMKrMAb/GCwSuoJ8Fqka7 DhPA== X-Gm-Message-State: AIkVDXJyR7uS34XSQd9ibgXX0EHJpwO1Tjvfkm/5KurdzC9vCpbWcE1bsZJ+Axjoj4eYjBLzxrd5ky4q8hBDOw== X-Received: by 10.25.211.134 with SMTP id k128mr3562693lfg.118.1482401243899; Thu, 22 Dec 2016 02:07:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: GN Keshava Date: Thu, 22 Dec 2016 10:07:12 +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: Thu, 22 Dec 2016 10:07:26 -0000 Content-Type: text/plain; charset=UTF-8 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=0* and *Buffer=NULL* 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 = gBS->LocateProtocol( > &gEfiShellProtocolGuid, > NULL, > (VOID **)&gEfiShellProtocol > ); > if (EFI_ERROR(Status)) { > gEfiShellProtocol = 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 = gBS->LocateHandle(ByProtocol, &gEfiShellProtocolGuid, NULL, > > &BufferSize, Buffer); // Get BufferSize > > if (EFI_ERROR(Status)) > > Print(L"LocateHandle Status 0x%x\n",Status); > > > > Status = gBS->AllocatePool(EfiBootServicesData, BufferSize, > > (void**)&Buffer); > > if (EFI_ERROR(Status)) > > Print(L"AllocatePool Status 0x%x\n",Status); > > > > Status = 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 > >