Device attach

R

Rob

Hi,
I am trying to dectect insertion/removal of devices under XP.
I read : http://www.codeproject.com/KB/system/HwDetect.aspx?display=PrintAll

Things like : DBT_DEVTYP_PORT are NOT received when I plugin my serial2USB
device (a CDC device, having the comport class GUID) Only device-interface
notifications are received.

The dbcc_classguid which is received in my DEV_BROADCAST_DEVICEINTERFACE is
a class-guid (I think), so it does not refer to a specific device. (when I
pugin my keyboard I get a HIDCLASS guid).

I need to know what type of device I plugin, and it's devicename (COM1:, or
KBD1:)
I tested a lot and did not succeed yet.
Nothing in the Device Management Functions seems to be able to get this
information. The classguid on it's own is too little info I think (2
keyboards would have the same CLASSGUID). What am I missing here ?

Greetings,
Rob.
 
R

Rob

Hi,
I found this : http://69.10.233.10/KB/cs/HardwareHelper.aspx
This article basically concludes that it's impossible to know which device
was added in a direct way, but you need to monitor the entire device-list for
changes.
I can hardly believe this :-( , this calls for an API extension IMHO.
The WinCE implementations is so simpel.....

But, accepting the above, let me simplify the question :

Suppose I have determined which device changed .
(I can get things like DEVDETAIL structure for it)
Where can I find the devicename ? (like COM1:)

In one sample I found the device is opened using a long string from
devdetail called "devicepath". But this looks quite differrent,It has PID and
VID and a GUID in it. Thats not what I'm looking for, just the short
devicename. (COM1,KBD1 etc)

Any suggestions ?
I need the INTERFACE_GUID (not the class_GUID) and the devicename.
note this will be written in C++.

Greetings,
Rob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top