Rémi Bernon (@rbernon) commented about dlls/dinput/tests/hotplug.c:
CloseHandle( stop_event ); UnregisterDeviceNotification( devnotify );
CM_Unregister_Notification( notify_ctx.hnotify );
devnotify = RegisterDeviceNotificationA( hwnd, &iface_filter_a, DEVICE_NOTIFY_ALL_INTERFACE_CLASSES ); ok( !!devnotify, "RegisterDeviceNotificationA failed, error %lu\n", GetLastError() ); while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE )) DispatchMessageW( &msg );
notify_ctx.device_change_all = TRUE;
notify_ctx.device_change_expect = 4;
notify_ctx.device_change_count = 0;
cm_iface_filter.Flags |= CM_NOTIFY_FILTER_FLAG_ALL_INTERFACE_CLASSES;
ret = CM_Register_Notification( &cm_iface_filter, ¬ify_ctx, cm_notify_callback, ¬ify_ctx.hnotify );
ok( !ret, "CM_Register_Notification failed, error %lu\n", ret );
This fails for me on Windows (10 64bit 21H1):
``` cfgmgr32:cfgmgr32:1fc8 done (0) in 0s 90B dinput:device8:1fd4 done (0) in 7s 1243B dinput:dinput:1ee8 done (0) in 0s 358B dinput:force_feedback:1d7c done (0) in 2s 860B dinput:hid:10cc done (0) in 12s 1164B hotplug.c:681: Test failed: CM_Register_Notification failed, error 31 hotplug.c:705: Test failed: WaitForSingleObject returned 0x102 hotplug.c:705: Test failed: WaitForSingleObject returned 0x102 hotplug.c:705: Test failed: WaitForSingleObject returned 0x102 hotplug.c:705: Test failed: WaitForSingleObject returned 0x102 hotplug.c:707: Test failed: 0 != 4 hotplug.c:346: Test failed: 4: got dbch_classguid {0ecef634-6ef0-472a-8085-5ad023ecbccd} hotplug.c:350: Test failed: 4: got dbcc_name L"\\?\SWD#PRINTENUM#{B66641B9-1634-4B9F-A8C4-BB414305EC0B}#{0ecef634-6ef0-472a-8085-5ad023ecbccd}" hotplug.c:357: Test failed: 4: got dbcc_name L"\\?\SWD#PRINTENUM#{B66641B9-1634-4B9F-A8C4-BB414305EC0B}#{0ecef634-6ef0-472a-8085-5ad023ecbccd}" hotplug.c:360: Test failed: 4: got wparam 0x8000 hotplug.c:403: Test failed: 0: got DeviceHandle.DataSize 4 hotplug.c:403: Test failed: 1: got DeviceHandle.DataSize 16 hotplug.c:403: Test failed: 2: got DeviceHandle.DataSize 46 hotplug.c:403: Test failed: 3: got DeviceHandle.DataSize 62 hotplug.c:460: Test failed: Unexpected CM_NOTIFY_ACTION 5 hotplug.c:750: Test failed: WaitForSingleObject returned 0x102 1f20:hotplug: 1524 tests executed (0 marked as todo, 0 as flaky, 16 failures), 0 skipped. dinput:hotplug:1f20 done (16) in 27s 2614B dinput:joystick8:1c50 done (0) in 6s 3465B ```