Re: [edk2] Using StdLib in UEFI_DRIVER Type

Subject: Re: [edk2] Using StdLib in UEFI_DRIVER Type

From: Jeffrey Chou <>

To: edk2-devel <>

Date: 2013-05-14 01:02:16

Hi Daryl,
Thanks for your advice. Currently I just have the workaroundthat myUEFI driver invoking a application by LoadImage or ShellExecute,of causethe application should be built with StdLib.
But I encountered some problems when using LoadImage and ShellExecute:
Case 1:
For ShellExecute, I have an absolute filepath of application for parameter in ShellExecute. I always get EFI_SUCCESS from Status, but it seems that the StdLibApp.efi is never executed.
My UEFI Driver--ShellExecute-->StdLibApp
ShellExecute (ImageHandle, L"folder1\folder2\StdLibApp.efi", FALSE, NULL, &Status);
Case 2:
For LoadImage, also have the absolute file path for LoadImage function.
My UEFI Driver--LoadImage/StartImage-->StdLibApp
gBS->LoadImage(FALSE, ImageHandle, FilePath, NULL, 0, &Handle);
gBS->StartImage(Handle, NULL, NULL );
But I got an error EFI_STATUS from StartImage.
I tried to change the StdLibApp to a PURE EFI Application, it works.
Case 3:
Base on the result from case 2, an idea as below.
My UEFI Driver--LoadImage/StartImage-->PureEFIApp--ShellExecute-->StdLibApp
Unfortunately, also failed in case 3. I got the situation when calling ShellExeute which is same as case 1.
Maybemy method and ideaare a bit tortuous, butabove are solutionsI can think of so far.
Now I am back to case 2 and studying any solution can load a StdLibApp in an UEFI Driver.
2013/5/11 Mcdaniel, Daryl <>


The current version of StdLib is designed to only work as a Shell Application. Many of the services that StdLib relies upon are not available until the BDS phase, or later. As such, it is strongly recommended that StdLib not be used in drivers. It is my desire to provide a standalone version of StdLib in the future, but it is not currently scheduled.

Daryl McDaniel

In the pun, two strings of thought are tangled into one acoustic knot.
-- Arthur Koestler

From: Jeffrey Chou []
Sent: Tuesday, May 07, 2013 3:20 AM
To: edk2-devel
Subject: [edk2] Using StdLib in UEFI_DRIVER Type

Hi all,

I am trying to use StbLib in an uefi driver module,and it seems the StbLib is only supported on UEFI_APPLICATION. So I have an idea that my uefi driverinvoking an uefi application built with StdLib thru ShellExecute or LoadImage. But I am facing a problem that I don't know how to pass auguments to the application (in loadimage)and get the return valuefrom the application. Any suggestions?



Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today!
edk2-devel mailing list