EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

I don't get DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE

Started by PeterStefanos March 22, 2012
Hello all,

I have been unsuccessfully trying to get DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE when listening to WM_DEVICECHANGE messages in Windows when I plug and unplug my USB device. The USB device has been made to look like a COM port and comes up as COM9 on my computer.

I have done the following:

1. Built a USB device (LPC2148 micro), used the LPCUSB USB stack
2. I have used the usbser.sys driver and a usbser.inf file that I modified for my requirements and it happily installs under Windows XP/7/7-64bit, although it isn't signed.
3. Wrote a simple application and registered for notification using RegisterDeviceNotification().
4. If I plug in a commercially available USB to serial device, I get the DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE message types successfully.

With my USB device, I have been only getting wParam = DBT_DEVNODES_CHANGED which is less than useful.

Can anyone tell me where I might have done wrong? I did this years ago and have reluctantly come back to try and solve it. I have seen posts in other news groups of developers having the same issues but no solution.

Could it be the way the driver was installed or is it some missing value in the one of the USB descriptors? We purchased a USB vendor id and I thought that this would fix it! It didn't...

Any help would be most appreciated.

Peter.

An Engineer's Guide to the LPC2100 Series

Hi

I have used the same windows driver file with my LPC2387 controller and it
does not show with my device. Also I have used a number of Serial to USBs
with vendor drivers but I have never come across such a device that shows
device removal. I don't think it is something CDC supports but then it is
only my guess.

On Fri, Mar 23, 2012 at 5:53 AM, PeterStefanos wrote:

> **
> Hello all,
>
> I have been unsuccessfully trying to get DBT_DEVICEARRIVAL and
> DBT_DEVICEREMOVECOMPLETE when listening to WM_DEVICECHANGE messages in
> Windows when I plug and unplug my USB device. The USB device has been made
> to look like a COM port and comes up as COM9 on my computer.
>
> I have done the following:
>
> 1. Built a USB device (LPC2148 micro), used the LPCUSB USB stack
> 2. I have used the usbser.sys driver and a usbser.inf file that I modified
> for my requirements and it happily installs under Windows XP/7/7-64bit,
> although it isn't signed.
> 3. Wrote a simple application and registered for notification using
> RegisterDeviceNotification().
> 4. If I plug in a commercially available USB to serial device, I get the
> DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE message types successfully.
>
> With my USB device, I have been only getting wParam = DBT_DEVNODES_CHANGED
> which is less than useful.
>
> Can anyone tell me where I might have done wrong? I did this years ago and
> have reluctantly come back to try and solve it. I have seen posts in other
> news groups of developers having the same issues but no solution.
>
> Could it be the way the driver was installed or is it some missing value
> in the one of the USB descriptors? We purchased a USB vendor id and I
> thought that this would fix it! It didn't...
>
> Any help would be most appreciated.
>
> Peter.
>
>
>

--
With Regards,
Nishant Agrawal



The 2024 Embedded Online Conference