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