Drive letter not visible in Explorer

Hello all,

I’m trying to write a pseudo-disk driver for Windows XP and have a
problem. Say, I do:

  1. I create an unnamed device object of type FILE_DEVICE_DISK.

  2. I then notify the Mount Manager with the
    IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION IO control request.

  3. I successfully process IOCTL_MOUNTDEV_QUERY_DEVICE_NAME,
    IOCTL_MOUNTDEV_QUERY_UNIQUE_ID,
    IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME.

  4. For the latter I return “\DosDevices\H:” as a suggested link name.

After all the above the problems are:

  1. The link is created as “\DosDevices\E:” which is the next free drive
    letter I have. But I was asking for H:. No other volumes have ever
    requested H: and none are mounted at that letter. Why does Mount Manager
    keep assigning the wrong letter?

  2. The drive letter isn’t visible in the Explorer’s file tree. It is
    cleanly visible in other file managers, say, Far or Windows Commander,
    but it is missing in the Explorer. What do I do to make Explorer see my
    newly created disk drive?

I will greatly appreciate any ideas, hints or guidelines on how to
resolve the above two issue.


Andrey Subbotin

Maybe just use DefineDosDevice().

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrey Subbotin
Sent: Wednesday, September 07, 2005 1:51 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Drive letter not visible in Explorer

Hello all,

I’m trying to write a pseudo-disk driver for Windows XP and have a
problem. Say, I do:

  1. I create an unnamed device object of type FILE_DEVICE_DISK.

  2. I then notify the Mount Manager with the
    IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION IO control request.

  3. I successfully process IOCTL_MOUNTDEV_QUERY_DEVICE_NAME,
    IOCTL_MOUNTDEV_QUERY_UNIQUE_ID,
    IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME.

  4. For the latter I return “\DosDevices\H:” as a suggested link name.

After all the above the problems are:

  1. The link is created as “\DosDevices\E:” which is the next free drive
    letter I have. But I was asking for H:. No other volumes have ever
    requested H: and none are mounted at that letter. Why does Mount Manager
    keep assigning the wrong letter?

  2. The drive letter isn’t visible in the Explorer’s file tree. It is
    cleanly visible in other file managers, say, Far or Windows Commander,
    but it is missing in the Explorer. What do I do to make Explorer see my
    newly created disk drive?

I will greatly appreciate any ideas, hints or guidelines on how to
resolve the above two issue.


Andrey Subbotin


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Search archives for my messages about virtual drives and XP. Two or more years old; I’m sure I wrote about it here several times. To see drive letter in Explorer it is necessary to send an user mode broadcast, the same when drive disappears (sorry, I forgot details and I’m lazy to find and examine this code). I don’t use Mount Manager to create links as the driver had to be binary compatible from NT4 to w2k3 and standard symbolic link creation works well.

The next possibility is to use DefineDosDevice() as Jamey noted. IIRC it performs both tasks; creates symbolic link and sends the necessary broadcast.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Andrey Subbotin[SMTP:xxxxx@gmail.com]
Reply To: Windows System Software Devs Interest List
Sent: Wednesday, September 07, 2005 10:50 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Drive letter not visible in Explorer

Hello all,

I’m trying to write a pseudo-disk driver for Windows XP and have a
problem. Say, I do:

  1. I create an unnamed device object of type FILE_DEVICE_DISK.

  2. I then notify the Mount Manager with the
    IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION IO control request.

  3. I successfully process IOCTL_MOUNTDEV_QUERY_DEVICE_NAME,
    IOCTL_MOUNTDEV_QUERY_UNIQUE_ID,
    IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME.

  4. For the latter I return “\DosDevices\H:” as a suggested link name.

After all the above the problems are:

  1. The link is created as “\DosDevices\E:” which is the next free drive
    letter I have. But I was asking for H:. No other volumes have ever
    requested H: and none are mounted at that letter. Why does Mount Manager
    keep assigning the wrong letter?

  2. The drive letter isn’t visible in the Explorer’s file tree. It is
    cleanly visible in other file managers, say, Far or Windows Commander,
    but it is missing in the Explorer. What do I do to make Explorer see my
    newly created disk drive?

I will greatly appreciate any ideas, hints or guidelines on how to
resolve the above two issue.


Andrey Subbotin


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

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

Hello Michal,

The fact I need to notify Explorer so it sees a new drive letter is
exactly what I have been missing. Now there’s another question –
probably another dummy one: how do I send this notification from the
kernel-space? As far as I get it, DefineDosDevice() is for the
user-space and I need to do this from the kernel-space… The driver I
write isn’t running on the behalf of some user-space client that could
call the function somehow, so I need to do the same notification thing
from the kernel-space. And yet I’m unable to find a way to do it. ;( Any
ideas would be highly appreciated.

On Wed, 7 Sep 2005 23:10:51 +0200 Michal Vodicka wrote:

Search archives for my messages about virtual drives and XP. Two or more
years old; I’m sure I wrote about it here several times. To see drive
letter in Explorer it is necessary to send an user mode broadcast, the
same when drive disappears (sorry, I forgot details and I’m lazy to find
and examine this code). I don’t use Mount Manager to create links as the
driver had to be binary compatible from NT4 to w2k3 and standard
symbolic link creation works well.

The next possibility is to use DefineDosDevice() as Jamey noted. IIRC it
performs both tasks; creates symbolic link and sends the necessary
broadcast.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

> ----------
> From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Andrey Subbotin[SMTP:xxxxx@gmail.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Wednesday, September 07, 2005 10:50 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Drive letter not visible in Explorer
>
> Hello all,
>
> I’m trying to write a pseudo-disk driver for Windows XP and have a
> problem. Say, I do:
>
> 1. I create an unnamed device object of type FILE DEVICE DISK.
>
> 2. I then notify the Mount Manager with the
> IOCTL MOUNTMGR VOLUME ARRIVAL NOTIFICATION IO control request.
>
> 3. I successfully process IOCTL MOUNTDEV QUERY DEVICE NAME,
> IOCTL MOUNTDEV QUERY UNIQUE ID,
> IOCTL MOUNTDEV QUERY SUGGESTED LINK NAME.
>
> 4. For the latter I return “\DosDevices\H:” as a suggested link name.
>
> After all the above the problems are:
>
> 1. The link is created as “\DosDevices\E:” which is the next free drive
> letter I have. But I was asking for H:. No other volumes have ever
> requested H: and none are mounted at that letter. Why does Mount Manager
> keep assigning the wrong letter?
>
> 2. The drive letter isn’t visible in the Explorer’s file tree. It is
> cleanly visible in other file managers, say, Far or Windows Commander,
> but it is missing in the Explorer. What do I do to make Explorer see my
> newly created disk drive?
>
> I will greatly appreciate any ideas, hints or guidelines on how to
> resolve the above two issue.
>
> –
> Andrey Subbotin
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@upek.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Hi Andrey,

I think all you need to do is to create the symbolic link from your
driver using IoCreateSymbolicLink().

//
// Create the virtual drive (symlink) to map our
// device object into the file system name space.
// We’re hardcoding F: here for the time being.
//
RtlInitUnicodeString(
&unicode_string,
L"\DosDevices\Global\F:");

status = IoCreateSymbolicLink(
&unicode_string,
&device_name); // this is the UNICODE string
containing your device name.

-bob

Andrey Subbotin wrote:

Hello Michal,

The fact I need to notify Explorer so it sees a new drive letter is
exactly what I have been missing. Now there’s another question –
probably another dummy one: how do I send this notification from the
kernel-space? As far as I get it, DefineDosDevice() is for the
user-space and I need to do this from the kernel-space… The driver I
write isn’t running on the behalf of some user-space client that could
call the function somehow, so I need to do the same notification thing
from the kernel-space. And yet I’m unable to find a way to do it. ;( Any
ideas would be highly appreciated.

On Wed, 7 Sep 2005 23:10:51 +0200 Michal Vodicka wrote:

>Search archives for my messages about virtual drives and XP. Two or more
>years old; I’m sure I wrote about it here several times. To see drive
>letter in Explorer it is necessary to send an user mode broadcast, the
>same when drive disappears (sorry, I forgot details and I’m lazy to find
>and examine this code). I don’t use Mount Manager to create links as the
>driver had to be binary compatible from NT4 to w2k3 and standard
>symbolic link creation works well.
>
>The next possibility is to use DefineDosDevice() as Jamey noted. IIRC it
>performs both tasks; creates symbolic link and sends the necessary
>broadcast.
>
>Best regards,
>
>Michal Vodicka
>UPEK, Inc.
>[xxxxx@upek.com, http://www.upek.com]
>
>
>
>
>>----------
>>From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Andrey Subbotin[SMTP:xxxxx@gmail.com]
>>Reply To: Windows System Software Devs Interest List
>>Sent: Wednesday, September 07, 2005 10:50 PM
>>To: Windows System Software Devs Interest List
>>Subject: [ntdev] Drive letter not visible in Explorer
>>
>>Hello all,
>>
>>I’m trying to write a pseudo-disk driver for Windows XP and have a
>>problem. Say, I do:
>>
>>1. I create an unnamed device object of type FILE DEVICE DISK.
>>
>>2. I then notify the Mount Manager with the
>>IOCTL MOUNTMGR VOLUME ARRIVAL NOTIFICATION IO control request.
>>
>>3. I successfully process IOCTL MOUNTDEV QUERY DEVICE NAME,
>>IOCTL MOUNTDEV QUERY UNIQUE ID,
>>IOCTL MOUNTDEV QUERY SUGGESTED LINK NAME.
>>
>>4. For the latter I return “\DosDevices\H:” as a suggested link name.
>>
>>After all the above the problems are:
>>
>>1. The link is created as “\DosDevices\E:” which is the next free drive
>>letter I have. But I was asking for H:. No other volumes have ever
>>requested H: and none are mounted at that letter. Why does Mount Manager
>>keep assigning the wrong letter?
>>
>>2. The drive letter isn’t visible in the Explorer’s file tree. It is
>>cleanly visible in other file managers, say, Far or Windows Commander,
>>but it is missing in the Explorer. What do I do to make Explorer see my
>>newly created disk drive?
>>
>>I will greatly appreciate any ideas, hints or guidelines on how to
>>resolve the above two issue.
>>
>>–
>>Andrey Subbotin
>>
>>—
>>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>>
>>You are currently subscribed to ntdev as: xxxxx@upek.com
>>To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>>
>>


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

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

The problem with this method is that it does not broadcast device arrival
messages and such to the system (WM_DEVICECHANGE, etc…); I guess you could
have the user to sit there and press the F5 key in explorer a few dozen
times and the drive letter MAY appear.

I recommend using DefineDosDevice(). DefineDosDevice() broadcasts all of the
proper system messages for arrival and removal.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bob Nelson
Sent: Friday, September 09, 2005 7:20 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] RE: Drive letter not visible in Explorer

Hi Andrey,

I think all you need to do is to create the symbolic link from your
driver using IoCreateSymbolicLink().

//
// Create the virtual drive (symlink) to map our
// device object into the file system name space.
// We’re hardcoding F: here for the time being.
//
RtlInitUnicodeString(
&unicode_string,
L"\DosDevices\Global\F:");

status = IoCreateSymbolicLink(
&unicode_string,
&device_name); // this is the UNICODE string
containing your device name.

-bob

Andrey Subbotin wrote:

Hello Michal,

The fact I need to notify Explorer so it sees a new drive letter is
exactly what I have been missing. Now there’s another question –
probably another dummy one: how do I send this notification from the
kernel-space? As far as I get it, DefineDosDevice() is for the
user-space and I need to do this from the kernel-space… The driver I
write isn’t running on the behalf of some user-space client that could
call the function somehow, so I need to do the same notification thing
from the kernel-space. And yet I’m unable to find a way to do it. ;( Any
ideas would be highly appreciated.

On Wed, 7 Sep 2005 23:10:51 +0200 Michal Vodicka wrote:

>Search archives for my messages about virtual drives and XP. Two or more
>years old; I’m sure I wrote about it here several times. To see drive
>letter in Explorer it is necessary to send an user mode broadcast, the
>same when drive disappears (sorry, I forgot details and I’m lazy to find
>and examine this code). I don’t use Mount Manager to create links as the
>driver had to be binary compatible from NT4 to w2k3 and standard
>symbolic link creation works well.
>
>The next possibility is to use DefineDosDevice() as Jamey noted. IIRC it
>performs both tasks; creates symbolic link and sends the necessary
>broadcast.
>
>Best regards,
>
>Michal Vodicka
>UPEK, Inc.
>[xxxxx@upek.com, http://www.upek.com]
>
>
>
>
>>----------
>>From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on
behalf of Andrey Subbotin[SMTP:xxxxx@gmail.com]
>>Reply To: Windows System Software Devs Interest List
>>Sent: Wednesday, September 07, 2005 10:50 PM
>>To: Windows System Software Devs Interest List
>>Subject: [ntdev] Drive letter not visible in Explorer
>>
>>Hello all,
>>
>>I’m trying to write a pseudo-disk driver for Windows XP and have a
>>problem. Say, I do:
>>
>>1. I create an unnamed device object of type FILE DEVICE DISK.
>>
>>2. I then notify the Mount Manager with the
>>IOCTL MOUNTMGR VOLUME ARRIVAL NOTIFICATION IO control request.
>>
>>3. I successfully process IOCTL MOUNTDEV QUERY DEVICE NAME,
>>IOCTL MOUNTDEV QUERY UNIQUE ID,
>>IOCTL MOUNTDEV QUERY SUGGESTED LINK NAME.
>>
>>4. For the latter I return “\DosDevices\H:” as a suggested link name.
>>
>>After all the above the problems are:
>>
>>1. The link is created as “\DosDevices\E:” which is the next free drive
>>letter I have. But I was asking for H:. No other volumes have ever
>>requested H: and none are mounted at that letter. Why does Mount Manager
>>keep assigning the wrong letter?
>>
>>2. The drive letter isn’t visible in the Explorer’s file tree. It is
>>cleanly visible in other file managers, say, Far or Windows Commander,
>>but it is missing in the Explorer. What do I do to make Explorer see my
>>newly created disk drive?
>>
>>I will greatly appreciate any ideas, hints or guidelines on how to
>>resolve the above two issue.
>>
>>–
>>Andrey Subbotin
>>
>>—
>>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>>
>>You are currently subscribed to ntdev as: xxxxx@upek.com
>>To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>>
>>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Thanks Jamey! That’s why I like this list… I learn something new
everyday :slight_smile:

Jamey Kirby wrote:

The problem with this method is that it does not broadcast device arrival
messages and such to the system (WM_DEVICECHANGE, etc…); I guess you could
have the user to sit there and press the F5 key in explorer a few dozen
times and the drive letter MAY appear.

I recommend using DefineDosDevice(). DefineDosDevice() broadcasts all of the
proper system messages for arrival and removal.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bob Nelson
Sent: Friday, September 09, 2005 7:20 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] RE: Drive letter not visible in Explorer

Hi Andrey,

I think all you need to do is to create the symbolic link from your
driver using IoCreateSymbolicLink().

//
// Create the virtual drive (symlink) to map our
// device object into the file system name space.
// We’re hardcoding F: here for the time being.
//
RtlInitUnicodeString(
&unicode_string,
L"\DosDevices\Global\F:");

status = IoCreateSymbolicLink(
&unicode_string,
&device_name); // this is the UNICODE string
containing your device name.

-bob

Andrey Subbotin wrote:

>Hello Michal,
>
>The fact I need to notify Explorer so it sees a new drive letter is
>exactly what I have been missing. Now there’s another question –
>probably another dummy one: how do I send this notification from the
>kernel-space? As far as I get it, DefineDosDevice() is for the
>user-space and I need to do this from the kernel-space… The driver I
>write isn’t running on the behalf of some user-space client that could
>call the function somehow, so I need to do the same notification thing
>
>
>from the kernel-space. And yet I’m unable to find a way to do it. ;( Any

>ideas would be highly appreciated.
>
>On Wed, 7 Sep 2005 23:10:51 +0200 Michal Vodicka wrote:
>
>
>
>
>
>>Search archives for my messages about virtual drives and XP. Two or more
>>years old; I’m sure I wrote about it here several times. To see drive
>>letter in Explorer it is necessary to send an user mode broadcast, the
>>same when drive disappears (sorry, I forgot details and I’m lazy to find
>>and examine this code). I don’t use Mount Manager to create links as the
>>driver had to be binary compatible from NT4 to w2k3 and standard
>>symbolic link creation works well.
>>
>>The next possibility is to use DefineDosDevice() as Jamey noted. IIRC it
>>performs both tasks; creates symbolic link and sends the necessary
>>broadcast.
>>
>>Best regards,
>>
>>Michal Vodicka
>>UPEK, Inc.
>>[xxxxx@upek.com, http://www.upek.com]
>>
>>
>>
>>
>>
>>
>>>----------
>>>From:
>>>
>>>
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on
behalf of Andrey Subbotin[SMTP:xxxxx@gmail.com]

>>>Reply To: Windows System Software Devs Interest List
>>>Sent: Wednesday, September 07, 2005 10:50 PM
>>>To: Windows System Software Devs Interest List
>>>Subject: [ntdev] Drive letter not visible in Explorer
>>>
>>>Hello all,
>>>
>>>I’m trying to write a pseudo-disk driver for Windows XP and have a
>>>problem. Say, I do:
>>>
>>>1. I create an unnamed device object of type FILE DEVICE DISK.
>>>
>>>2. I then notify the Mount Manager with the
>>>IOCTL MOUNTMGR VOLUME ARRIVAL NOTIFICATION IO control request.
>>>
>>>3. I successfully process IOCTL MOUNTDEV QUERY DEVICE NAME,
>>>IOCTL MOUNTDEV QUERY UNIQUE ID,
>>>IOCTL MOUNTDEV QUERY SUGGESTED LINK NAME.
>>>
>>>4. For the latter I return “\DosDevices\H:” as a suggested link name.
>>>
>>>After all the above the problems are:
>>>
>>>1. The link is created as “\DosDevices\E:” which is the next free drive
>>>letter I have. But I was asking for H:. No other volumes have ever
>>>requested H: and none are mounted at that letter. Why does Mount Manager
>>>keep assigning the wrong letter?
>>>
>>>2. The drive letter isn’t visible in the Explorer’s file tree. It is
>>>cleanly visible in other file managers, say, Far or Windows Commander,
>>>but it is missing in the Explorer. What do I do to make Explorer see my
>>>newly created disk drive?
>>>
>>>I will greatly appreciate any ideas, hints or guidelines on how to
>>>resolve the above two issue.
>>>
>>>–
>>>Andrey Subbotin
>>>
>>>—
>>>Questions? First check the Kernel Driver FAQ at
>>>
>>>
http://www.osronline.com/article.cfm?id=256

>>>You are currently subscribed to ntdev as: xxxxx@upek.com
>>>To unsubscribe send a blank email to xxxxx@lists.osr.com
>>>
>>>
>>>
>>>
>>>
>—
>Questions? First check the Kernel Driver FAQ at
>
>
http://www.osronline.com/article.cfm?id=256

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


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

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

Andrey,

I’m not aware about any method which’d work without user mode code. I played with Mount Manager when we noticed this problem in some XP beta and finally gave up and used user mode code. Not a problem in our case because virtual drives are mounted when an user mode app requests it so we just added the code which sends necessary broadcast.

Maybe you should describe your design and requirements better. What kind of virtual driver do you have and when drives are mounted? I mean who tells the driver virtual drive should be mounted? If they’re mounted during boot, there would be no problem with Explorer. Also, since XP, drive letters can be system or logon session wide. Mount Manager creates system wide drives and DefineDosDevice() session wide.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Andrey Subbotin[SMTP:xxxxx@gmail.com]
Reply To: Windows System Software Devs Interest List
Sent: Friday, September 09, 2005 12:21 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] RE: Drive letter not visible in Explorer

Hello Michal,

The fact I need to notify Explorer so it sees a new drive letter is
exactly what I have been missing. Now there’s another question –
probably another dummy one: how do I send this notification from the
kernel-space? As far as I get it, DefineDosDevice() is for the
user-space and I need to do this from the kernel-space… The driver I
write isn’t running on the behalf of some user-space client that could
call the function somehow, so I need to do the same notification thing
from the kernel-space. And yet I’m unable to find a way to do it. ;( Any
ideas would be highly appreciated.

On Wed, 7 Sep 2005 23:10:51 +0200 Michal Vodicka wrote:

> Search archives for my messages about virtual drives and XP. Two or more
> years old; I’m sure I wrote about it here several times. To see drive
> letter in Explorer it is necessary to send an user mode broadcast, the
> same when drive disappears (sorry, I forgot details and I’m lazy to find
> and examine this code). I don’t use Mount Manager to create links as the
> driver had to be binary compatible from NT4 to w2k3 and standard
> symbolic link creation works well.
>
> The next possibility is to use DefineDosDevice() as Jamey noted. IIRC it
> performs both tasks; creates symbolic link and sends the necessary
> broadcast.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
> > ----------
> > From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Andrey Subbotin[SMTP:xxxxx@gmail.com]
> > Reply To: Windows System Software Devs Interest List
> > Sent: Wednesday, September 07, 2005 10:50 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Drive letter not visible in Explorer
> >
> > Hello all,
> >
> > I’m trying to write a pseudo-disk driver for Windows XP and have a
> > problem. Say, I do:
> >
> > 1. I create an unnamed device object of type FILE DEVICE DISK.
> >
> > 2. I then notify the Mount Manager with the
> > IOCTL MOUNTMGR VOLUME ARRIVAL NOTIFICATION IO control request.
> >
> > 3. I successfully process IOCTL MOUNTDEV QUERY DEVICE NAME,
> > IOCTL MOUNTDEV QUERY UNIQUE ID,
> > IOCTL MOUNTDEV QUERY SUGGESTED LINK NAME.
> >
> > 4. For the latter I return “\DosDevices\H:” as a suggested link name.
> >
> > After all the above the problems are:
> >
> > 1. The link is created as “\DosDevices\E:” which is the next free drive
> > letter I have. But I was asking for H:. No other volumes have ever
> > requested H: and none are mounted at that letter. Why does Mount Manager>
> > keep assigning the wrong letter?
> >
> > 2. The drive letter isn’t visible in the Explorer’s file tree. It is
> > cleanly visible in other file managers, say, Far or Windows Commander,
> > but it is missing in the Explorer. What do I do to make Explorer see my
> > newly created disk drive?
> >
> > I will greatly appreciate any ideas, hints or guidelines on how to
> > resolve the above two issue.
> >
> > –
> > Andrey Subbotin
> >
> > —
> > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@upek.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

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

Yes, creating symbolic link was sufficient until XP release and then things changed. F5 in explorer doesn’t work, broadcast is necessary. It is funny, you can open virtual drive in explorer directly (start explorer z:) with no problem, go up to one level to My Computer and the drive still isn’t there.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Jamey Kirby[SMTP:xxxxx@rocketdivision.com]
Reply To: Windows System Software Devs Interest List
Sent: Friday, September 09, 2005 6:41 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] RE: Drive letter not visible in Explorer

The problem with this method is that it does not broadcast device arrival
messages and such to the system (WM_DEVICECHANGE, etc…); I guess you could
have the user to sit there and press the F5 key in explorer a few dozen
times and the drive letter MAY appear.

I recommend using DefineDosDevice(). DefineDosDevice() broadcasts all of the
proper system messages for arrival and removal.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bob Nelson
Sent: Friday, September 09, 2005 7:20 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] RE: Drive letter not visible in Explorer

Hi Andrey,

I think all you need to do is to create the symbolic link from your
driver using IoCreateSymbolicLink().

//
// Create the virtual drive (symlink) to map our
// device object into the file system name space.
// We’re hardcoding F: here for the time being.
//
RtlInitUnicodeString(
&unicode_string,
L"\DosDevices\Global\F:");

status = IoCreateSymbolicLink(
&unicode_string,
&device_name); // this is the UNICODE string
containing your device name.

-bob

Andrey Subbotin wrote:

>Hello Michal,
>
>The fact I need to notify Explorer so it sees a new drive letter is
>exactly what I have been missing. Now there’s another question –
>probably another dummy one: how do I send this notification from the
>kernel-space? As far as I get it, DefineDosDevice() is for the
>user-space and I need to do this from the kernel-space… The driver I
>write isn’t running on the behalf of some user-space client that could
>call the function somehow, so I need to do the same notification thing
>from the kernel-space. And yet I’m unable to find a way to do it. ;( Any
>ideas would be highly appreciated.
>
>On Wed, 7 Sep 2005 23:10:51 +0200 Michal Vodicka wrote:
>
>
>
>>Search archives for my messages about virtual drives and XP. Two or more
>>years old; I’m sure I wrote about it here several times. To see drive
>>letter in Explorer it is necessary to send an user mode broadcast, the
>>same when drive disappears (sorry, I forgot details and I’m lazy to find
>>and examine this code). I don’t use Mount Manager to create links as the
>>driver had to be binary compatible from NT4 to w2k3 and standard
>>symbolic link creation works well.
>>
>>The next possibility is to use DefineDosDevice() as Jamey noted. IIRC it
>>performs both tasks; creates symbolic link and sends the necessary
>>broadcast.
>>
>>Best regards,
>>
>>Michal Vodicka
>>UPEK, Inc.
>>[xxxxx@upek.com, http://www.upek.com]
>>
>>
>>
>>
>>>----------
>>>From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on
behalf of Andrey Subbotin[SMTP:xxxxx@gmail.com]
>>>Reply To: Windows System Software Devs Interest List
>>>Sent: Wednesday, September 07, 2005 10:50 PM
>>>To: Windows System Software Devs Interest List>
>>>Subject: [ntdev] Drive letter not visible in Explorer
>>>
>>>Hello all,
>>>
>>>I’m trying to write a pseudo-disk driver for Windows XP and have a
>>>problem. Say, I do:
>>>
>>>1. I create an unnamed device object of type FILE DEVICE DISK.
>>>
>>>2. I then notify the Mount Manager with the
>>>IOCTL MOUNTMGR VOLUME ARRIVAL NOTIFICATION IO control request.
>>>
>>>3. I successfully process IOCTL MOUNTDEV QUERY DEVICE NAME,
>>>IOCTL MOUNTDEV QUERY UNIQUE ID,
>>>IOCTL MOUNTDEV QUERY SUGGESTED LINK NAME.
>>>
>>>4. For the latter I return “\DosDevices\H:” as a suggested link name.
>>>
>>>After all the above the problems are:
>>>
>>>1. The link is created as “\DosDevices\E:” which is the next free drive
>>>letter I have. But I was asking for H:. No other volumes have ever
>>>requested H: and none are mounted at that letter. Why does Mount Manager
>>>keep assigning the wrong letter?
>>>
>>>2. The drive letter isn’t visible in the Explorer’s file tree. It is
>>>cleanly visible in other file managers, say, Far or Windows Commander,
>>>but it is missing in the Explorer. What do I do to make Explorer see my
>>>newly created disk drive?
>>>
>>>I will greatly appreciate any ideas, hints or guidelines on how to
>>>resolve the above two issue.
>>>
>>>–
>>>Andrey Subbotin
>>>
>>>—
>>>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>>>
>>>You are currently subscribed to ntdev as: xxxxx@upek.com
>>>To unsubscribe send a blank email to xxxxx@lists.osr.com
>>>
>>>
>>>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@oracle.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

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