none
[Win8] I can't receive DBT_DEVICEREMOVECOMPLETE event for DBT_DEVTYP_PORT type.

    Question

  • I have some problems in windows 8 RP when a device removed.

    [Reproduce Step]

    1. Run application that can monitor PNP notification.

    2. Remove Device.

    3. The application can't receive DBT_DEVTYP_PORT type DBT_DEVICEREMOVECOMPLETE PNP event.

    This problem was not reproduced in windows 7 with the same application.

    P.S : The DBT_DEVTYP_PORT type DBT_DEVICEREMOVECOMPLETE PNP event occurred when disable device in the Device Manager manually.

    Does anyone knows about this?
    Friday, August 31, 2012 9:13 AM

Answers

  • this is a known change in windows 8. if you subscribe to change notifications on the device interface instead of the generic DBT_DEVTYP_PORT you can workaround this issue. Otherwise, please open an incident with Microsoft Product Support to see if this can be fixed

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, September 06, 2012 5:00 PM
    Owner

All replies

  • perhaps the device is in the surprise removed state because there is a handle opened against it.  if you want to know about a device being removed that you have an open handle against, register for file handle notifications.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, September 05, 2012 5:29 AM
    Owner
  • Thanks for reply.

    When I Reproduce this issue, I didn't open serial port of device.

    And I checked Serial port symbolic link(COM#) disappear with "WinObj", when remove device.

    I receive DBT_DEVTYP_DEVICEINTERFACE type event for the same device when remove device. (but can't receive DBT_DEVTYP_PORT type)

    2 things are interesting

    1. I receive DBT_DEVTYP_PORT and DBT_DEVTYP_DEVICEINTERFACE type event when plug-in the device.

    2. This situation ONLY occurs in Windows 8.

    Does Windows 8 change something about this?

    Thursday, September 06, 2012 6:53 AM
  • this is a known change in windows 8. if you subscribe to change notifications on the device interface instead of the generic DBT_DEVTYP_PORT you can workaround this issue. Otherwise, please open an incident with Microsoft Product Support to see if this can be fixed

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, September 06, 2012 5:00 PM
    Owner
  • "this is a known change in windows 8", is that mean to change in windows 8 on intention?

    if so, could you tell me why had been changed?

    description of "RegisterDeviceNotification" function.(link blow)

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa363431(v=vs.85).aspx

    In the "Remark" section.

    The DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE events are automatically broadcast to all top-level windows for port devices. Therefore, it is not necessary to call RegisterDeviceNotification for ports, and the function fails if the dbch_devicetype member isDBT_DEVTYP_PORT

    But DBT_DEVTYP_PORT type DBT_DEVICEREMOVECOMPLETE event is not automatically broadcast in windows 8. And this is a known change, right?

    Friday, September 07, 2012 1:47 AM
  • yes, this is a known regression.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, September 07, 2012 6:12 AM
    Owner