Re: Identifying FriendlyName of USB COM port




<alanglloyd@xxxxxxx> wrote in message
news:a88d6574-a36f-4a64-ad77-53b6404d7d38@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 9 Mar, 08:38, "Paul E. Schoen" <pst...@xxxxxxxxx> wrote:
<snip>
� S := 'SYSTEM\CurrentControlSet\Enum\USB';
� S := S + '\Vid_04d8&Pid_fdcf\0123456789';
<snip>

I don't get a "FriendlyName" value until I go into another enumeration
hive (USBSTOR) . . .

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR
\Disk&Ven_&Prod_USB_DISK_25X&Rev_PMAP\07540E18005D&0]
<snip>
"FriendlyName"="USB DISK 25X USB Device"

The values I get for a USB/Vid etc you use are . . .

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB
\Vid_0b27&Pid_0601\0000000000319E]
"DeviceDesc"="USB Mass Storage Device"
"LocationInformation"="USB Mass Storage Device"
"Capabilities"
"UINumber"
"HardwareID
"CompatibleIDs"
"ClassGUID"
"Class"="USB"
"Driver"
"Mfg"="Compatible USB storage device"
"Service"="USBSTOR"
"ConfigFlags"

I am running Windows XP Pro SP 2.

Also I'd throw a try/finally resource protection for Reg.

======================================================================

Should the try/finally start with Reg := TRegistry.Create; and the finally
section free everything? Does Free need to check for a "nil" value first?
And I probably should set the pointer to nil after free. D4 does not have
FreeAndNil.

I just used RegEdit and I have many entries under USB. In fact, probably
every device that has ever been enumerated. It appears that some devices,
such as your mass storage device, are further descibed in a separate
USBSTOR hive, as defined by "Service". There are also entries under
USBPRINT, but those do not have friendly names.

I'm running XP Home, and I think it's SP3. I'm trying to get my application
to work also on my laptop which has Vista Business. So far the main
problems seem to be due to folder and file virtual stores which is related
to user file permissions, but that's another story.

Thanks,

Paul


.



Relevant Pages

  • Re: an enum and ntoh question
    ... Jordan Abel wrote: ... snip ... ... What if there are more than INT_MAX+1 items in the enumeration? ... the enum definition statement. ...
    (comp.lang.c)
  • Re: Current JSON Proposal in ES4
    ... [snip about IE for-in enumeration bug] ... [snip about object enumeration is a bad idea] ... [snip about object serialization should not be an object property] ...
    (comp.lang.javascript)
  • Re: How to get SanDisk - Cruzer Mini USB Stick working
    ... Oh, and with these entries, my Sony camera can't be accessed. ... I grabbed an rpm from somewhere ...
    (Fedora)
  • Re: composite key question
    ... >why you state that "the index associated with the primary key ... someone named "Jansen" lives, you'd quickly find the "J" entries, skip to ... the street name of this entry. ...
    (microsoft.public.sqlserver.programming)
  • Re: Current JSON Proposal in ES4
    ... [snip about propertyIsEnumerable bug] ... [snip about IE for-in enumeration bug] ... [snip about object enumeration is a bad idea] ... Your recommendations for ES3 to ES4 change have not been ...
    (comp.lang.javascript)

Loading