How to get SystemRoot at boottime

Hi,
I’m writing a WDM Pnp drivers for PCI cards

There are some FPGA images ( installed in system32\Drivers ) that I need
to load to initialize our HW.
On OnStartDevice, I perfrom some initialization of my PCI card and I want
to know where Windows is installed (ex: F:\WINNT )
I try to read from registry
KHEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\SystemRoot
But it looks like it is inaccessible at that time

Is there another way to get the Windows path at boottime ?

Thanks

How about having a second driver, that consists of the fpga images plus the
minimum to get it up and going, plus the code to load your board’s fgpas ?
That driver will be loaded by the system, no need to worry about reading
files, all you have to do is to have some kind of communication between the
two drivers where the main driver handshakes with the fpga loader and won’t
proceed until the fpga is loaded. After the handshake, the loader driver
unloads and the main driver continues.

Alberto.

-----Original Message-----
From: Quang Vu [mailto:xxxxx@gage-applied.com]
Sent: Thursday, March 06, 2003 10:26 AM
To: NT Developers Interest List
Subject: [ntdev] How to get SystemRoot at boottime

Hi,
I’m writing a WDM Pnp drivers for PCI cards

There are some FPGA images ( installed in system32\Drivers ) that I need
to load to initialize our HW.
On OnStartDevice, I perfrom some initialization of my PCI card and I want
to know where Windows is installed (ex: F:\WINNT )
I try to read from registry
KHEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\SystemRoot
But it looks like it is inaccessible at that time

Is there another way to get the Windows path at boottime ?

Thanks


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

“Quang Vu” wrote in message news:xxxxx@ntdev…
>
> Hi,
> I’m writing a WDM Pnp drivers for PCI cards
>
> There are some FPGA images ( installed in system32\Drivers ) that I need
> to load to initialize our HW.
> On OnStartDevice, I perfrom some initialization of my PCI card and I want
> to know where Windows is installed (ex: F:\WINNT )
> I try to read from registry
> KHEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\SystemRoot
> But it looks like it is inaccessible at that time
>
> Is there another way to get the Windows path at boottime ?

I don’t think you can do file IO in Boot start drivers, though I’m not 100%
sure if I remember that right. You definitely can’t if you are the boot
disk HBA driver. If you could, you could use %SystemRoot%\System32\Drivers
as your path, as that is what the OS uses.

If your firmware isn’t too big, you can read it out of the registry. You
can also include it in your driver as a resource or one (or several)
initialized globals in your init section. Alberto’s suggestion to use two
separate drivers might simplify things if the firmware changes the PCI ID
fields

Search the archive for this list, this has been discussed several times.

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.

create a thread and poll (not too much - lol) until it succeeds.

shame you cant start the driver later.

Rob Linegar
Software Engineer
Data Encryption Systems Limited

-----Original Message-----
From: Quang Vu [mailto:xxxxx@gage-applied.com]
Sent: 06 March 2003 15:26
To: NT Developers Interest List
Subject: [ntdev] How to get SystemRoot at boottime

Hi,
I’m writing a WDM Pnp drivers for PCI cards

There are some FPGA images ( installed in system32\Drivers ) that I need
to load to initialize our HW.
On OnStartDevice, I perfrom some initialization of my PCI card and I want
to know where Windows is installed (ex: F:\WINNT )
I try to read from registry
KHEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\SystemRoot
But it looks like it is inaccessible at that time

Is there another way to get the Windows path at boottime ?

Thanks


You are currently subscribed to ntdev as: xxxxx@des.co.uk
To unsubscribe send a blank email to xxxxx@lists.osr.com

You may place the directory
you want at installation time
as a parameter at …\Services\YourService\Pararmeters
which is accesible at boot time.

-----Original Message-----
From: Quang Vu [mailto:xxxxx@gage-applied.com]
Sent: Thursday, March 06, 2003 5:26 PM
To: NT Developers Interest List
Subject: [ntdev] How to get SystemRoot at boottime

Hi,
I’m writing a WDM Pnp drivers for PCI cards

There are some FPGA images ( installed in system32\Drivers )
that I need
to load to initialize our HW.
On OnStartDevice, I perfrom some initialization of my PCI
card and I want
to know where Windows is installed (ex: F:\WINNT )
I try to read from registry
KHEY_LOCAL_MACHINE\Software\Microsoft\Windows
NT\CurrentVersion\SystemRoot
But it looks like it is inaccessible at that time

Is there another way to get the Windows path at boottime ?

Thanks


You are currently subscribed to ntdev as: xxxxx@royatech.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Just open the file as \SystemRoot\System32.…

Max

----- Original Message -----
From: “Quang Vu”
To: “NT Developers Interest List”
Sent: Thursday, March 06, 2003 6:25 PM
Subject: [ntdev] How to get SystemRoot at boottime

> Hi,
> I’m writing a WDM Pnp drivers for PCI cards
>
> There are some FPGA images ( installed in system32\Drivers ) that I
need
> to load to initialize our HW.
> On OnStartDevice, I perfrom some initialization of my PCI card and I
want
> to know where Windows is installed (ex: F:\WINNT )
> I try to read from registry
> KHEY_LOCAL_MACHINE\Software\Microsoft\Windows
NT\CurrentVersion\SystemRoot
> But it looks like it is inaccessible at that time
>
> Is there another way to get the Windows path at boottime ?
>
> Thanks
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>

> I don’t think you can do file IO in Boot start drivers, though I’m
not 100%

sure if I remember that right.

You cannot. SystemRoot is not yet mounted during Boot drivers start.

Max

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
>
> > I don’t think you can do file IO in Boot start drivers, though I’m
> not 100%
> > sure if I remember that right.
>
> You cannot. SystemRoot is not yet mounted during Boot drivers start.
>

I knew I couldn’t as the boot disk HBA driver, I just couldn’t remember if
that limitation extended to all boot start drivers, regardless of type. :slight_smile:

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.