Closed DanyL closed 3 years ago
@DanyL merged with slightly different commit message.
This fix will read a fake dfu device when device's really state is recovery , in latest win10
@airwolf2026 What do you mean by "a fake dfu device"? does it have an ECID? If so, is it the correct one or just random data?
What APIs are you trying to use?
Please print the values of DevicePath
and DfuPath
and attach them here so we could try to debug it.
Also, given that before this commit device detection was completely broken on windows, I doubt its the root cause of the problem you are experiencing, its more likely to be an older, unrelated bug surfacing now when this works correctly.
Edit: just for the record - it has been tested more than a dozen times, repeatedly switching between recovery and dfu modes, both on bare metal and VM machines with fully updated (as of ~10 days ago) windows 10 build and latest iTunes drivers as well as through USB hubs.
@airwolf2026 What do you mean by "a fake dfu device"? does it have an ECID? If so, is it the correct one or just random data? What APIs are you trying to use? Please print the values of
DevicePath
andDfuPath
and attach them here so we could try to debug it.Also, given that before this commit device detection was completely broken on windows, I doubt its the root cause of the problem you are experiencing, its more likely to be an older, unrelated bug surfacing now when this works correctly.
Edit: just for the record - it has been tested more than a dozen times, repeatedly switching between recovery and dfu modes, both on bare metal and VM machines with fully updated (as of ~10 days ago) windows 10 build and latest iTunes drivers as well as through USB hubs.
I just want to restore a iPhone 12 pro max, but it failed in the last some step with the latest code .
Ok, i'll attach some logs ,and if I can reproduce this problem.
This fixes 2 issues preventing libirecovery from properly detecting devices on windows:
_irecv_event_handler
, the loop wheredevinfo->alive = 0;
is being set was mastaknly put under the inner loop, rather than the outer one. This caused libirecovery to constantly remove devices when not needed.DevicePath
is being parsed assumes the last entry would always be the correct one, however, in some odd cases (i.e using VM, hubs, etc) this would fail. The change I made here makes it enumerate the entries until it finds the correct one.