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 31716820EE for ; Thu, 22 Dec 2016 01:36:01 -0800 (PST) Received: by mail-lf0-x233.google.com with SMTP id b14so114970326lfg.2 for ; Thu, 22 Dec 2016 01:36: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=A9JCuudUNuD9+Wh+BdBlcMUdRSgtP/cs62H/7ybramc=; b=pBwJAA+XKcpGCe9m4AlJWQXLfmUUsFHufE3CIdnM3Y69+fdFbIHrL/xmOUGGyRyQnI d3vcw91ZbPkHlW4vY6a7NDZnY2x8jOQPEoZycRkbL8ujtKt4lWUBjRoCo9UHg/m9k/gd xiLaB1hKhpSPaZBWwd2FD3mSnUR1mg5qzk7+F4A88orK8lJ5huZ9nqYLtpt8RbsQlpw9 bSE1cshJU4SOZb7TJ1GXTdUSyGy4gLSfys5t5bkT5QcyMo6cuwvyBHbT2cXAuKwqkurx LSTEfUNmKNtlJxxXDVqiufPhFJf9eT/AMd0U+rAuENk6FeV0mc1/TaH1k+3oVUYQNTXr a9fg== 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=A9JCuudUNuD9+Wh+BdBlcMUdRSgtP/cs62H/7ybramc=; b=cDeJfpfUkF/RxMkxvc/vbCDGomejs2T96Kd09NQBGIMfgMIkSY0NJk/4dbUlUttrM+ mRjIlmchuSzfSh8AIf0i1WU+jzaHJafxM/Jr4YqcPzSb/uP75xLDiLQWqXE1ypmUFDoo WYKcn7l5ZMAncuu2abEfqwZn2aSUQN6PzdRhTnGe+xPDR/gqRV4SyN1ysJ0Me6jaxboR N9sxekru+eDK2jXTyGkyprT6ov8f4HtVt30Z8WJQdFmx4Q9bAA+ZmRoC9laKw4ctMvmA 7eYAArHN3vBMeVwDpKp2x2ylbXeQnJUvEOgRIlk/QhVdTxOsE3uoGwmEPW8m97fJW86W LMMg== X-Gm-Message-State: AIkVDXI5eKpSIleAWk72S9zg5yquXa906Rj+imXXBXfDtO2ajcup2IJZ1e3FF7rtYtA4YeZ7jeb5Hb+hS8oBgg== X-Received: by 10.25.195.194 with SMTP id t185mr2599766lff.13.1482399359056; Thu, 22 Dec 2016 01:35:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: GN Keshava Date: Thu, 22 Dec 2016 09:35:47 +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 09:36:01 -0000 Content-Type: text/plain; charset=UTF-8 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 >