阅读:2188回复:20
关于.INF 文件?
请问1。.INF文件可以完成哪些工作?
2。其中哪些内容是必须要得,那些是可选的呢? 3。那儿有关于该文件格式、关键词的详细解释文档? |
|
沙发#
发布于:2002-07-06 09:24
General INF File Format
An INF file is organized in several sections, which define information that Setup and the hardware detection process use to determine the resource needs of the hardware device, and to install software for that device. An INF file is organized by hardware, with each class of device described in its own section. Within each device section, the following general organization applies. [Version] section Contains a simple header that identifies the INF and the class of device this INF supports. [Manufacturer] and [Manufacturer Name] sections Lists all the individual manufacturers of the devices identified in this file and lists all the devices built by that manufacturer. These entries are displayed directly to the user and used to generate the appropriate registry entries. There must always be at least one manufacturer section. [Install] section Describes the device driver and physical attributes of the hardware device. It also identifies the names of all the [Install] sections that contain information and instructions for installing this device. [ClassInstall] section Defines a new class for this device. (Optional.) [Strings] section Defines all localizable strings used in the INF file. Each section contains one or more entries. The typical entry consists of a key and a value separated by an equal sign. Keys within a section do not have to be unique, but the order of keys may be significant depending on the purpose of the section. An INF file can include comments ― any string of text, up to the end of the line, that begin with a semicolon. A comment can start anywhere on a line. For example: Key=value ; comment For complete details about the syntax and use of statements in Windows 98 INF files, see the Microsoft Win32 Software Development Kit for Windows 98 and Windows NT. For more information about the content structure of Windows 98 INF files, see the Microsoft Windows 98 Driver Development Kit. |
|
板凳#
发布于:2002-07-06 09:31
看看DDK文档吧!
|
|
|
地板#
发布于:2002-07-06 09:33
There have enough info in MSDN
|
|
地下室#
发布于:2002-07-06 09:36
我开始在DDK文档中没找到,刚才却在MSDN中找到了!
Tom_lyd你说INF文件是不是每个驱动都必须有呀? |
|
5楼#
发布于:2002-07-06 09:51
不是,KMD就不采用INF来安装,相反,它需要采用SCM提供的API来安装。INF是WDM的安装驱动程序的方式,只有采用这种方式,才能真正地很好地支持动态装、卸载。
对于真正服务于硬件的驱动程序,一定要提供一个INF文件,并将其拷至Windows\\INF目录下,(98和2000不同)。 而其它的非WDM驱动程序,例如文件系统驱动程序,文件过滤驱动程序,都不需要INF文件。 |
|
|
6楼#
发布于:2002-07-06 09:58
那怎样安装呢?
我抄了《windows WDM设备驱动程序设计指南》中的Wdm1例子(内存共享的一个虚拟驱动),.SYS已经生成了,我不知怎样安装? |
|
7楼#
发布于:2002-07-06 10:43
那怎样安装呢? 如果inf文件已经有了的话. 在控制面板里,选添加新硬件......其它设备.......从软件盘安装.找到你的inf文件即可.... |
|
8楼#
发布于:2002-07-06 11:05
ok,
我等会写以下inf文件 |
|
9楼#
发布于:2002-07-06 14:32
xiaodog 我抄了inf文件,安装后设备管理中出现了一个大问号?这是怎么回事呀?
|
|
10楼#
发布于:2002-07-06 14:36
你可以直接拷贝,再修改.
抄过来,可能会出现很多笔误的.如关键字是否拼写正确. |
|
11楼#
发布于:2002-07-06 14:42
这是我拷贝的:
你说那些地方需要改呢? [Version] Signature=\"$Chicago$\" Class=Unknown Provider=%WDMBook% Driver=07/03/2002,1.0.0.0 [Manufacturer] %WDMBook% = WDM.Book [WDM.Book] %Wdm1%=Wdm1.Install, *wdmBook\\Wdm1 [DestinationDirs] Wdm1.Files.Driver=10,System32\\Drivers Wdm1.Files.Driver.NTx86=10,System32\\Drivers [SourceDisksNames] 1=\"Wdm1 build directory\",,, [SourceDisksFiles] Wdm1.sys=1,obj\\i386\\checked [SourceDisksFiles.x86] Wdm1.sys=1,objchk\\i386 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Windows 98 [Wdm1.Install] CopyFiles=Wdm1.Files.Driver AddReg=Wdm1.AddReg [Wdm1.AddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,wdm1.sys [Wdm1.Files.Driver] Wdm1.sys ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Windows 2000 [Wdm1.Install.NTx86] CopyFiles=Wdm1.Files.Driver.NTx86 [Wdm1.Files.Driver.NTx86] Wdm1.sys,,,%COPYFLG_NOSKIP% [Wdm1.Install.NTx86.Services] AddService = Wdm1, %SPSVCINST_ASSOCSERVICE%, Wdm1.Service [Wdm1.Service] DisplayName = %Wdm1.ServiceName% ServiceType = %SERVICE_KERNEL_DRIVER% StartType = %SERVICE_DEMAND_START% ErrorControl = %SERVICE_ERROR_NORMAL% ServiceBinary = %10%\\System32\\Drivers\\Wdm1.sys ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Strings [Strings] WDMBook=\"WDM Book\" Wdm1=\"WDM Book: Wdm1 Example, checked build\" Wdm1.ServiceName=\"WDM Book Wdm1 Driver\" SPSVCINST_ASSOCSERVICE=0x00000002 ; Driver service is associated with device being installed COPYFLG_NOSKIP=2 ; Do not allow user to skip file SERVICE_KERNEL_DRIVER=1 SERVICE_AUTO_START=2 SERVICE_DEMAND_START=3 SERVICE_ERROR_NORMAL=1 |
|
12楼#
发布于:2002-07-06 14:49
而且我直接装他的DebugPrint驱动时,说“指定的位置找不到硬件信息?这是怎么回事呀?
|
|
13楼#
发布于:2002-07-06 15:51
这是Chris cant写的书上的吧,有错误。
不知你是在2000还是在98下安装,这个错误记得我曾经看过贴子,你可以搜索一下。 |
|
|
14楼#
发布于:2002-07-08 09:03
我是在98下用的,怎么以搜索?可以帮一下吗?
|
|
15楼#
发布于:2002-07-08 09:37
在98下用的话,把2000的选项去掉好象就可以。你试试。
|
|
|
16楼#
发布于:2002-07-08 09:44
这是另一个INF文件,是我以前在98下写的,你可以参阅一下。
|
|
|
17楼#
发布于:2002-07-08 10:11
设备管理器中出现 \"问号“,这可能是什么原因呢? 是不是[Version]
Class=Unknown 的设备都会出现这个问号呢? 刚才我用nmake -a -386,结果虽然设备管理器也出现问号,但测试程序可以测试! |
|
18楼#
发布于:2002-07-08 10:28
能安装上可以用起来就可以了,其它的,自己慢慢研究。
|
|
|
19楼#
发布于:2002-07-08 10:29
能安装上可以用起来就可以了,其它的,自己慢慢研究。当然你要安装DebugPrint,肯定需要改动一些地方,不用说了吧!
|
|
|
上一页
下一页