System Root directory

Hi,

Does anybody know how to obtain a SystemRoot directory name
during the boot-start driver’s initialization.
As I understand, there is no SOFTWARE hive at that time yet.
Are there any other ways to do this?

Thanks in advance,
Leonid.

Hello, Leonid!

Are you really need exactly %SystemRoot% value?
May be easiest way just use internally L"\SystemRoot\file.txt" notation,
if you need access just to resources(files) placed in the SystemRoot?

Another way to find out SystemRoot value at the boot time (work well for me)
is to build it by yourself. ZwQuerySymbolicLinkObject is your friend here.

The main idea is to get each drive symbolic link target (don’t forget it
should be in the L"\??\C:" form) and compare it with SystemRoot symlink
target (cut off \Device\HarddiskN\PartitionX\ part from sysroot target and
query target for it, it’s also symlink to the volume).

Best regards,
Valery

You wrote in conference ntfsd to “File Systems Developers”
on Mon, 9 Sep 2002 15:04:32 +0400:

LZ> Hi,

LZ> Does anybody know how to obtain a SystemRoot directory name during
LZ> the boot-start driver’s initialization.
LZ> As I understand, there is no SOFTWARE hive at that time yet.
LZ> Are there any other ways to do this?

LZ> Thanks in advance,
LZ> Leonid.

LZ> —
LZ> You are currently subscribed to ntfsd as: xxxxx@novosoft.ru
LZ> To unsubscribe send a blank email to %%email.unsub%%

Thank you, Valery.

I have scanned OM Namespace before sending this question.
I haven’t find it. Probably I was blind at that moment :slight_smile:

Leonid.

“Valery A. Boronin” wrote in message
news:xxxxx@ntfsd…
>
> Hello, Leonid!
>
> Are you really need exactly %SystemRoot% value?
> May be easiest way just use internally L"\SystemRoot\file.txt" notation,
> if you need access just to resources(files) placed in the SystemRoot?
>
> Another way to find out SystemRoot value at the boot time (work well for
me)
> is to build it by yourself. ZwQuerySymbolicLinkObject is your friend here.
>
> The main idea is to get each drive symbolic link target (don’t forget it
> should be in the L"\??\C:" form) and compare it with SystemRoot symlink
> target (cut off \Device\HarddiskN\PartitionX\ part from sysroot target and
> query target for it, it’s also symlink to the volume).
>
> Best regards,
> Valery
>
> You wrote in conference ntfsd to “File Systems Developers”
> on Mon, 9 Sep 2002 15:04:32 +0400:
>
> LZ> Hi,
>
> LZ> Does anybody know how to obtain a SystemRoot directory name during
> LZ> the boot-start driver’s initialization.
> LZ> As I understand, there is no SOFTWARE hive at that time yet.
> LZ> Are there any other ways to do this?
>
> LZ> Thanks in advance,
> LZ> Leonid.
>
>
>
>
> LZ> —
> LZ> You are currently subscribed to ntfsd as: xxxxx@novosoft.ru
> LZ> To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>

> Does anybody know how to obtain a SystemRoot directory name

during the boot-start driver’s initialization.

For what? No volumes are mounted at that time anyway, so, this
knowledge is useless.

In System driver DriverEntry, \SystemRoot is already accessible, by
very this name, the drive letter knowledge is not necessary.

Max