Re: Identify attached devices to an usb hub by DriverStarter
DriverStarter
Fri Aug 12 11:28:33 CDT 2005
Good comments,
it seems more valid than just checking registries.
"Bill McKenzie" <bm01_REMOVE_@csr.com> wrote in message
news:ewdtRhjnFHA.3608@TK2MSFTNGP15.phx.gbl...
> You asked:
>
>>further more I have to know, which usb device is attached to which usb
>>hub
>
> This you can find just as the USBView DDK sample does.
>
> Further you asked:
>
>>and their assigned com ports
>>\\pc\usb_01\hub_02\device_01->(ComPort 05)
>> \device_02->(ComPort 02)
>> \device_03->(ComPort 03)
>> \device_04->(ComPort 04)
>
> And I am suggesting that you look at the hardware IDs of these COM ports
> and that will likely tell you what device they belong too.
>
> For instance, on my system I have a virtual COM port named COM6. I look
> at the device instance ID for COM6 in DeviceManager and it is
> BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}\7&C52E2AD&0&000000000000_00000002
>
> I can tell from this ID that this COM port was created by the bluetooth
> stack on my machine. Now in your case this ID may or may not lead you to
> which device your COM port is connected. At anyrate, you can probably
> look at devices by connection in device manager and see there what device
> it is connected to. Anything you can do in DeviceManager you can do in
> your own user-mode application. Check out the DDK Devcon sample as this
> is essentially a command-line version of DeviceManager with source.
>
> Did I miss something you were asking?
>
> Bill M.
>
> "DriverStarter" <driverstarter@newsgroup.nospam> wrote in message
> news:eWTb$JfnFHA.1464@TK2MSFTNGP14.phx.gbl...
>> That's a good detailed description.
>>
>>
>> The undocumented part is, how to find a COM ID that has a specified
>> device symbolic name.
>>
>>
>> "Bill McKenzie" <bm01_REMOVE_@csr.com> wrote in message
>> news:%23Y4i%23CenFHA.1468@TK2MSFTNGP12.phx.gbl...
>>> Ah, yes the COM port IDs are assigned dynamically by the class installer
>>> DLL msports.dll.
>>>
>>> You can probably use SetupDi calls to get the hardware IDs for these
>>> ports and see which bus enumerated them. This might give you the
>>> relationship you are looking for straight out. You can try looking at
>>> one of the ports in DeviceManager and seeing what the hardware IDs look
>>> like and see if they convey enough information for you. DeviceManager
>>> on XP SP2 has a details property page with hardware ID information. On
>>> previous OS versions you have to explicitly enable this property page
>>> from the registry. How this is done I don't recall exactly, but you can
>>> probably search this newsgroup and find out, I know it has been
>>> discussed before.
>>>
>>> Bill M.
>>>
>>> "DriverStarter" <driverstarter@newsgroup.nospam> wrote in message
>>> news:u6cwYjcnFHA.2904@tk2msftngp13.phx.gbl...
>>>> My ID means COM port ID Becker mentioned.
>>>>
>>>> That COM port ID is dynamically changed as USB devices plug in in
>>>> different orders. it's not depend on the device.
>>>>
>>>>
>>>> "Bill McKenzie" <bill_mckenzie@csr.com> wrote in message
>>>> news:uXDRSKcnFHA.3552@TK2MSFTNGP10.phx.gbl...
>>>>> You are wrong. You are not trying to set the ID, just read it right?
>>>>> Thus the SetupDi functions can help you with this. Follow Mark
>>>>> Roddy's advice and check out the UsbView sample in the DDK. This very
>>>>> likely already does exactly what you want with source to look at.
>>>>>
>>>>> Bill M.
>>>>>
>>>>> "DriverStarter" <driverstarter@newsgroup.nospam> wrote in message
>>>>> news:eLDe6bbnFHA.1464@TK2MSFTNGP14.phx.gbl...
>>>>>> to my understanding, That ID is from bus Pnp, nothing setupDixx can
>>>>>> do,
>>>>>>
>>>>>>
>>>>>> Correct me if I am wrong,
>>>>>>
>>>>>>
>>>>>> "heinz" <heinz_baer@my-deja.com> wrote in message
>>>>>> news:1123681545.214623.17550@f14g2000cwb.googlegroups.com...
>>>>>>>I think you can accomplish everything you are asking for using the
>>>>>>> setup api's (i.e. SetupDixxx functions).
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>