System-Defined Driver Rank Constants
The following system-defined constants are defined in Setupapi.h. These constants can be used to extract or compare rank values in Windows Vista and later versions of Windows:
The value of this constant is the worst possible identifier-list-position score for any type of identifier match. An identifier-list-position score is always less than or equal to this constant. This constant can be used as a bitmask to extract only the identifier-list-position score from a driver rank. To extract an identifier-list-position score, perform a bitwise AND between the rank and DRIVER_HARDWAREID_RANK.
This bitmask can be used to determine whether a driver rank indicates that a driver is signed and whether the identifier-list-position score is the best possible score. To determine this, perform a bitwise AND between this bitmask and a driver rank, and if the result is zero, the driver is signed and the identifier-list-position score is the best possible score. Otherwise, either the driver is unsigned or the identifier-list-position score is not the best possible score. However, be aware that this test does not distinguish between identifier match types.
This bitmask can be used to determine whether a driver rank indicates that a driver is signed or unsigned. In addition, the rank of an unsigned driver is always equal or greater than this constant. To determine whether a driver is unsigned, perform a bitwise AND between this bitmask and the rank of the driver, and if the result is not zero, the driver is unsigned. Otherwise, the driver is signed.
This bitmask can be used to determine whether a driver rank indicates that the corresponding driver is unsigned and the driver is installed by an INF DDInstall section that has an .nt platform extension. If an INF DDInstall section does not have an .nt platform extension, the driver might be for Windows 95, Windows 98, or Windows Millennium Edition (Me).
To determine this, perform a bitwise AND between DRIVER_W9X_SUSPECT_RANK and a driver rank and, if the result is equal to DRIVER_W9X_SUSPECT_RANK, the driver is unsigned and the corresponding DDInstall section does not have an .nt extension.
For more information about the .nt extension, see Creating INF Files for Multiple Platforms and Operating Systems.
For more information about driver ranking, see How Windows Ranks Drivers.