Creating a disk device

In my AddDevice() routine I create a device with a type ==
FILE_DEVICE_DISK. My device does not show up anywhere in windows (aka drive
manager, etc.) and windows will not mount it automagically for me. So the
quick hack approach that I took was to manually create a symlink in the
\DosDevices directory for the drive letter. But I am not satisfied with
this method and I would like to find a better one. How do most other usb
storage devices create their device objects so that windows creates a drive
letter for them?

Brian


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Try FILE_DEVICE_MASS_STORAGE.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: xxxxx@sginet.com [mailto:xxxxx@sginet.com]
Sent: Thursday, February 22, 2001 7:33 AM
To: NT Developers Interest List
Subject: [ntdev] Creating a disk device

In my AddDevice() routine I create a device with a type ==
FILE_DEVICE_DISK. My device does not show up anywhere in windows (aka drive
manager, etc.) and windows will not mount it automagically for me. So the
quick hack approach that I took was to manually create a symlink in the
\DosDevices directory for the drive letter. But I am not satisfied with
this method and I would like to find a better one. How do most other usb
storage devices create their device objects so that windows creates a drive
letter for them?

Brian


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I tried that, it did not appear to have any effect. I have also tried
registering some device interfaces, but that didn’t seem to work either.

Brian

----- Original Message -----
From: “Mark Cariddi”
To: “NT Developers Interest List”
Sent: Thursday, February 22, 2001 10:50 AM
Subject: [ntdev] RE: Creating a disk device

> Try FILE_DEVICE_MASS_STORAGE.
>
> Mark J. Cariddi
> Consulting Associate
> Open Systems Resources, Inc.
> http://www.osr.com/
>
>
> -----Original Message-----
> From: xxxxx@sginet.com [mailto:xxxxx@sginet.com]
> Sent: Thursday, February 22, 2001 7:33 AM
> To: NT Developers Interest List
> Subject: [ntdev] Creating a disk device
>
>
> In my AddDevice() routine I create a device with a type ==
> FILE_DEVICE_DISK. My device does not show up anywhere in windows (aka
drive
> manager, etc.) and windows will not mount it automagically for me. So the
> quick hack approach that I took was to manually create a symlink in the
> \DosDevices directory for the drive letter. But I am not satisfied with
> this method and I would like to find a better one. How do most other usb
> storage devices create their device objects so that windows creates a
drive
> letter for them?
>
> Brian
>
> —
> You are currently subscribed to ntdev as: xxxxx@osr.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@sginet.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

The easiest way to have your virtual device behave exactly like a normal
storage device is to have your driver be a bus driver that implements the
normal port driver interface. This requrires implementing a few pnp
requests and faking a handfull of scsi requests. The key is in your handler
for BusQueryCompatibleIDs, return “GenDisk” and that will cause the proper
devnode to be created above you which will take care of all the majik
necessary to handle all requests for both basic and dynamic disks without
any knowledge of such things on your part.

-----Original Message-----
From: Brian Palmer [mailto:xxxxx@sginet.com]
Sent: Thursday, February 22, 2001 12:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Creating a disk device

I tried that, it did not appear to have any effect. I have also tried
registering some device interfaces, but that didn’t seem to work either.

Brian

----- Original Message -----
From: “Mark Cariddi”
To: “NT Developers Interest List”
Sent: Thursday, February 22, 2001 10:50 AM
Subject: [ntdev] RE: Creating a disk device

> Try FILE_DEVICE_MASS_STORAGE.
>
> Mark J. Cariddi
> Consulting Associate
> Open Systems Resources, Inc.
> http://www.osr.com/
>
>
> -----Original Message-----
> From: xxxxx@sginet.com [mailto:xxxxx@sginet.com]
> Sent: Thursday, February 22, 2001 7:33 AM
> To: NT Developers Interest List
> Subject: [ntdev] Creating a disk device
>
>
> In my AddDevice() routine I create a device with a type ==
> FILE_DEVICE_DISK. My device does not show up anywhere in windows (aka
drive
> manager, etc.) and windows will not mount it automagically for me. So the
> quick hack approach that I took was to manually create a symlink in the
> \DosDevices directory for the drive letter. But I am not satisfied with
> this method and I would like to find a better one. How do most other usb
> storage devices create their device objects so that windows creates a
drive
> letter for them?
>
> Brian
>
> —
> You are currently subscribed to ntdev as: xxxxx@osr.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@sginet.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@timesn.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

How are you responding the the PnP Queries? There’s more involved that
just doing FILE_DEVICE_MASS_STORAGE.

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http://www.osr.com/

-----Original Message-----
From: Brian Palmer [mailto:xxxxx@sginet.com]
Sent: Thursday, February 22, 2001 1:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Creating a disk device

I tried that, it did not appear to have any effect. I have also tried
registering some device interfaces, but that didn’t seem to work either.

Brian

----- Original Message -----
From: “Mark Cariddi”
To: “NT Developers Interest List”
Sent: Thursday, February 22, 2001 10:50 AM
Subject: [ntdev] RE: Creating a disk device

> Try FILE_DEVICE_MASS_STORAGE.
>
> Mark J. Cariddi
> Consulting Associate
> Open Systems Resources, Inc.
> http://www.osr.com/
>
>
> -----Original Message-----
> From: xxxxx@sginet.com [mailto:xxxxx@sginet.com]
> Sent: Thursday, February 22, 2001 7:33 AM
> To: NT Developers Interest List
> Subject: [ntdev] Creating a disk device
>
>
> In my AddDevice() routine I create a device with a type ==
> FILE_DEVICE_DISK. My device does not show up anywhere in windows (aka
drive
> manager, etc.) and windows will not mount it automagically for me. So the
> quick hack approach that I took was to manually create a symlink in the
> \DosDevices directory for the drive letter. But I am not satisfied with
> this method and I would like to find a better one. How do most other usb
> storage devices create their device objects so that windows creates a
drive
> letter for them?
>
> Brian
>
> —
> You are currently subscribed to ntdev as: xxxxx@osr.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@sginet.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Which PnP queries should I respond to? I already support most of the
IOCTL_DISK_* ioctls.

Thanks
Brian

----- Original Message -----
From: “Mark Cariddi”
To: “NT Developers Interest List”
Sent: Thursday, February 22, 2001 11:32 AM
Subject: [ntdev] RE: Creating a disk device

> How are you responding the the PnP Queries? There’s more involved that
> just doing FILE_DEVICE_MASS_STORAGE.
>
> Mark J. Cariddi
> Consulting Associate
> Open Systems Resources, Inc.
> http://www.osr.com/
>
>
> -----Original Message-----
> From: Brian Palmer [mailto:xxxxx@sginet.com]
> Sent: Thursday, February 22, 2001 1:02 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Creating a disk device
>
>
> I tried that, it did not appear to have any effect. I have also tried
> registering some device interfaces, but that didn’t seem to work either.
>
> Brian
>
> ----- Original Message -----
> From: “Mark Cariddi”
> To: “NT Developers Interest List”
> Sent: Thursday, February 22, 2001 10:50 AM
> Subject: [ntdev] RE: Creating a disk device
>
>
> > Try FILE_DEVICE_MASS_STORAGE.
> >
> > Mark J. Cariddi
> > Consulting Associate
> > Open Systems Resources, Inc.
> > http://www.osr.com/
> >
> >
> > -----Original Message-----
> > From: xxxxx@sginet.com [mailto:xxxxx@sginet.com]
> > Sent: Thursday, February 22, 2001 7:33 AM
> > To: NT Developers Interest List
> > Subject: [ntdev] Creating a disk device
> >
> >
> > In my AddDevice() routine I create a device with a type ==
> > FILE_DEVICE_DISK. My device does not show up anywhere in windows (aka
> drive
> > manager, etc.) and windows will not mount it automagically for me. So
the
> > quick hack approach that I took was to manually create a symlink in the
> > \DosDevices directory for the drive letter. But I am not satisfied with
> > this method and I would like to find a better one. How do most other usb
> > storage devices create their device objects so that windows creates a
> drive
> > letter for them?
> >
> > Brian
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@osr.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@sginet.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@osr.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@sginet.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

MASS_STORAGE_DEVICE is correct.

But you also have to identify your disk device PDO to PnP as some sort of
disk device, or you won’t get noticed correctly by the PnpManager and the
disk class driver won’t get instantiated above you. So you have to support
IRP_MN_QUERY_ID. You didn’t say if you were a bus driver or an FDO (or PDO)
filter driver, so depending on which one, you either generate the
appropriate PnP ID, or replace the one generated by the PDO below you.

Note to Microsoft marketing: spellchecker offers to replace “PnpManager”
with “unmanaged”, what a quandry, should I accept this or not?

Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
603 321 1032
WindowsNT Windows 2000 Consulting Services

-----Original Message-----
From: Brian Palmer [mailto:xxxxx@sginet.com]
Sent: Thursday, February 22, 2001 1:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Creating a disk device

I tried that, it did not appear to have any effect. I have also tried
registering some device interfaces, but that didn’t seem to work either.

Brian

----- Original Message -----
From: “Mark Cariddi”
To: “NT Developers Interest List”
Sent: Thursday, February 22, 2001 10:50 AM
Subject: [ntdev] RE: Creating a disk device

> Try FILE_DEVICE_MASS_STORAGE.
>
> Mark J. Cariddi
> Consulting Associate
> Open Systems Resources, Inc.
> http://www.osr.com/
>
>
> -----Original Message-----
> From: xxxxx@sginet.com [mailto:xxxxx@sginet.com]
> Sent: Thursday, February 22, 2001 7:33 AM
> To: NT Developers Interest List
> Subject: [ntdev] Creating a disk device
>
>
> In my AddDevice() routine I create a device with a type ==
> FILE_DEVICE_DISK. My device does not show up anywhere in windows (aka
drive
> manager, etc.) and windows will not mount it automagically for me. So the
> quick hack approach that I took was to manually create a symlink in the
> \DosDevices directory for the drive letter. But I am not satisfied with
> this method and I would like to find a better one. How do most other usb
> storage devices create their device objects so that windows creates a
drive
> letter for them?
>
> Brian
>
> —
> You are currently subscribed to ntdev as: xxxxx@osr.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@sginet.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

My device is a usb mass storage device. The usbd driver creates the pdo and
my driver creates the fdo. I looked at the ddk docs and it says that
function and filter drivers do not handle the IRP_MN_QUERY_ID IRP. If I do
handle it, how am I supposed to reply to it?

Thanks
Brian

----- Original Message -----
From: “Roddy, Mark”
To: “NT Developers Interest List”
Sent: Thursday, February 22, 2001 11:50 AM
Subject: [ntdev] RE: Creating a disk device

> MASS_STORAGE_DEVICE is correct.
>
> But you also have to identify your disk device PDO to PnP as some sort of
> disk device, or you won’t get noticed correctly by the PnpManager and the
> disk class driver won’t get instantiated above you. So you have to support
> IRP_MN_QUERY_ID. You didn’t say if you were a bus driver or an FDO (or
PDO)
> filter driver, so depending on which one, you either generate the
> appropriate PnP ID, or replace the one generated by the PDO below you.
>
> Note to Microsoft marketing: spellchecker offers to replace “PnpManager”
> with “unmanaged”, what a quandry, should I accept this or not?
>
> Mark Roddy
> xxxxx@hollistech.com
> www.hollistech.com
> 603 321 1032
> WindowsNT Windows 2000 Consulting Services
>
>
>
> -----Original Message-----
> From: Brian Palmer [mailto:xxxxx@sginet.com]
> Sent: Thursday, February 22, 2001 1:02 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Creating a disk device
>
>
> I tried that, it did not appear to have any effect. I have also tried
> registering some device interfaces, but that didn’t seem to work either.
>
> Brian
>
> ----- Original Message -----
> From: “Mark Cariddi”
> To: “NT Developers Interest List”
> Sent: Thursday, February 22, 2001 10:50 AM
> Subject: [ntdev] RE: Creating a disk device
>
>
> > Try FILE_DEVICE_MASS_STORAGE.
> >
> > Mark J. Cariddi
> > Consulting Associate
> > Open Systems Resources, Inc.
> > http://www.osr.com/
> >
> >
> > -----Original Message-----
> > From: xxxxx@sginet.com [mailto:xxxxx@sginet.com]
> > Sent: Thursday, February 22, 2001 7:33 AM
> > To: NT Developers Interest List
> > Subject: [ntdev] Creating a disk device
> >
> >
> > In my AddDevice() routine I create a device with a type ==
> > FILE_DEVICE_DISK. My device does not show up anywhere in windows (aka
> drive
> > manager, etc.) and windows will not mount it automagically for me. So
the
> > quick hack approach that I took was to manually create a symlink in the
> > \DosDevices directory for the drive letter. But I am not satisfied with
> > this method and I would like to find a better one. How do most other usb
> > storage devices create their device objects so that windows creates a
> drive
> > letter for them?
> >
> > Brian
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@osr.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@sginet.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@sginet.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com