Topic: programmatically determine if driver suitable for xp, 2000, vista, etc

Hi all,

How would a person or program know if an arbitrary driver was for XP, 2003, 2000, or Vista?

I know the INF "Signature=" needs to be $Windows NT$ or $Chicago$, and not $Windows 95$.  This puts it in the pool.  But for instance is a SCSI driver for Win2K and another for XP.  (D\M\L7 and D\M\L8)  I've compared INF files like those and there are very few differences, and nothing to key off from.

Which brings me to what I think.  There is a tool called Inf2Cat that makes the .CAT signature files for drivers.  http://msdn.microsoft.com/en-us/library/bb931742.aspx 

/os:WindowsVersionList
    Configures Inf2Cat to verify that a driver package INF file complies with the signing requirements for the Windows versions that are specified by WindowsVersionList.

So... I think embedded in the .CAT file are hints as to the suitability of a driver on a particular Windows OS.  Some drivers don't come with CAT files though.  Does anyone know how to inspect a .CAT file for this information?

Big picture...  When say XP installs a driver, it determines that one driver is better than another.  Is this (CAT file info) combined with a release date the determining factor?

Thanks!

Last edited by xend (2009-01-21 19:34:35)

Re: programmatically determine if driver suitable for xp, 2000, vista, etc

the algorithm used is not well documented... after the install you can look at the setupapi.log for clues.
HWID then signing then date is the basic format.
$Chicago$ means ALL
$Windows NT$ usually means any windows 5.x OS

Since most drivers are not well written you can't get a good answer, wink
this is primarily because many OEMs do not stick to established standards and
in fact they will often times will create conflicts with the chipset provided reference drivers.
L7 and L8 are a perfect example of the problem. 
This is either because of
1 their failure to understand the "big picture" or
2 perhaps they just don't care or
3 no one ever made them do it correctly - IE WHQL Doesn't reject drivers that they should have.
for the most part, signing is just a PITA because of so many very poorly written drivers.

We do our absolute best to keep signing on every single driver in the DriverPacks.
We want you to get the driver from us exactly as we found it on the providers server,
but the providers make it almost impossible for us.

The most desirable feature of the cat is...
if a file is altered signing will be broken and you know it has been altered...
(an md5 hash would be just as useful given the poor quality that is allowed currently wink)

PS The only truly important info (for matching a driver to hardware) is the HWID in the inf...
That is what decides if a driver is suitable or not. the rest is smoke and mirrors,
at least until the powers that be actually force them to write drivers correctly before signing is granted


As things stand right now CATs are good for petting if you are lonely wink


hope that helps big_smile

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: programmatically determine if driver suitable for xp, 2000, vista, etc

OverFlow, thanks for the info... I worried it would be something like that.  (I have a theory that driver writers are close relatives to chip designers.  The EE's I know at work have no pride in refactoring their perl code...  everything is a "one off" and on to the next thing.)

So, I can't trust the CAT file.  But I wonder if, say, 50% of the time it would give me clues -- because of that OS switch.

Does anyone know how to inspect a CAT?
I don't know the structure at all, or even if it is possible.
Raw you can see some text, but I didn't see the "signed for OS" sorts of strings.

Thanks!

Re: programmatically determine if driver suitable for xp, 2000, vista, etc

FORGET THE CAT!

EVERYTHING YOU NEED IS IN THE INF... got it?

you might as well ask if you can tell if the driver is suitable from an MD5 checksum...

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: programmatically determine if driver suitable for xp, 2000, vista, etc

(not to belabor the idea)

A person could ignore the CAT but run the tool.

Inf2Cat /driver:c:\exampledriver /os:XP_X86 /nocat

/nocat
    Configures Inf2Cat only to verify that the driver package complies with the signing requirements for the specified Windows versions, but not to generate a catalog files.

Wouldn't this be similar to Windows XP doing a check before it installs a driver that the user provides?

If Inf2Cat puked, you'd know it wasn't for XP.  If Inf2Cat was ok, you'd know you could try it.  smile  (not guaranteed it would work)

Or...  Maybe that's why some aren't signed (don't have cat)...  Drivers CAN'T pass, but work anyway and are the desired driver.

Re: programmatically determine if driver suitable for xp, 2000, vista, etc

IF a CAT is not signed by WHQL it is worthless. So createing a CAT is a waste of time.

if it says chicago or Windows NT you can try it anyway... no extra steps need be taken.

"Or...  Maybe that's why some aren't signed (don't have cat)...  Drivers CAN'T pass, but work anyway and are the desired driver"   YES! - now you have it

PS more info is in mr_smartepants post here http://forum.driverpacks.net/viewtopic. … 610#p27610

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.