Prev: WdfUsbTargetDeviceSendControlTransferSynchronously from TimerExpired function causes access violation
Next: Does devcon.exe work at all?
From: DPM on 30 May 2007 07:39 I'm trying to use a call to: l = ComDBGetCurrentPortUsage( HComDB, bufBits, 256, CDB_REPORT_BITS, pMaxPortsReported ); to determine if a USB serial port device is plugged in. Before plugging in the device, the device manager reports that I have 2 COM ports and 2 printer ports. After plugging in the device it reports 3 COM ports and 2 printer ports. However, before plugging in the device, a call to ComDBGetCurrentPortUsage fills in the bit array with 05 00 00... and after the call it still returns 05 00 00... (for COM 1 and COM 3) How can I determine if the USB COM device has been plugged in and if it has, what number has been assigned to it? It returns these values even if I powered up with the device unplugged. The call to ComDBGetCurrentPortUsage is in a dll written in 'C++'. The call to the dll is from a routine written in Visual Basic. Thanks for your help -- Regards, Dean |