Assign drive letters

Is there a function to assign drive letters ?

A. Roth


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

DefineDosDevice()

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Andreas Roth
Sent: Friday, May 04, 2001 7:56 AM
To: File Systems Developers
Subject: [ntfsd] Assign drive letters

Is there a function to assign drive letters ?

A. Roth


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


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

DefineDosDevice()
w2k also has more modern volume APIs.

----- Original Message -----
From: “Andreas Roth”
To: “File Systems Developers”
Sent: Friday, May 04, 2001 6:55 PM
Subject: [ntfsd] Assign drive letters

> Is there a function to assign drive letters ?
>
> A. Roth
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


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

SetVolumeMountPoint()

-----Original Message-----
From: Andreas Roth [mailto:xxxxx@arsoft-online.de]
Sent: Friday, May 04, 2001 8:56 AM
To: File Systems Developers
Subject: [ntfsd] Assign drive letters

Is there a function to assign drive letters ?

A. Roth


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


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

I am writing a filter driver and want to send commands to it. A couple of
questions:

  1. How do I know that the app/user has the authority to issue the command?
    On Unix you can set the permission settings of the device file, does NT have
    something equivalent?

  2. All the filter examples I have seen use IoCreateDevice with a non-NULL
    devicename parameter, however, the doc states that filter drivers should
    supply NULL and use IoRegisterDeviceInterface. What are the differences
    between the two and which is the prefered method?

Any help appreciated.
Stan


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

For your security concerns, check out the link
http://www.sysinternals.com/ntw2k/source/devsec.shtml.

As for IoCreateDevice with a device name versus IoRegisterDeviceInterface,
Microsoft would prefer you use the latter. The former is compatible with
NT4 and gives you a nice readable device name in the Object Manager’s
namespace. Incidentally, you can browse that namespace with the WINOBJ tool
available at the aforementioned website. The latter,
IoRegisterDeviceInterface, gives you a unique but unreadable device name
derived from the GUID you specify as a parameter. The theory is that this
will prevent device name collisions between different device driver vendors.

-----Original Message-----
From: Stanislaw Kowalczyk [mailto:xxxxx@relicore.com]
Sent: Friday, May 04, 2001 2:16 PM
To: File Systems Developers
Subject: [ntfsd] RE: Assign drive letters

I am writing a filter driver and want to send commands to it.
A couple of
questions:

  1. How do I know that the app/user has the authority to issue
    the command?
    On Unix you can set the permission settings of the device
    file, does NT have
    something equivalent?

  2. All the filter examples I have seen use IoCreateDevice
    with a non-NULL
    devicename parameter, however, the doc states that filter
    drivers should
    supply NULL and use IoRegisterDeviceInterface. What are the
    differences
    between the two and which is the prefered method?

Any help appreciated.
Stan


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


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

Rob and Stan,

In addition to reducing collisions, there’s one other handy, subtle, and
often overlooked benefit to using the device interface GUID approach. The
names you get from the set of SetupDi calls are ‘sticky’, across boots even.

As I RECALL (don’t want to test this out again right now, so don’t quote me
on it…) this is what that feature buys you:

The device name generated by your driver’s call to IoRegisterDeviceInterface
‘tracks with the device’ (well, actually, it tracks with the PDO).

If the device can be uniquely identified, such as a USB device with a serial
number, this is very cool. You get the same PDO (and therefore name) across
boots and plug/unplug cycles. Even if you move the device to a different
port, and/or install multiple instances in various orders, reboot, go eat
lunch, loan the hardware to a coworker for a couple of weeks, etc. the name
your application uses in the user-mode CreateFile call is always the same.
Your app can therefore store the name (acquired from a set of SetupDi calls
made in a one-time configuration in your application) in the registry and
always reopen the SAME actual physical device.

If the device doesn’t have a serial number / cannot be uniquely identified,
the name still tracks with position/location - so even if you add several
more new, identical, boards to your machine, one on each side of your
existing identical board, the CreateFile string in your user-mode app is
still the same. Almost as good as tracking with the actual device. [This
probably applies to all PCI devices, but doesn’t have to - anyone know if
the PCI bus driver uses the new 2.2 serial number if it’s there? Also many
USB devices don’t contain serial numbers.

Of course that all has little to do with your filter driver issues (which
there are actually a various number of ways to solve)…

-Tim

Timothy A. Johns — xxxxx@driverdev.com
Driver Development Corporation — 800.841.0092
Bring Up Your Hardware — Fast. www.driverdev.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Rob Fuller
Sent: Friday, May 04, 2001 2:41 PM
To: File Systems Developers
Subject: [ntfsd] RE: Assign drive letters

For your security concerns, check out the link
http://www.sysinternals.com/ntw2k/source/devsec.shtml.

As for IoCreateDevice with a device name versus IoRegisterDeviceInterface,
Microsoft would prefer you use the latter. The former is compatible with
NT4 and gives you a nice readable device name in the Object Manager’s
namespace. Incidentally, you can browse that namespace with the
WINOBJ tool
available at the aforementioned website. The latter,
IoRegisterDeviceInterface, gives you a unique but unreadable device name
derived from the GUID you specify as a parameter. The theory is that this
will prevent device name collisions between different device
driver vendors.

> -----Original Message-----
> From: Stanislaw Kowalczyk [mailto:xxxxx@relicore.com]
> Sent: Friday, May 04, 2001 2:16 PM
> To: File Systems Developers
> Subject: [ntfsd] RE: Assign drive letters
>
>
> I am writing a filter driver and want to send commands to it.
> A couple of
> questions:
>
> 1) How do I know that the app/user has the authority to issue
> the command?
> On Unix you can set the permission settings of the device
> file, does NT have
> something equivalent?
>
> 2) All the filter examples I have seen use IoCreateDevice
> with a non-NULL
> devicename parameter, however, the doc states that filter
> drivers should
> supply NULL and use IoRegisterDeviceInterface. What are the
> differences
> between the two and which is the prefered method?
>
> Any help appreciated.
> Stan
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@nsisw.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


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


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

> probably applies to all PCI devices, but doesn’t have to - anyone know if

the PCI bus driver uses the new 2.2 serial number if it’s there? Also
many
USB devices don’t contain serial numbers.

Win98 used the slot/function number for the device instance IDs.
w2k seems to use more complex scheme for them.

Max


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

what do system assigned drive letter mean on NT? Though the drive letter is
shown by the windisk but the information in the resgistry HKLM\system\Disk
does not contain the information of the drive letters?

Thanks,
Pashupati Kumar
Member Of Technical Staff
Legato Systems
New Delhi, India.

xxxxx@legato.com
Ph: +91-11-6826622/410/846(ext-165)
Fax: +91-11-6929170

> probably applies to all PCI devices, but doesn’t have to - anyone know
if
> the PCI bus driver uses the new 2.2 serial number if it’s there? Also
many
> USB devices don’t contain serial numbers.

Win98 used the slot/function number for the device instance IDs.
w2k seems to use more complex scheme for them.

Max


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


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

Drive letter is an in-memory symlink to the NT-style device name.

----- Original Message -----
From: “Pashupati Kumar”
To: “File Systems Developers”
Sent: Saturday, May 05, 2001 12:44 PM
Subject: [ntfsd] RE: Assign drive letters

> what do system assigned drive letter mean on NT? Though the drive letter
is
> shown by the windisk but the information in the resgistry HKLM\system\Disk
> does not contain the information of the drive letters?
>
> Thanks,
> Pashupati Kumar
> Member Of Technical Staff
> Legato Systems
> New Delhi, India.
>
> xxxxx@legato.com
> Ph: +91-11-6826622/410/846(ext-165)
> Fax: +91-11-6929170
>
> > > probably applies to all PCI devices, but doesn’t have to - anyone know
> if
> > > the PCI bus driver uses the new 2.2 serial number if it’s there? Also
> > many
> > > USB devices don’t contain serial numbers.
> >
> > Win98 used the slot/function number for the device instance IDs.
> > w2k seems to use more complex scheme for them.
> >
> > Max
> >
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@Legato.COM
> > To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


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

> Drive letter is an in-memory symlink to the NT-style device name.
Does it mean there is no persistent storage for driveletter assignment
across boots? There should be a way how windisk assigns drive letter to
different partitions, even if it is not present in present in the registry.
Are you aware of some calls by which any application can also get same
consistent info as windisk is having/showing?

----- Original Message -----
From: “Pashupati Kumar”
> To: “File Systems Developers”
> Sent: Saturday, May 05, 2001 12:44 PM
> Subject: [ntfsd] RE: Assign drive letters
>
>
> > what do system assigned drive letter mean on NT? Though the drive letter
> is
> > shown by the windisk but the information in the resgistry
HKLM\system\Disk
> > does not contain the information of the drive letters?


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

Yes, they are saved in Disk registry key in NT4 and in some MountMgr’s
registry place in w2k.
QueryDosDevice is a way to go in NT4, volume management API - in w2k.

Max

----- Original Message -----
From: “Pashupati Kumar”
To: “File Systems Developers”
Sent: Saturday, May 05, 2001 8:45 PM
Subject: [ntfsd] RE: Assign drive letters

> > Drive letter is an in-memory symlink to the NT-style device name.
> Does it mean there is no persistent storage for driveletter assignment
> across boots? There should be a way how windisk assigns drive letter to
> different partitions, even if it is not present in present in the
registry.
> Are you aware of some calls by which any application can also get same
> consistent info as windisk is having/showing?
>
>
> > ----- Original Message -----
> > From: “Pashupati Kumar”
> > To: “File Systems Developers”
> > Sent: Saturday, May 05, 2001 12:44 PM
> > Subject: [ntfsd] RE: Assign drive letters
> >
> >
> > > what do system assigned drive letter mean on NT? Though the drive
letter
> > is
> > > shown by the windisk but the information in the resgistry
> HKLM\system\Disk
> > > does not contain the information of the drive letters?
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


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

Thanks for the usefull information, ended up deciding not to use
IoRegisterDeviceInterface.

The link describes ways for the device driver to control who is allowed to
open a connection, however, I want to know if there exists a way for the
administrator to control the security settings without having the device
driver do the dirty work? I noticed WinObj showed the security settings of
drivers but I did not have the opportunity to see if WinObj can modify them,
will try this afternoon.

On a side note, in an earlier thread, getfullpathname, someone posted the
sfilter example where it used the ObQueryNameString function. A word of
caution, the example uses this function in the completion routine which runs
<= DISPATCH_LEVEL while ObQueryNameString must run < DISPATH_LEVEL.
Eventually something bad will happen.

Stan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Rob Fuller
Sent: Friday, May 04, 2001 5:41 PM
To: File Systems Developers
Subject: [ntfsd] RE: Assign drive letters

For your security concerns, check out the link
http://www.sysinternals.com/ntw2k/source/devsec.shtml.

As for IoCreateDevice with a device name versus IoRegisterDeviceInterface,
Microsoft would prefer you use the latter. The former is compatible with
NT4 and gives you a nice readable device name in the Object Manager’s
namespace. Incidentally, you can browse that namespace with the WINOBJ tool
available at the aforementioned website. The latter,
IoRegisterDeviceInterface, gives you a unique but unreadable device name
derived from the GUID you specify as a parameter. The theory is that this
will prevent device name collisions between different device driver vendors.

-----Original Message-----
From: Stanislaw Kowalczyk [mailto:xxxxx@relicore.com]
Sent: Friday, May 04, 2001 2:16 PM
To: File Systems Developers
Subject: [ntfsd] RE: Assign drive letters

I am writing a filter driver and want to send commands to it.
A couple of
questions:

  1. How do I know that the app/user has the authority to issue
    the command?
    On Unix you can set the permission settings of the device
    file, does NT have
    something equivalent?

  2. All the filter examples I have seen use IoCreateDevice
    with a non-NULL
    devicename parameter, however, the doc states that filter
    drivers should
    supply NULL and use IoRegisterDeviceInterface. What are the
    differences
    between the two and which is the prefered method?

Any help appreciated.
Stan


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


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


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

> On a side note, in an earlier thread, getfullpathname, someone posted the

sfilter example where it used the ObQueryNameString function. A word of
caution, the example uses this function in the completion routine which
runs
<= DISPATCH_LEVEL while ObQueryNameString must run < DISPATH_LEVEL.
Eventually something bad will happen.

Before calling ObQueryNameString I will set IRQL to DISPATCH_LEVEL and i
will restore to old. What will happen in this case ?

Regards,
Satish K.S


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

> > On a side note, in an earlier thread, getfullpathname, someone posted
the

> sfilter example where it used the ObQueryNameString function. A word of
> caution, the example uses this function in the completion routine which
runs
> <= DISPATCH_LEVEL while ObQueryNameString must run < DISPATH_LEVEL.
> Eventually something bad will happen.

Before calling ObQueryNameString I will set IRQL to DISPATCH_LEVEL and i
will restore to old. What will happen in this case ?

Sorry Above one is wrong what i wrote in previous mail.

Before calling ObQueryNameString I will set IRQL to PASSIVE_LEVEL and i
will restore to old. What will happen in this case ?

Regards,
Satish K.S


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

Satish,

Before calling ObQueryNameString I will set IRQL to
> PASSIVE_LEVEL and i will restore to old.

Why go to all that trouble? Just call KeBugCheck() and be done with it.
Sheesh.

Felix.


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

Just to make this perfectly clear. The sfilter sample in the Windows
2000 version of the IFSKIT is WRONG to call ObQueryNameString from the
Create Completion routine. This has been fixed (along with many other
things) in the WindowsXP version of the IFSKKIT.

Neal Christiansen

-----Original Message-----
From: Stanislaw Kowalczyk [mailto:xxxxx@relicore.com]
Sent: Tuesday, May 08, 2001 11:27 AM
To: File Systems Developers
Subject: [ntfsd] RE: Assign drive letters

Thanks for the usefull information, ended up deciding not to use
IoRegisterDeviceInterface.

The link describes ways for the device driver to control who is allowed
to
open a connection, however, I want to know if there exists a way for the
administrator to control the security settings without having the device
driver do the dirty work? I noticed WinObj showed the security settings
of
drivers but I did not have the opportunity to see if WinObj can modify
them,
will try this afternoon.

On a side note, in an earlier thread, getfullpathname, someone posted
the
sfilter example where it used the ObQueryNameString function. A word of
caution, the example uses this function in the completion routine which
runs
<= DISPATCH_LEVEL while ObQueryNameString must run < DISPATH_LEVEL.
Eventually something bad will happen.

Stan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Rob Fuller
Sent: Friday, May 04, 2001 5:41 PM
To: File Systems Developers
Subject: [ntfsd] RE: Assign drive letters

For your security concerns, check out the link
http://www.sysinternals.com/ntw2k/source/devsec.shtml.

As for IoCreateDevice with a device name versus
IoRegisterDeviceInterface,
Microsoft would prefer you use the latter. The former is compatible
with
NT4 and gives you a nice readable device name in the Object Manager’s
namespace. Incidentally, you can browse that namespace with the WINOBJ
tool
available at the aforementioned website. The latter,
IoRegisterDeviceInterface, gives you a unique but unreadable device name
derived from the GUID you specify as a parameter. The theory is that
this
will prevent device name collisions between different device driver
vendors.

-----Original Message-----
From: Stanislaw Kowalczyk [mailto:xxxxx@relicore.com]
Sent: Friday, May 04, 2001 2:16 PM
To: File Systems Developers
Subject: [ntfsd] RE: Assign drive letters

I am writing a filter driver and want to send commands to it.
A couple of
questions:

  1. How do I know that the app/user has the authority to issue
    the command?
    On Unix you can set the permission settings of the device
    file, does NT have
    something equivalent?

  2. All the filter examples I have seen use IoCreateDevice
    with a non-NULL
    devicename parameter, however, the doc states that filter
    drivers should
    supply NULL and use IoRegisterDeviceInterface. What are the
    differences
    between the two and which is the prefered method?

Any help appreciated.
Stan


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


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


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


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