Hi,
i’m currently developing a KMDF HID minidriver for the Nintendo Wii Remote. My HID minidriver replaces the HidBth minidriver for the HIDClass driver (I’m using the KMDF HID minidriver sample, where it is actually a filter driver and uses this “kmdfhidminidriver” to forward all requests).
So my problem is, when i power off the Wii Remote, the PnP-Manager won’t recognize the device is gone. Windows still thinks everything is fine and running. The only hint, that the device is gone is, that the L2CAP-Channel is closed and i get the L2CAP-Callback called with Indicator Code “RemoteDisconnect”.
My question is, how do i signal the PnP-Manager the device has disconnected? I tried using “WdfDeviceSetDeviceState” with “Removed” set to true. But then the Device Manager shows an driver error (Code 24). I would like to have a solution, where the device gets removed from the Device Manager without any error, like unplugging an USB device.
Additional information: i’m using WDK 8 and WDF 1.11; driver target systems are Win 7 and 8.