https://bugs.winehq.org/show_bug.cgi?id=51479
--- Comment #7 from Zebediah Figura z.figura12@gmail.com --- (In reply to Gcenx from comment #6)
This also affe(In reply to RĂ©mi Bernon from comment #5)
The problem is that the device get removed twice, once in each individual PDO IRP_MN_REMOVE_DEVICE, and then in the FDO IRP_MN_REMOVE_DEVICE, which again closes device from the device list. The PDO IRP_MN_REMOVE_DEVICE doesn't remove the entry from the list, so the devices are closed twice.
I think it didn't happen before the change because ntoskrnl was blocked on exit on hidclass device removal and was then killed after a bit, waiting forever for the hid reading thread to exit, and so didn't even tried to remove wineusb devices. Or something along those lines.
A patch to address this has been proposed (https://source.winehq.org/patches/data/210666), but rejected.
Strange it got rejected as that also resolved the issue on macOS.
Unfortunately the patch doesn't do the right thing in all cases; see https://www.winehq.org/pipermail/wine-devel/2021-August/191749.html. Also unfortunately I haven't gotten around to checking native behaviour yet.