Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 8  
05 Dec 17 11:48
Eugene Muzychenko
xxxxxx@muzychenko.net
Join Date: 09 Mar 2005
Posts To This List: 12
inf2cat 22.9.10: the tool does not expand a variable

Many years ago, I had built an INF file template for an audio KS driver that can be customized by changing the [Strings] section only. Resulting INF files are successfully installed in all Windows versions from XP to latest Win10. inf2cat from WDK 7600.16385.1 reports no errors in such files. But if I try to use inf2cat from latest WDKs (including WDK 10.0.15063), it fails: 22.9.10: %driverfile% in [devinst.drivermodules] is missing from [SourceDisksFiles] section in myproject\mydriver.inf; driver may not sign correctly until this is resolved. The same inf2cat behavior is observed on SysDev portal on driver signing submission. Related sections in the INF file: ================= [SourceDisksFiles.x86] %DriverFile% = 222, \x86 [SourceDisksFiles.amd64] %DriverFile% = 222, \x64 [DevInst.DriverModules] %DriverFile% ================= If I replace %DriverFile% with actual driver file name, new inf2cat show no errors. Obviously, new inf2cat does not expand string variables while checking source file sections. Where to report this inf2cat bug?
  Message 2 of 8  
05 Dec 17 13:41
Nathan Kidd
xxxxxx@spicycrypto.ca
Join Date: 12 Oct 2017
Posts To This List: 5
inf2cat 22.9.10: the tool does not expand a variable

On 05/12/17 11:47 AM, xxxxx@muzychenko.net wrote: > Many years ago, I had built an INF file template for an audio KS driver that can be customized by changing the [Strings] section only. Resulting INF files are successfully installed in all Windows versions from XP to latest Win10. inf2cat from WDK 7600.16385.1 reports no errors in such files. > > But if I try to use inf2cat from latest WDKs (including WDK 10.0.15063), it fails: Since it worked with the older inf2cat this seems unlikely, but you might double-check that all your line endings are consistently CRLF. Earlier this year I had trouble getting stampinf to expand macros and finally realized it doesn't grok LF. It squashed all lines to be part of the first line which was a comment, and macros are not replaced in comments. -Nathan
  Message 3 of 8  
06 Dec 17 04:18
Eugene Muzychenko
xxxxxx@muzychenko.net
Join Date: 09 Mar 2005
Posts To This List: 12
inf2cat 22.9.10: the tool does not expand a variable

>you might double-check that all your line endings are consistently CRLF. Thank you for the suggestion but all line endings in the file are really CR/LF (just checked to be sure). Moreover, there are empty lines before and after each of lines in my example. Even more, I had cross-tested it, replacing %DriverFile% with actual file name, running inf2cat, replacing file name with %DriverFile% back, and running inf2cat again.
  Message 4 of 8  
06 Dec 17 13:01
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11673
inf2cat 22.9.10: the tool does not expand a variable

xxxxx@muzychenko.net wrote: >> you might double-check that all your line endings are consistently CRLF. > Thank you for the suggestion but all line endings in the file are really CR/LF (just checked to be sure). Moreover, there are empty lines before and after each of lines in my example. Even more, I had cross-tested it, replacing %DriverFile% with actual file name, running inf2cat, replacing file name with %DriverFile% back, and running inf2cat again. No, there's no need to check anything else.  Remember, the complete source code for ChkInf is included in the WDK.  I just checked, and indeed it does not expand strings within a CopyFiles section. From the beginning of time ;), perhaps the biggest flaw in the INF world is that there has never been a definitive syntax description.  It's all just crap that has accreted over the decades without any consistency or centralized control.  The sections do not all follow the same rules, and there is no place that definitively states where %strings% are allowed and where they are not.  It's clearly not a general purpose macro language, so without rules, we just have to guess. Thus, the authors of ChkInf could argue that they are following the documentation, because the documentation does not state whether this is supposed to work or not.  The fact that the operating system DOES seem to expand strings suggests that ChkInf ought to do so as well. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 5 of 8  
06 Dec 17 14:12
Zac Lockard
xxxxxx@microsoft.com
Join Date: 25 May 2017
Posts To This List: 17
inf2cat 22.9.10: the tool does not expand a variable

This is part of the reason ChkInf was deprecated a few years ago 😝 It is probably the least reliable source of INF truth that MS released. However, InfVerif can be used as the de facto source of INF truth. It internally uses the OS INF parser, so it has no divergence at all. InfVerif will point out if there are any %string% tokens in the file that do not get replaced (and FYI, they will be replaced anywhere in the file as long as there is a match in [strings]). Also interesting, we re-wrote the INF parser in Win8, and it is *way* more consistent and coherent than it was before that point. You won't find the same sort of differences between how various things get handled any more. Unfortunately, inf2cat was implemented before the new parser, and works much more closely to how ChkInf works. We're working on switching inf2cat over. -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@probo.com Sent: Wednesday, December 6, 2017 10:00 AM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: Re: [ntdev] inf2cat 22.9.10: the tool does not expand a variable xxxxx@muzychenko.net wrote: >> you might double-check that all your line endings are consistently CRLF. > Thank you for the suggestion but all line endings in the file are really CR/LF (just checked to be sure). Moreover, there are empty lines before and after each of lines in my example. Even more, I had cross-tested it, replacing %DriverFile% with actual file name, running inf2cat, replacing file name with %DriverFile% back, and running inf2cat again. No, there's no need to check anything else.  Remember, the complete source code for ChkInf is included in the WDK.  I just checked, and indeed it does not expand strings within a CopyFiles section. From the beginning of time ;), perhaps the biggest flaw in the INF world is that there has never been a definitive syntax description.  It's all just crap that has accreted over the decades without any consistency or centralized control.  The sections do not all follow the same rules, and there is no place that definitively states where %strings% are allowed and where they are not.  It's clearly not a general purpose macro language, so without rules, we just have to guess. Thus, the authors of ChkInf could argue that they are following the documentation, because the documentation does not state whether this is supposed to work or not.  The fact that the operating system DOES seem to expand strings suggests that ChkInf ought to do so as well. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc. --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=02%7C01%7Czac.lockard%40microsoft.com%7C148 f981a7371474268c808d53cd3411a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636481 800386130199&sdata=IJ3il%2BSMQqfzGvA8Gd8lF6%2F%2B3md8zoly1bUs6wJDJjc%3D&reserved= 0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=02%7C01%7Czac.lockard%40microsoft.com%7C148f981a7371474268c808d53cd34 11a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636481800386130199&sdata=Gd0GbT7 3O56zxVSUMlYosFncZx86JxxhwiAVhqU92%2BM%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=02%7C01%7Czac.lockard%40microsoft.com%7C148 f981a7371474268c808d53cd3411a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636481 800386130199&sdata=FnhleoFV4kpKEGycfUNj9r8Q%2BeNG4u9Xq7upJlOFYkA%3D&reserved=0>
  Message 6 of 8  
06 Dec 17 21:34
Eugene Muzychenko
xxxxxx@muzychenko.net
Join Date: 09 Mar 2005
Posts To This List: 12
inf2cat 22.9.10: the tool does not expand a variable

The most significant problem for me is that latest inf2cat versions are used to check INF files on SysDev driver signing submission. It marks INF file that is fully compatible with all Windows versions from Win2000 to Win10 as invalid, so there is no way to get MS signature for a driver with such INF file.
  Message 7 of 8  
07 Dec 17 00:55
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11673
inf2cat 22.9.10: the tool does not expand a variable

On Dec 6, 2017, at 6:33 PM, xxxxx@muzychenko.net <xxxxx@lists.osr.com> = wrote: >=20 > The most significant problem for me is that latest inf2cat versions = are used to check INF files on SysDev driver signing submission. It = marks INF file that is fully compatible with all Windows versions from = Win2000 to Win10 as invalid, so there is no way to get MS signature for = a driver with such INF file.=20 Yes, we know, but it's easy to work around. A simple script to do the = macro substitution, and off you go. =E2=80=94=20 Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 8 of 8  
07 Dec 17 21:22
Eugene Muzychenko
xxxxxx@muzychenko.net
Join Date: 09 Mar 2005
Posts To This List: 12
inf2cat 22.9.10: the tool does not expand a variable

Of course, workaround is easy, but the aftertaste... :) Not only that MS forced me to submit each driver release to SysDev for signing, but cannot even process a valid INF file. :)
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 21:42.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license