Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

use of GetFirmwareEnvironmentVariable func to retrieve boot info

1,066 views
Skip to first unread message

Flynn@discussions.microsoft.com Jim Flynn

unread,
Jun 21, 2005, 5:49:06 AM6/21/05
to
I am a software developer in HP working on a product which analyses system
configurations. One section of the analysis used the boot.ini file to provide
information to the rules which examine the boot configuration. Under 64 bit
windows the boot.ini is now history and boot info is stored in NVRAM in
accordance with Intel's Extended Firware Interface (EFI) Specification. I am
trying to figure out how to access this info from a 64 bit windows exe. The
SDK documentation has a function GetFirmwareEnvironmentVariable
DWORD GetFirmwareEnvironmentVariable(
LPCTSTR lpName,
LPCTSTR lpGuid,
PVOID pBuffer,
DWORD nSize
);
which would seem to be what I need (esp. as there is a comment in the doc.
'you can use this func tion to save all the boot settings for the
system...'). But there is no code example of it's use, so I have no idea what
the correct settings for lpName and lpGuid should be for retrieving this info
and what the structure returned in pBuffer will be or what it's size will be.
The EFI spec. seems to suggest that a variable called 'BootOrder' i.e.
lpName will give access to a list of Boot#### (where #### is a numeric order
number e.g. 0001) variable names which can then be queried in turn to return
the actual boot info, but I can't glean anything further re: correct use of
the function despite much trawling on the web. Can anyone point me in the
right direction? What would be really useful is some code examples for
retrieving the boot info that I could start playing with on our development
system.
Thanks!

Eugene Gershnik

unread,
Jun 21, 2005, 6:57:21 AM6/21/05
to
Jim Flynn wrote:
> I am a software developer in HP working on a product which analyses
> system configurations. One section of the analysis used the boot.ini
> file to provide information to the rules which examine the boot
> configuration. Under 64 bit windows the boot.ini is now history and
> boot info is stored in NVRAM in accordance with Intel's Extended
> Firware Interface (EFI) Specification. I am trying to figure out how
> to access this info from a 64 bit windows exe.

Not sure whether this would help but search
http://www.sysinternals.com/Information/NativeApi.html
for "boot.ini".


--
Eugene
http://www.gershnik.com

Jim Flynn

unread,
Jun 21, 2005, 8:58:03 AM6/21/05
to
Thanks for the pointer Eugene. Interesting site... I had a dig around but
unfortunately couldn't turn up anything specific to my problem, so the hunt
continues ;-)

All the best
Jim Flynn

Eugene Gershnik

unread,
Jun 21, 2005, 1:33:28 PM6/21/05
to
Jim Flynn wrote:
> Thanks for the pointer Eugene. Interesting site... I had a dig around
> but unfortunately couldn't turn up anything specific to my problem,
> so the hunt continues ;-)

Doesn't NtEnumerateBootEntries/NtQueryBootEntryOrder/NtQueryBootOptions
sound like what you need?


--
Eugene
http://www.gershnik.com


David Craig

unread,
Jun 21, 2005, 2:27:58 PM6/21/05
to
I don't think that is true. Only for ia64, better known as the overpriced
Itanium. I think the AMD 64 and EM64T compatible versions of Windows still
use the boot.ini - at least they do on my machines. I have discovered that
the boot.ini seems to be limited to 10 entries. You can put more, but you
can't select them as they are off screen.

"Jim Flynn" <Jim Fl...@discussions.microsoft.com> wrote in message
news:0301525D-F9EE-4C11...@microsoft.com...

Jim Flynn

unread,
Jun 22, 2005, 4:51:02 AM6/22/05
to
I was blind but now I can see :-)... I obviously didn't dig deep enough (i.e.
scroll down the screen far enough to encounter the Boot_IA64 section, and
either the search terms I entered or the search engine on the site weren't up
to scratch either )... this looks like exactly what I need to get the job
done.

Thanks for your help with this....

BTW in response to David Craig's posting it IS the IA64 version of windows I
need this for so I definitely need to dig in the NVRAM to get the boot.ini
info.

Thanks Again!

Yours Sincerely
Jim Flynn

Eugene Gershnik

unread,
Jun 22, 2005, 4:27:48 PM6/22/05
to
Jim Flynn wrote:
> I was blind but now I can see :-)... I obviously didn't dig deep
> enough (i.e. scroll down the screen far enough to encounter the
> Boot_IA64 section, and either the search terms I entered or the
> search engine on the site weren't up to scratch either )...

My fault actually. What I meant in my original post was simply to open the
page and search it using the browser's find dialog. But I didn't say it
clear enough.

--
Eugene
http://www.gershnik.com


0 new messages