使用WDK的ChkINF工具验证INF文件语法

Windows 使用 INF 文件安装驱动程序。WDK开发文档中有一些工具用于驱动程序开发过程中。下面来看一下ChkINF。

WDK文档的介绍如下;

ChkINF
The INF File Syntax Checker, or ChkINF, is a set of Perl scripts and support applications that verify the structure and syntax of setup information (INF) files for drivers that are designed for Microsoft Windows 2000 and later versions of Windows. ChkINF cannot verify INF files for drivers that are designed for Windows 98 or Windows Me.
INF文件语法检查器,是一个perl脚本和支持的应用程序的集合,用来验证为Win2000或以后的Windows版本设计的INF文件的结构和语法。不能用于Win98或WinMe。

ChkINF Components
ChkINF and its components reside in the Tools\chkinf subdirectory of the Windows Driver Kit (WDK). ChkINF can be executed on all supported 32-bit and 64-bit CPU platforms.
ChkINF 组件
ChkINF和它的组件位于WDK的Tools\chkinf目录。它可以在所有的32和64位平台上执行。

ChkINF consists of a variety of Perl scripts and support applications. The following table describes the main components of the ChkINF tool.
ChkINF由一系列Perl脚本和支持的应用程序组成。下面列出工具的主要组件。

ChkInf.bat tools\chkinf
  A script that parses command-line arguments and invokes parsing modules. 
  一个可接受命令行参数的脚本,用来调用分析模块;

ChkInf.htm tools\chkinf 
  A readme file for the ChkINF tool.    
  工具的readme。

ChkInf.pm tools\chkinf 
The main INF parsing module.  
主要的INF分析模块;    (这是perl脚本,后缀名为.pm,用来分析Inf文件)

ChkSD.exe tools\chkinf\i386 
A support application that is called by the parsing modules to validate any security descriptors that are specified within an INF file.
被分析模块调用来验证在一个INF文件中指定的安全描述符。

    这是INF文件的结构和语法验证工具;其语法如下,
    chkinf {INFFile [INFFile...] | Directory} [/L TextFile] [/B] [/LO] [/DC Options]

    下面来看一个例子;

chkinf c:\windows\inf\ntprint.inf /L y:\ntprint.txt /b

    验证c:\windows\inf目录下的ntprint.inf文件,结果输入到y盘tprint.txt文件;

用notepad++打开被验证的inf文件;

再打开验证结果,

来看一下;结果说,

Provider listed is Microsoft, but should be the organization who wrote this INF. 

    第8行Provider,这应该是厂家,给出了公司名,但是应该进一步说明是谁创建的这个INF文件;

 No Copyright information found;

    第0行,没有给出版权信息;

Unrecognized directive: DriverIsolation 

    第12行,不认识DriverIsolation指令;

Section [LOCALE.OEM] not referenced 

    第103行,此节未被引用;

其他的自己看吧; 先安装WDK才有;

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值