Re: SetupDiGetClassDevs
- From: "anton bassov" <soviet_bloke@xxxxxxxxxxx>
- Date: 6 Aug 2006 20:05:52 -0700
Hi Don
The challenge is what he really wants to do with the subset that
is in 1 but not 2
As long as partition is recognized by the system, it gets automatically
mounted, so that volume ID and driver letter are assigned to it
automatically. Therefore, the above situation may occur only if :
A. Disk is not yet partitioned
B. Partition is not recognized
C. Volume ID and/or drive letter are deleted. In this case the whole
problem is solvable simply by removing and re-inserting USB device
It looks like finally I have realized what the OP wants to do, and it
has ABSOLUTELY(!!!) nothing to do with the way he presented the
original problem - he presented it as "drive-port correspondence" (i.e.
like drives F: and G correspond to USB devices that are
plugged into USB ports respectively 1 and 2), which just does not seem
to make sense.
Windows does not allow more than one partition on removable disks.
Therefore, if USB device presents itself as removable, rather than
basic, disk to the system, Windows
will recognize only one partition on it. Linux does not have this
limitation. Therefore, if you format your device with two FAT
partitions under Linux and then plug it into the machine that runs
Windows, you will be able to access data that is stored only on the
first partition - everything stored on the second one will be
unavailable
Apparently, the OP just wants to be able to access both partitions.
This is why he spoke about "drive creation", "diskpart", "assigning
letters", etc. In such case he works in totally wrong direction - the
problem has totally different solution
Anton Bassov
Don Burn wrote:
I took the original question to be two parts:
1. Get a list of USB drives - yes he will need SetupDiGetClassDevs
2. Get a list of USB drives with drive letters - my technique will
do this. The challenge is what he really wants to do with the subset that
is in 1 but not 2
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply
"anton bassov" <soviet_bloke@xxxxxxxxxxx> wrote in message
news:1154847749.268992.120680@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Don
I am afraid the OP would not get enough with that - it looks like he
wants logical drive to PDO mapping. I just wonder why......
It can be done in the kernel mode(in fact, a bit convoluted way, but
still). However, I am not sure there is any user-mode solution
Anton Bassov
Don Burn wrote:
A simple approach to this is for this is to use
IOCTL_STORAGE_QUERY_PROPERTY
with
PropertyId = StorageDeviceProperty;
QueryType = PropertyStandardQuery;
This will return for a given drive you open the bus type, which will be
BusTypeUsb for the ones you are interested in.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply
"Paul" <fcrx@xxxxxxxxxxx> wrote in message
news:utpQa0etGHA.4116@xxxxxxxxxxxxxxxxxxxxxxx
Hay NG!
I have troubles with mapping USB-Devices. So I want to write a little
program which gets all installed USB-Device and all actually mapped
drives. I want to check if a USB-device is already mapped.
I get the devices with SetupDiGetClassDevs .... and the mapped drives
with GetLogicalDriveStrings.
How can I determine which device is which mapped drive ?
thx for your suggestions
Paul
.
- References:
- SetupDiGetClassDevs
- From: Paul
- Re: SetupDiGetClassDevs
- From: Don Burn
- Re: SetupDiGetClassDevs
- From: anton bassov
- Re: SetupDiGetClassDevs
- From: Don Burn
- SetupDiGetClassDevs
- Prev by Date: Re: BUG Check Code:0x05 INVALID_PROCESS_ATTACH_ATTEMPT
- Next by Date: Plz help me to correct my code to send E-mail as NT service .
- Previous by thread: Re: SetupDiGetClassDevs
- Next by thread: watching folders for system event, or informing a service that an event has happened
- Index(es):
Relevant Pages
|