The Windows APIs are:

GetFirmwareEnvironmentVariable()
GetFirmwareEnvironmentVariableEx()
SetFirmwareEnvironmentVariable()
SetFirmwareEnvironmentVariableEx()

They work in WinPE.

Note that on a regular Windows SKU and possibly even WinPE you need to add 
“SeSystemEnvironmentPrivilege” to your process token to use these APIs.   That 
can be done with a sequence of:

OpenProcessToken()
LookupPrivilegeValue()
AdjustTokenPrivileges()

All these functions are documented on msdn.microsoft.com.

Regards,
Larry Cleeton

From: Andrew Fish [mailto:[email protected]]
Sent: Friday, January 23, 2015 11:11 AM
To: [email protected]
Subject: Re: [edk2] Information on UEFI application


On Jan 23, 2015, at 5:26 AM, Koen Mulderij 
<[email protected]<mailto:[email protected]>> wrote:

Hi group,

I’m sorry to bother you with my question, but I hope you can help me.
I want to develop an WinPE-based application to modify the bootorder of a 
UEFI-firmware computer.
Unfortunately Microsoft only seems to provide information on how to change 
their OS-bootloader.
Could you point me to information on how to access the UEFI-firmware (i.e. 
manipulate bootorder entries like NIC and disks) in languages like C#, C++ or 
Visual Basic.
If you think I shouldn’t bother this group with my question, please let me 
know; I will unsubscribe.


Chapter 3 of UEFI 2.4 defines the variables that control boot policy.

Section 7.2 defines how the variable services work, to discover, read, and 
write the variables.

How to access the variable services from WinPE I have no clue, but that seems 
like something to ask on a WinPE forum. You need access to the EFI Variable 
Runtime Services.

Thanks,

Andrew Fish


Thanks in advance,
Koen Mulderij
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet_______________________________________________
edk2-devel mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to