what is the purpose of the DeviceType member in DEVICE_OBJECT ?
who uses this value ? why should I be interested in that member when I can also get the device type from the Class that is setup for it's driver in the registry ?

Re: a device object's type by Maxim

Maxim
Wed Jun 23 04:57:20 CDT 2004

This value is used for Win32 GetFileType routine, and also to distinguish
"block" (mountable) devices from "character" (unmountable) ones.

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


"shahar" <shahar@discussions.microsoft.com> wrote in message
news:C77E227F-B045-466E-A0B9-8C893AE4B638@microsoft.com...
> what is the purpose of the DeviceType member in DEVICE_OBJECT ?
> who uses this value ? why should I be interested in that member when I can
also get the device type from the Class that is setup for it's driver in the
registry ?



Re: a device object's type by Peter

Peter
Wed Jun 23 12:38:52 CDT 2004

Just don't specify a storage device type if it isn't (if you say you're a
disk you'll get a VPB and someone could try to mount a file-system on you
which is sort of unpleasant if you're not prepared for it).

the device types that result in VPB creation are (currently):

FILE_DEVICE_DISK
FILE_DEVICE_TAPE
FILE_DEVICE_CD_ROM
FILE_DEVICE_VIRTUAL_DISK

also you should avoid the file-system types unless your driver is really a
filesystem:

FILE_DEVICE_CD_ROM_FILE_SYSTEM
FILE_DEVICE_DISK_FILE_SYSTEM
FILE_DEVICE_FILE_SYSTEM
FILE_DEVICE_NETWORK_FILE_SYSTEM
FILE_DEVICE_TAPE_FILE_SYSTEM

Finally it's used to create the default ACL applied to the device object.
Again file-system and storage objects get slightly different ACLs than
default devices in order to ensure that administrator can run chkdsk (at
least that's what the comments say :)

-p

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:OBX75fQWEHA.3236@tk2msftngp13.phx.gbl...
> This value is used for Win32 GetFileType routine, and also to
> distinguish
> "block" (mountable) devices from "character" (unmountable) ones.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>
> "shahar" <shahar@discussions.microsoft.com> wrote in message
> news:C77E227F-B045-466E-A0B9-8C893AE4B638@microsoft.com...
>> what is the purpose of the DeviceType member in DEVICE_OBJECT ?
>> who uses this value ? why should I be interested in that member when I
>> can
> also get the device type from the Class that is setup for it's driver in
> the
> registry ?
>
>



Re: a device object's type by shahar

shahar
Wed Jun 23 19:04:01 CDT 2004

There is still one thing I did not understand:
If the system decides to mount a file system on a device according to it's DeviceType, what importance does the device's Class have ?
Are you saying that as long as a storage driver reports the right DeviceType it doesn't matter what Class it is registered in ?
will a storage driver be still mountable even if it is Classified as a HID, for example ?

"Peter Wieland [MSFT]" wrote:

> Just don't specify a storage device type if it isn't (if you say you're a
> disk you'll get a VPB and someone could try to mount a file-system on you
> which is sort of unpleasant if you're not prepared for it).
>
> the device types that result in VPB creation are (currently):
>
> FILE_DEVICE_DISK
> FILE_DEVICE_TAPE
> FILE_DEVICE_CD_ROM
> FILE_DEVICE_VIRTUAL_DISK
>
> also you should avoid the file-system types unless your driver is really a
> filesystem:
>
> FILE_DEVICE_CD_ROM_FILE_SYSTEM
> FILE_DEVICE_DISK_FILE_SYSTEM
> FILE_DEVICE_FILE_SYSTEM
> FILE_DEVICE_NETWORK_FILE_SYSTEM
> FILE_DEVICE_TAPE_FILE_SYSTEM
>
> Finally it's used to create the default ACL applied to the device object.
> Again file-system and storage objects get slightly different ACLs than
> default devices in order to ensure that administrator can run chkdsk (at
> least that's what the comments say :)
>
> -p
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> news:OBX75fQWEHA.3236@tk2msftngp13.phx.gbl...
> > This value is used for Win32 GetFileType routine, and also to
> > distinguish
> > "block" (mountable) devices from "character" (unmountable) ones.
> >
> > --
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > maxim@storagecraft.com
> > http://www.storagecraft.com
> >
> >
> > "shahar" <shahar@discussions.microsoft.com> wrote in message
> > news:C77E227F-B045-466E-A0B9-8C893AE4B638@microsoft.com...
> >> what is the purpose of the DeviceType member in DEVICE_OBJECT ?
> >> who uses this value ? why should I be interested in that member when I
> >> can
> > also get the device type from the Class that is setup for it's driver in
> > the
> > registry ?
> >
> >
>
>
>

Re: a device object's type by shahar

shahar
Thu Jun 24 02:34:01 CDT 2004

I checked this myself just now, and the answer is yes:
a device that is Classified as HID will be mounted if it's DeviceType member will be a storage type.

"shahar" wrote:

> There is still one thing I did not understand:
> If the system decides to mount a file system on a device according to it's DeviceType, what importance does the device's Class have ?
> Are you saying that as long as a storage driver reports the right DeviceType it doesn't matter what Class it is registered in ?
> will a storage driver be still mountable even if it is Classified as a HID, for example ?
>
> "Peter Wieland [MSFT]" wrote:
>
> > Just don't specify a storage device type if it isn't (if you say you're a
> > disk you'll get a VPB and someone could try to mount a file-system on you
> > which is sort of unpleasant if you're not prepared for it).
> >
> > the device types that result in VPB creation are (currently):
> >
> > FILE_DEVICE_DISK
> > FILE_DEVICE_TAPE
> > FILE_DEVICE_CD_ROM
> > FILE_DEVICE_VIRTUAL_DISK
> >
> > also you should avoid the file-system types unless your driver is really a
> > filesystem:
> >
> > FILE_DEVICE_CD_ROM_FILE_SYSTEM
> > FILE_DEVICE_DISK_FILE_SYSTEM
> > FILE_DEVICE_FILE_SYSTEM
> > FILE_DEVICE_NETWORK_FILE_SYSTEM
> > FILE_DEVICE_TAPE_FILE_SYSTEM
> >
> > Finally it's used to create the default ACL applied to the device object.
> > Again file-system and storage objects get slightly different ACLs than
> > default devices in order to ensure that administrator can run chkdsk (at
> > least that's what the comments say :)
> >
> > -p
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> > "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> > news:OBX75fQWEHA.3236@tk2msftngp13.phx.gbl...
> > > This value is used for Win32 GetFileType routine, and also to
> > > distinguish
> > > "block" (mountable) devices from "character" (unmountable) ones.
> > >
> > > --
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > maxim@storagecraft.com
> > > http://www.storagecraft.com
> > >
> > >
> > > "shahar" <shahar@discussions.microsoft.com> wrote in message
> > > news:C77E227F-B045-466E-A0B9-8C893AE4B638@microsoft.com...
> > >> what is the purpose of the DeviceType member in DEVICE_OBJECT ?
> > >> who uses this value ? why should I be interested in that member when I
> > >> can
> > > also get the device type from the Class that is setup for it's driver in
> > > the
> > > registry ?
> > >
> > >
> >
> >
> >

Re: a device object's type by Peter

Peter
Thu Jun 24 09:01:09 CDT 2004

the class matters for the purposes of device installation. There are a set
of filter drivers that are assigned based on the device class guid, and
co-installers are associated with the device as well.

A storage driver will still be mountable if it uses the HID device class,
yes. But the device installation won't go very well, and any component that
tries to enumerate storage devices by looking in the storage device class
through SetupDI won't see your disk.

-p

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"shahar" <shahar@discussions.microsoft.com> wrote in message
news:AB03D663-CE8C-497C-AC00-FE28B9FB87F0@microsoft.com...
> There is still one thing I did not understand:
> If the system decides to mount a file system on a device according to it's
> DeviceType, what importance does the device's Class have ?
> Are you saying that as long as a storage driver reports the right
> DeviceType it doesn't matter what Class it is registered in ?
> will a storage driver be still mountable even if it is Classified as a
> HID, for example ?
>
> "Peter Wieland [MSFT]" wrote:
>
>> Just don't specify a storage device type if it isn't (if you say you're a
>> disk you'll get a VPB and someone could try to mount a file-system on you
>> which is sort of unpleasant if you're not prepared for it).
>>
>> the device types that result in VPB creation are (currently):
>>
>> FILE_DEVICE_DISK
>> FILE_DEVICE_TAPE
>> FILE_DEVICE_CD_ROM
>> FILE_DEVICE_VIRTUAL_DISK
>>
>> also you should avoid the file-system types unless your driver is really
>> a
>> filesystem:
>>
>> FILE_DEVICE_CD_ROM_FILE_SYSTEM
>> FILE_DEVICE_DISK_FILE_SYSTEM
>> FILE_DEVICE_FILE_SYSTEM
>> FILE_DEVICE_NETWORK_FILE_SYSTEM
>> FILE_DEVICE_TAPE_FILE_SYSTEM
>>
>> Finally it's used to create the default ACL applied to the device object.
>> Again file-system and storage objects get slightly different ACLs than
>> default devices in order to ensure that administrator can run chkdsk (at
>> least that's what the comments say :)
>>
>> -p
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
>> news:OBX75fQWEHA.3236@tk2msftngp13.phx.gbl...
>> > This value is used for Win32 GetFileType routine, and also to
>> > distinguish
>> > "block" (mountable) devices from "character" (unmountable) ones.
>> >
>> > --
>> > Maxim Shatskih, Windows DDK MVP
>> > StorageCraft Corporation
>> > maxim@storagecraft.com
>> > http://www.storagecraft.com
>> >
>> >
>> > "shahar" <shahar@discussions.microsoft.com> wrote in message
>> > news:C77E227F-B045-466E-A0B9-8C893AE4B638@microsoft.com...
>> >> what is the purpose of the DeviceType member in DEVICE_OBJECT ?
>> >> who uses this value ? why should I be interested in that member when I
>> >> can
>> > also get the device type from the Class that is setup for it's driver
>> > in
>> > the
>> > registry ?
>> >
>> >
>>
>>
>>



Re: a device object's type by Peter

Peter
Thu Jun 24 10:35:18 CDT 2004

i didn't think i implied that device class wasn't relevant to the proper
functioning of the device. All i said was that you could still mount a file
system on a device that wasn't in the storage device class.

-p

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"shahar" <shahar@discussions.microsoft.com> wrote in message
news:CE9AD246-1F8F-4139-A11E-CCF188646E57@microsoft.com...
> Yes, I understand that. I tried to put my USB network card under HID as
> but it stopped functioning, can you explain this ?
>
> "Peter Wieland [MSFT]" wrote:
>
>> the class matters for the purposes of device installation. There are a
>> set
>> of filter drivers that are assigned based on the device class guid, and
>> co-installers are associated with the device as well.
>>
>> A storage driver will still be mountable if it uses the HID device class,
>> yes. But the device installation won't go very well, and any component
>> that
>> tries to enumerate storage devices by looking in the storage device class
>> through SetupDI won't see your disk.
>>
>> -p
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "shahar" <shahar@discussions.microsoft.com> wrote in message
>> news:AB03D663-CE8C-497C-AC00-FE28B9FB87F0@microsoft.com...
>> > There is still one thing I did not understand:
>> > If the system decides to mount a file system on a device according to
>> > it's
>> > DeviceType, what importance does the device's Class have ?
>> > Are you saying that as long as a storage driver reports the right
>> > DeviceType it doesn't matter what Class it is registered in ?
>> > will a storage driver be still mountable even if it is Classified as a
>> > HID, for example ?
>> >
>> > "Peter Wieland [MSFT]" wrote:
>> >
>> >> Just don't specify a storage device type if it isn't (if you say
>> >> you're a
>> >> disk you'll get a VPB and someone could try to mount a file-system on
>> >> you
>> >> which is sort of unpleasant if you're not prepared for it).
>> >>
>> >> the device types that result in VPB creation are (currently):
>> >>
>> >> FILE_DEVICE_DISK
>> >> FILE_DEVICE_TAPE
>> >> FILE_DEVICE_CD_ROM
>> >> FILE_DEVICE_VIRTUAL_DISK
>> >>
>> >> also you should avoid the file-system types unless your driver is
>> >> really
>> >> a
>> >> filesystem:
>> >>
>> >> FILE_DEVICE_CD_ROM_FILE_SYSTEM
>> >> FILE_DEVICE_DISK_FILE_SYSTEM
>> >> FILE_DEVICE_FILE_SYSTEM
>> >> FILE_DEVICE_NETWORK_FILE_SYSTEM
>> >> FILE_DEVICE_TAPE_FILE_SYSTEM
>> >>
>> >> Finally it's used to create the default ACL applied to the device
>> >> object.
>> >> Again file-system and storage objects get slightly different ACLs than
>> >> default devices in order to ensure that administrator can run chkdsk
>> >> (at
>> >> least that's what the comments say :)
>> >>
>> >> -p
>> >>
>> >> --
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
>> >> news:OBX75fQWEHA.3236@tk2msftngp13.phx.gbl...
>> >> > This value is used for Win32 GetFileType routine, and also to
>> >> > distinguish
>> >> > "block" (mountable) devices from "character" (unmountable) ones.
>> >> >
>> >> > --
>> >> > Maxim Shatskih, Windows DDK MVP
>> >> > StorageCraft Corporation
>> >> > maxim@storagecraft.com
>> >> > http://www.storagecraft.com
>> >> >
>> >> >
>> >> > "shahar" <shahar@discussions.microsoft.com> wrote in message
>> >> > news:C77E227F-B045-466E-A0B9-8C893AE4B638@microsoft.com...
>> >> >> what is the purpose of the DeviceType member in DEVICE_OBJECT ?
>> >> >> who uses this value ? why should I be interested in that member
>> >> >> when I
>> >> >> can
>> >> > also get the device type from the Class that is setup for it's
>> >> > driver
>> >> > in
>> >> > the
>> >> > registry ?
>> >> >
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>



Re: a device object's type by Peter

Peter
Thu Jun 24 13:32:22 CDT 2004

you've misundersood.

the fact that you were able to mount a file system on the storage device in
no way means that it will work correctly in other scenarios. It doesn't
necessarily have the right filters, the co installer wasn't allowed to run,
things that look for storage devices based on their class code won't find
it, etc...

i tried to answer your question as an intelectual investigation. I now get
the feeling you're going to base one of your design decisions on a single,
incomplete experiment and i think that woudl be a mistake.

you might, instead, post what your overall goal is so that people can help
suggest good ways to achieve it.

-p

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"shahar" <shahar@discussions.microsoft.com> wrote in message
news:FD182783-8655-4437-BF6B-5DE8E1588EB9@microsoft.com...
> Can you think of any other type of device which have a similar behavior to
> storage devices ?
> (that is, devices that will be able to function although they are not
> registered in the correct class)
>
> "Peter Wieland [MSFT]" wrote:
>
>> i didn't think i implied that device class wasn't relevant to the proper
>> functioning of the device. All i said was that you could still mount a
>> file
>> system on a device that wasn't in the storage device class.
>>
>> -p
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "shahar" <shahar@discussions.microsoft.com> wrote in message
>> news:CE9AD246-1F8F-4139-A11E-CCF188646E57@microsoft.com...
>> > Yes, I understand that. I tried to put my USB network card under HID as
>> > but it stopped functioning, can you explain this ?
>> >
>> > "Peter Wieland [MSFT]" wrote:
>> >
>> >> the class matters for the purposes of device installation. There are
>> >> a
>> >> set
>> >> of filter drivers that are assigned based on the device class guid,
>> >> and
>> >> co-installers are associated with the device as well.
>> >>
>> >> A storage driver will still be mountable if it uses the HID device
>> >> class,
>> >> yes. But the device installation won't go very well, and any
>> >> component
>> >> that
>> >> tries to enumerate storage devices by looking in the storage device
>> >> class
>> >> through SetupDI won't see your disk.
>> >>
>> >> -p
>> >>
>> >> --
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >> "shahar" <shahar@discussions.microsoft.com> wrote in message
>> >> news:AB03D663-CE8C-497C-AC00-FE28B9FB87F0@microsoft.com...
>> >> > There is still one thing I did not understand:
>> >> > If the system decides to mount a file system on a device according
>> >> > to
>> >> > it's
>> >> > DeviceType, what importance does the device's Class have ?
>> >> > Are you saying that as long as a storage driver reports the right
>> >> > DeviceType it doesn't matter what Class it is registered in ?
>> >> > will a storage driver be still mountable even if it is Classified as
>> >> > a
>> >> > HID, for example ?
>> >> >
>> >> > "Peter Wieland [MSFT]" wrote:
>> >> >
>> >> >> Just don't specify a storage device type if it isn't (if you say
>> >> >> you're a
>> >> >> disk you'll get a VPB and someone could try to mount a file-system
>> >> >> on
>> >> >> you
>> >> >> which is sort of unpleasant if you're not prepared for it).
>> >> >>
>> >> >> the device types that result in VPB creation are (currently):
>> >> >>
>> >> >> FILE_DEVICE_DISK
>> >> >> FILE_DEVICE_TAPE
>> >> >> FILE_DEVICE_CD_ROM
>> >> >> FILE_DEVICE_VIRTUAL_DISK
>> >> >>
>> >> >> also you should avoid the file-system types unless your driver is
>> >> >> really
>> >> >> a
>> >> >> filesystem:
>> >> >>
>> >> >> FILE_DEVICE_CD_ROM_FILE_SYSTEM
>> >> >> FILE_DEVICE_DISK_FILE_SYSTEM
>> >> >> FILE_DEVICE_FILE_SYSTEM
>> >> >> FILE_DEVICE_NETWORK_FILE_SYSTEM
>> >> >> FILE_DEVICE_TAPE_FILE_SYSTEM
>> >> >>
>> >> >> Finally it's used to create the default ACL applied to the device
>> >> >> object.
>> >> >> Again file-system and storage objects get slightly different ACLs
>> >> >> than
>> >> >> default devices in order to ensure that administrator can run
>> >> >> chkdsk
>> >> >> (at
>> >> >> least that's what the comments say :)
>> >> >>
>> >> >> -p
>> >> >>
>> >> >> --
>> >> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> >> rights.
>> >> >> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
>> >> >> news:OBX75fQWEHA.3236@tk2msftngp13.phx.gbl...
>> >> >> > This value is used for Win32 GetFileType routine, and also to
>> >> >> > distinguish
>> >> >> > "block" (mountable) devices from "character" (unmountable) ones.
>> >> >> >
>> >> >> > --
>> >> >> > Maxim Shatskih, Windows DDK MVP
>> >> >> > StorageCraft Corporation
>> >> >> > maxim@storagecraft.com
>> >> >> > http://www.storagecraft.com
>> >> >> >
>> >> >> >
>> >> >> > "shahar" <shahar@discussions.microsoft.com> wrote in message
>> >> >> > news:C77E227F-B045-466E-A0B9-8C893AE4B638@microsoft.com...
>> >> >> >> what is the purpose of the DeviceType member in DEVICE_OBJECT ?
>> >> >> >> who uses this value ? why should I be interested in that member
>> >> >> >> when I
>> >> >> >> can
>> >> >> > also get the device type from the Class that is setup for it's
>> >> >> > driver
>> >> >> > in
>> >> >> > the
>> >> >> > registry ?
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>



Re: a device object's type by Peter

Peter
Fri Jun 25 12:07:22 CDT 2004

okay - i just got worried.

I suspect there are other classes that will work fine. I wouldn't be ablet
o say unless i tried them. I can only answer for storage becuase i've
worked on the storage stack before.

-p

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"shahar" <shahar@discussions.microsoft.com> wrote in message
news:07FECBDF-81C8-4CF1-BF29-2B7A912632E6@microsoft.com...
> you've got the wrong impression, my question is an intelectual
> investigation and i'm not going to implement anything like what is
> suggested here.
> i understand that the storage device will not function properly if it will
> not be in the right class, but it will give some basic functionality like
> reading and writing files to the filesystem.
> i am still interested to hear if you can think of any other type of device
> that will give basic functionality (i understand this does'nt mean it
> functions properly) even if it is not registered in the right class ?
>
> "Peter Wieland [MSFT]" wrote:
>
>> you've misundersood.
>>
>> the fact that you were able to mount a file system on the storage device
>> in
>> no way means that it will work correctly in other scenarios. It doesn't
>> necessarily have the right filters, the co installer wasn't allowed to
>> run,
>> things that look for storage devices based on their class code won't find
>> it, etc...
>>
>> i tried to answer your question as an intelectual investigation. I now
>> get
>> the feeling you're going to base one of your design decisions on a
>> single,
>> incomplete experiment and i think that woudl be a mistake.
>>
>> you might, instead, post what your overall goal is so that people can
>> help
>> suggest good ways to achieve it.
>>
>> -p
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "shahar" <shahar@discussions.microsoft.com> wrote in message
>> news:FD182783-8655-4437-BF6B-5DE8E1588EB9@microsoft.com...
>> > Can you think of any other type of device which have a similar behavior
>> > to
>> > storage devices ?
>> > (that is, devices that will be able to function although they are not
>> > registered in the correct class)
>> >
>> > "Peter Wieland [MSFT]" wrote:
>> >
>> >> i didn't think i implied that device class wasn't relevant to the
>> >> proper
>> >> functioning of the device. All i said was that you could still mount
>> >> a
>> >> file
>> >> system on a device that wasn't in the storage device class.
>> >>
>> >> -p
>> >>
>> >> --
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >> "shahar" <shahar@discussions.microsoft.com> wrote in message
>> >> news:CE9AD246-1F8F-4139-A11E-CCF188646E57@microsoft.com...
>> >> > Yes, I understand that. I tried to put my USB network card under HID
>> >> > as
>> >> > but it stopped functioning, can you explain this ?
>> >> >
>> >> > "Peter Wieland [MSFT]" wrote:
>> >> >
>> >> >> the class matters for the purposes of device installation. There
>> >> >> are
>> >> >> a
>> >> >> set
>> >> >> of filter drivers that are assigned based on the device class guid,
>> >> >> and
>> >> >> co-installers are associated with the device as well.
>> >> >>
>> >> >> A storage driver will still be mountable if it uses the HID device
>> >> >> class,
>> >> >> yes. But the device installation won't go very well, and any
>> >> >> component
>> >> >> that
>> >> >> tries to enumerate storage devices by looking in the storage device
>> >> >> class
>> >> >> through SetupDI won't see your disk.
>> >> >>
>> >> >> -p
>> >> >>
>> >> >> --
>> >> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> >> rights.
>> >> >> "shahar" <shahar@discussions.microsoft.com> wrote in message
>> >> >> news:AB03D663-CE8C-497C-AC00-FE28B9FB87F0@microsoft.com...
>> >> >> > There is still one thing I did not understand:
>> >> >> > If the system decides to mount a file system on a device
>> >> >> > according
>> >> >> > to
>> >> >> > it's
>> >> >> > DeviceType, what importance does the device's Class have ?
>> >> >> > Are you saying that as long as a storage driver reports the right
>> >> >> > DeviceType it doesn't matter what Class it is registered in ?
>> >> >> > will a storage driver be still mountable even if it is Classified
>> >> >> > as
>> >> >> > a
>> >> >> > HID, for example ?
>> >> >> >
>> >> >> > "Peter Wieland [MSFT]" wrote:
>> >> >> >
>> >> >> >> Just don't specify a storage device type if it isn't (if you say
>> >> >> >> you're a
>> >> >> >> disk you'll get a VPB and someone could try to mount a
>> >> >> >> file-system
>> >> >> >> on
>> >> >> >> you
>> >> >> >> which is sort of unpleasant if you're not prepared for it).
>> >> >> >>
>> >> >> >> the device types that result in VPB creation are (currently):
>> >> >> >>
>> >> >> >> FILE_DEVICE_DISK
>> >> >> >> FILE_DEVICE_TAPE
>> >> >> >> FILE_DEVICE_CD_ROM
>> >> >> >> FILE_DEVICE_VIRTUAL_DISK
>> >> >> >>
>> >> >> >> also you should avoid the file-system types unless your driver
>> >> >> >> is
>> >> >> >> really
>> >> >> >> a
>> >> >> >> filesystem:
>> >> >> >>
>> >> >> >> FILE_DEVICE_CD_ROM_FILE_SYSTEM
>> >> >> >> FILE_DEVICE_DISK_FILE_SYSTEM
>> >> >> >> FILE_DEVICE_FILE_SYSTEM
>> >> >> >> FILE_DEVICE_NETWORK_FILE_SYSTEM
>> >> >> >> FILE_DEVICE_TAPE_FILE_SYSTEM
>> >> >> >>
>> >> >> >> Finally it's used to create the default ACL applied to the
>> >> >> >> device
>> >> >> >> object.
>> >> >> >> Again file-system and storage objects get slightly different
>> >> >> >> ACLs
>> >> >> >> than
>> >> >> >> default devices in order to ensure that administrator can run
>> >> >> >> chkdsk
>> >> >> >> (at
>> >> >> >> least that's what the comments say :)
>> >> >> >>
>> >> >> >> -p
>> >> >> >>
>> >> >> >> --
>> >> >> >> This posting is provided "AS IS" with no warranties, and confers
>> >> >> >> no
>> >> >> >> rights.
>> >> >> >> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
>> >> >> >> news:OBX75fQWEHA.3236@tk2msftngp13.phx.gbl...
>> >> >> >> > This value is used for Win32 GetFileType routine, and also
>> >> >> >> > to
>> >> >> >> > distinguish
>> >> >> >> > "block" (mountable) devices from "character" (unmountable)
>> >> >> >> > ones.
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > Maxim Shatskih, Windows DDK MVP
>> >> >> >> > StorageCraft Corporation
>> >> >> >> > maxim@storagecraft.com
>> >> >> >> > http://www.storagecraft.com
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > "shahar" <shahar@discussions.microsoft.com> wrote in message
>> >> >> >> > news:C77E227F-B045-466E-A0B9-8C893AE4B638@microsoft.com...
>> >> >> >> >> what is the purpose of the DeviceType member in DEVICE_OBJECT
>> >> >> >> >> ?
>> >> >> >> >> who uses this value ? why should I be interested in that
>> >> >> >> >> member
>> >> >> >> >> when I
>> >> >> >> >> can
>> >> >> >> > also get the device type from the Class that is setup for it's
>> >> >> >> > driver
>> >> >> >> > in
>> >> >> >> > the
>> >> >> >> > registry ?
>> >> >> >> >
>> >> >> >> >
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>