When determining the XENFILT_EMULATED_OBJECT_TYPE, keep trying all
supplied HardwareIDs/CompatibleIDs until an exact match is made. If an
early match is made that is not a valid type, ignore the match and
continue checking for either "PCI" or "IDE".
This covers situations where XENFILTS's Parameters key contains stale
strings from previous (v8.x) versions, and fixes an upgrade failure when
upgrading v8.x to v9.x
Signed-off-by: Owen Smith <owen.smith@citrix.com>
[Re-structured]
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Type = XENFILT_EMULATED_OBJECT_TYPE_UNKNOWN;
Index = 0;
- for (;;) {
+ do {
ULONG Length;
PANSI_STRING Ansi;
NTSTATUS status;
Type = XENFILT_EMULATED_OBJECT_TYPE_IDE;
RegistryFreeSzValue(Ansi);
- break;
} else {
Trace("NO MATCH: %s\n", &Id[Index]);
}
Index += Length + 1;
- }
+ } while (Type == XENFILT_EMULATED_OBJECT_TYPE_UNKNOWN);
return Type;
}