Re[2]: How to assign a drive letter

Hello Ladislav,

Thanks for the help, however I couldn’t find the description of this
function in my XP DDK, can I use IoCreateSymbolicLink instead?

If arguments for the functions are similar then I have another
question:
How can I tie the device name in format of \Device\HarddiskVolume1
with a particular volume? Is my assumption that a volume number increases
in the order of partition appearence on a hard drive correct?
So the first partition is \Device\HarddiskVolume1, the second partition is
\Device\HarddiskVolume2 and so on?
I have such situation on my harddrives and just want to be sure that
this is always true.


Roman Kudinov

mailto:xxxxx@rbcmail.ru

> Thanks for the help, however I couldn’t find the description of this

function in my XP DDK, can I use IoCreateSymbolicLink instead?

Yes.

NTSTATUS
ZwCreateSymbolicLinkObject
OUT PHANDLE SymbolicLinkHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjAttr,
IN PUNICODE_STRING TargetObjectName);

NTSTATUS
IoCreateSymbolicLink(
IN PUNICODE_STRING LinkName,
IN PUNICODE_STRING DeviceName);

How can I tie the device name in format of \Device\HarddiskVolume1
with a particular volume?

I don’t know what are you want to achieve,
I thought that you know the device name
and want to set a link to it.

Is my assumption that a volume number increases

Yes, but e.g. USB devices have quire another device names.

L.

Unfortunately I don’t know the device name because it’s my application
creates a harddrive partition and volume is not mounted yet, that is a
device object for the volume doesn’t exist. As I understand to mount a
volume it’s necessary to require a file on it, i.e. I need a volume letter
assigned to the volume first.

I need this only for harddrives, so thanks for the help

“Ladislav Zezula” wrote in message news:xxxxx@ntfsd…
> > Thanks for the help, however I couldn’t find the description of this
> > function in my XP DDK, can I use IoCreateSymbolicLink instead?
>
> Yes.
>
> NTSTATUS
> ZwCreateSymbolicLinkObject
> OUT PHANDLE SymbolicLinkHandle,
> IN ACCESS_MASK DesiredAccess,
> IN POBJECT_ATTRIBUTES ObjAttr,
> IN PUNICODE_STRING TargetObjectName);
>
> NTSTATUS
> IoCreateSymbolicLink(
> IN PUNICODE_STRING LinkName,
> IN PUNICODE_STRING DeviceName);
>
> > How can I tie the device name in format of \Device\HarddiskVolume1
> > with a particular volume?
>
> I don’t know what are you want to achieve,
> I thought that you know the device name
> and want to set a link to it.
>
> > Is my assumption that a volume number increases
>
> Yes, but e.g. USB devices have quire another device names.
>
> L.
>
>
>

Look around FindFirstVolume.

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

----- Original Message -----
From: “Roman Kudinov”
To: “Windows File Systems Devs Interest List”
Sent: Friday, October 15, 2004 4:38 PM
Subject: [ntfsd] How to assign a drive letter

> Hi all,
>
> Are there any API to assign a drive letter to a partition (it may be
> not formated)?
>
> –
> Roman Kudinov
>
>
> mailto:xxxxx@rbcmail.ru
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com