Windows treats the HardwareID list as a decending order of specialization
where the first entry is the most specific, and last entry is least
specific. This can lead to install issues when the newer driver has a
less-specific HardwareID, as the older ("more-specific") HardwareID is
used for the match. Reordering the HardwareID list, so that the newest
revision is first, will stop Windows selecting the wrong driver package
to install.
Signed-off-by: Owen Smith <owen.smith@citrix.com>
Re-factored slightly for code consistency.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
}
case BusQueryHardwareIDs:
case BusQueryCompatibleIDs: {
- ULONG Index;
+ LONG Index;
ULONG Length;
Type = REG_MULTI_SZ;
+ Index = ARRAYSIZE(PdoRevision) - 1;
+
Length = Id.MaximumLength;
- for (Index = 0; Index < ARRAYSIZE(PdoRevision); Index++) {
+ while (Index >= 0) {
PXENVIF_PDO_REVISION Revision = &PdoRevision[Index];
status = RtlStringCbPrintfW(Buffer,
Buffer++;
Length -= sizeof (WCHAR);
+
+ --Index;
}
status = RtlStringCbPrintfW(Buffer,