How to assign a drive letter to "\device\harddisk1\partition1"?

Hello
I am doing the disk partitioning on win2K. I have the device name
\device\harddisk1\partition1. All the Win2k APIs need the drive letters as
the parameter(like filecopy). I need to assign the drive letter after
creating the partition. Can somebody help in figuring this out?

Thanks in advance.
Varsha

The simplest way is to crate a symbolic link in the \DosDevices
part of the object directory to your device. In Win32 you would
use DefineDosDevice() and create a link from, e.g. “E:” to
\Device\HardDisk1\Partition1. You can do this in kernel mode using the
IoCreateSymbolicLink() function specifying \DosDevices\E: as the link
name (note on XP you need to specify \Global??\E: instead of
DosDevices). You can use the OBJDIR.EXE program in the DDK to have a
look around the object directory to see how things work.

The, probably more correct, way is to use the mount manager to create
a mount point for the drive letter. Have a look in the MSDN for a
description of the mount manager functions.

Shaun

Tuesday, April 29, 2003, 11:03:18 AM, you wrote:

VK> Hello
VK> I am doing the disk partitioning on win2K. I have the device name
VK> \device\harddisk1\partition1. All the Win2k APIs need the drive letters as
VK> the parameter(like filecopy). I need to assign the drive letter after
VK> creating the partition. Can somebody help in figuring this out?

VK> Thanks in advance.
VK> Varsha

VK> —
VK> You are currently subscribed to ntdev as: xxxxx@sdlabs.net
VK> To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi Varsh,

       I need to know here which tool u r using whether VC++ or some thing else?

good luck



From: “Varsha Kadam”

>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] How to assign a drive letter to “\device\harddisk1\partition1”?
>Date: Tue, 29 Apr 2003 06:03:18 -0400
>
>Hello
>I am doing the disk partitioning on win2K. I have the device name
>\device\harddisk1\partition1. All the Win2k APIs need the drive letters as
>the parameter(like filecopy). I need to assign the drive letter after
>creating the partition. Can somebody help in figuring this out?
>
>Thanks in advance.
>Varsha
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


See the stars. Upclose! Bollywood photogallery.

DefineDosDevice()

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Varsha Kadam
Sent: Tuesday, April 29, 2003 3:03 AM
To: NT Developers Interest List
Subject: [ntdev] How to assign a drive letter to
“\device\harddisk1\partition1”?

Hello
I am doing the disk partitioning on win2K. I have the device name
\device\harddisk1\partition1. All the Win2k APIs need the drive letters
as
the parameter(like filecopy). I need to assign the drive letter after
creating the partition. Can somebody help in figuring this out?

Thanks in advance.
Varsha


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

Hi Yogi,
Hello I am using VC++ for development

Varsha
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of yatindra vaishnav
Sent: Tuesday, April 29, 2003 8:18 PM
To: NT Developers Interest List
Subject: [ntdev] Re: How to assign a drive letter to
“\device\harddisk1\partition1”?

Hi Varsh,

I need to know here which tool u r using whether VC++ or some thing
else?

good luck



>From: “Varsha Kadam”
>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] How to assign a drive letter to
“\device\harddisk1\partition1”?
>Date: Tue, 29 Apr 2003 06:03:18 -0400
>
>Hello
>I am doing the disk partitioning on win2K. I have the device name
>\device\harddisk1\partition1. All the Win2k APIs need the drive letters
as
>the parameter(like filecopy). I need to assign the drive letter after
>creating the partition. Can somebody help in figuring this out?
>
>Thanks in advance.
>Varsha
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

----------------------------------------------------------------------------

See the stars. Upclose! Bollywood photogallery. —
You are currently subscribed to ntdev as: xxxxx@oas.co.in
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hello Shaun,
DefineDosDevice() is creating the symbolic link. but when I call
GetLogicalDriveStrings() function it does not return the the newly created
drive letter in the list. What could be the problem?

The SetVolumeMountPoint function need the GUID. If the logical
volume(partition) is created through my application. I do not get the
\?\Volume{GUID}. Is there any way by which I can create it and use it in a
function?

Is there any sample code that explains Mount Manger functionality usage?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Shaun
Sent: Tuesday, April 29, 2003 6:29 PM
To: NT Developers Interest List
Subject: [ntdev] Re: How to assign a drive letter to
“\device\harddisk1\partition1”?

The simplest way is to crate a symbolic link in the \DosDevices
part of the object directory to your device. In Win32 you would
use DefineDosDevice() and create a link from, e.g. “E:” to
\Device\HardDisk1\Partition1. You can do this in kernel mode using the
IoCreateSymbolicLink() function specifying \DosDevices\E: as the link
name (note on XP you need to specify \Global??\E: instead of
DosDevices). You can use the OBJDIR.EXE program in the DDK to have a
look around the object directory to see how things work.

The, probably more correct, way is to use the mount manager to create
a mount point for the drive letter. Have a look in the MSDN for a
description of the mount manager functions.

Shaun

Tuesday, April 29, 2003, 11:03:18 AM, you wrote:

VK> Hello
VK> I am doing the disk partitioning on win2K. I have the device name
VK> \device\harddisk1\partition1. All the Win2k APIs need the drive letters
as
VK> the parameter(like filecopy). I need to assign the drive letter after
VK> creating the partition. Can somebody help in figuring this out?

VK> Thanks in advance.
VK> Varsha

VK> —
VK> You are currently subscribed to ntdev as: xxxxx@sdlabs.net
VK> To unsubscribe send a blank email to xxxxx@lists.osr.com


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