Re: SetupDiGetClassDevs

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Re: Windows hogging up space
    ... - bad news - doesn't work that way with Windows XP. ... Drives are cheap. ... Is hibernate turned on and do you use that feature? ... You mean to change the size of the C partition? ...
    (microsoft.public.windowsxp.help_and_support)
  • RE: dd for windows and imaging a 40Gb drive
    ... dd for windows and imaging a 40Gb drive ... Imaging a disk to another disk: just be sure the target is empty -- dd ... Imaging a partition to another partition, ... to drives and partitions. ...
    (Security-Basics)
  • Re: Windows wont boot if any partition extends past 120 GB on 250 GB drive
    ... Neither would be able to change anything on the partition. ... "Creation of bootable restore media to restore to drives that can't be restored to from witin Windows" ... will dot pittenger1 at gmail dot com (use this address for large ...
    (microsoft.public.windowsxp.general)
  • Re: NTLDR File is missing Msg upon Windows startup
    ... The option to format with FAT and FAT32 are there. ... use Windows 98 SE Startup Diskette and also BootIt NG program from a Floppy ... It also has the ability to create Partition Images. ... Both Hard Drives, do not need to be partitioned the same, unless you ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Loaded SP2 now Im in a boot loop...Things to try.
    ... and missed that it would load XP on the highlighted partition. ... had windows install the driver off of the creative ... Windows only cares about windows getting on my drive.. ... then I will swap the drives.. ...
    (microsoft.public.windowsxp.general)