Re: Getting from device path to driver letter for firewire media changer
- From: "Dean Roddey" <droddey@xxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jun 2007 13:30:35 -0700
I'm not sure how that answers the questions I had though. I need a
persistent reference to a changer that can be converted to a driver letter.
Without such a thing, there's no way that any software can be assigned to a
particular changer in a persistent way, but then also be able to derive from
that persistent identifier the dynamically assigned drive letter required to
open the changer and interact with it via IOCTL.
--------------------
Dean Roddey
Chairman/CTO, Charmed Quark Systems, Ltd
www.charmedquark.com
"Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx> wrote in message
news:umsVx37tHHA.4972@xxxxxxxxxxxxxxxxxxxxxxx
If you receive WM_DEVICECHANGE device message you can check letters with
QueryDosDevice()
Arkady
"Dean Roddey" <droddey@xxxxxxxxxxxxxxxx> wrote in message
news:u3d4WZhtHHA.4952@xxxxxxxxxxxxxxxxxxxxxxx
Oh product is an automation system (Windows based of course), and among
the various things it does is media management. We are trying to add a
driver (our level driver, not a system level driver) for the new Firewire
based changes, to supplement our existing serially controlled changer
drivers.
What I'm a little confused about is how to come up with a persistent
reference to the changer. Being an automation system, the user loads one
of our drivers for each device and then forgets about it. We talk to the
device and expose control over it via a generic interface. But that means
we have to be able to get back to that device reliably. Usualy it's a
serial port or IP address or something of that nature.
We need a driver letter, since that's what we have to open up in order to
do the IOCTL calls required to control the changer, but these driver
letters are mapped dynamically by the system and could easily change
during system hardware changes (turn it off, unplug some external
drives,turn it back on, plug them in a different order or a new fixed
drive was installed, etc...) This wouldn't be good.
We can obviously enumerate the devices via the SetupDi methods, but that
doesn't help really. For one thing, we can't map it back to a drive
letter so it doesn't do us any good even if it is a persistent id to the
changer. And secondly, the user wouldn't know the SetupDi-provided device
paths from a hole in the ground, so they would have no way to reliably
point a driver at a particular one.
There seem to be some tricks for mapping the device path to a drive
letter, but I can't get them to work. They involve the use of the
IOCTL_STORAGE_GET_DEVICE_NUMBER to get the device number, and then an
iteration of the drives to get the same and looking for a match. But I
can't get the firewire changer opened using the SetupDi returned device
path. I always get ERROR_BUSY. I've tried all possible combinations of
minimal access rights, so I don't think that's the problem. I can open it
easily enough using the \\.\X: type path, but if course that doesn't help
me at all for the reasons above. There's nothing using the drive at all.
What I'd like to do is figure out all the device paths and their
corresponding drive paths. Present the drive paths to the user to select
from, but store the device path along with the drive path in our driver
config, so that it can be used to actually get to the drive again later,
which could change without bothering us.
So anyway, if anyone has any thoughts on this, I'd really appreciate a
second opinion. I'm just about ready to chuck the whole thing honestly,
since it's taking up time that could be spent on things that are actually
well documented and less obscure, and equally desirable. But I'd like to
get this working if possible.
---------------------
Dean Roddey
Chairman/CTO, Charmed Quark Systems, Ltd
www.charmedquark.com
.
- References:
- Getting from device path to driver letter for firewire media changer
- From: Dean Roddey
- Re: Getting from device path to driver letter for firewire media changer
- From: Arkady Frenkel
- Getting from device path to driver letter for firewire media changer
- Prev by Date: Re: Slow file reading
- Next by Date: Re: File system error (-1073741502)
- Previous by thread: Re: Getting from device path to driver letter for firewire media changer
- Next by thread: Re: Registry access on another Windows Installation
- Index(es):
Relevant Pages
|