Boot device/partitions name from User mode.

Hi ,

I need to get the boot partition name from the user mode. Is there any
API/Register Key to get the boot partition name.

Thanks.

getenv(“SystemRoot”)

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Vinay Rao G”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, February 02, 2005 8:56 AM
Subject: [ntdev] Boot device/partitions name from User mode.

> Hi ,
>
> I need to get the boot partition name from the user mode. Is there any
> API/Register Key to get the boot partition name.
>
> Thanks.
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Maxim S. Shatskih wrote:

getenv(“SystemRoot”)

That gets the operating system directory, but the operating system is
not necessarily on the boot partition.

This is just a guess, but I suspect you can get the boot device from the
Win32_OperatingSystem WMI class property “BootDevice”. If this is
correct, and you then need to find the partition on that disk, you could
probably enumerate the partitions and check the Win32_DiskPartition WMI
class for the “Bootable” property (there can be only 1).

Vinay Rao G wrote:

Hi ,

I need to get the boot partition name from the user mode. Is there any
API/Register Key to get the boot partition name.

Thanks.


…/ray..

Please remove “.spamblock” from my email address if you need to contact
me outside the newsgroup.

Tim,

you wrote on Wednesday, February 2, 2005, 17:57:12:

> getenv(“SystemRoot”)

TR> That gets the operating system directory, but the operating system is
TR> not necessarily on the boot partition.

Right. One could get the boot ARC path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SystemBootDevice and
try to translate this to a Win32 partition name.


Ralf.