阅读:1583回复:10
紧急求救:关于PCI驱动开发中的INF文件问题,万分感谢!!!!!
小弟正在进行PCI驱动程序开发,但是遇到了一个十分棘手的问题,请教各位大虾.
我使用的工具是WIN2K DDK + VC6 + DriverStudio. 我的PCI卡参数如下: 1.CLASS = pcidrv(这是DriverStuio生成的) 2.VID=104C 3.DID=AC60 4.GUID = fd7f3006-34ec-4f9d-9022-e2ef80b46857 由于以上工具生成的INF文件需要修改,根据以上参数和要求我的INF文件如下: ;; Pcidrv.inf ;; ********* PLEASE READ *********** ;; The wizard cannot create exact INF files for all buses and device types. ;; You may have to make changes to this file in order to get your device to ;; install. In particular, hardware IDs and logical configurations require ;; intervention. ;; ;; The Win2K DDK documentation contains an excellent INF reference. ;--------- Version Section --------------------------------------------------- [Version] Signature=\"$Windows 95$\"(这里是否应该是Windows NT,我没有把握) Provider=%ProviderName% ; If device fits one of the standard classes, use the name and GUID here, ; otherwise create your own device class and GUID as this example shows. Class=pcidrv (我使用了DriverStudio生成的类) ClassGUID={fd7f3006-34ec-4f9d-9022-e2ef80b46857} ;--------- SourceDiskNames and SourceDiskFiles Section ----------------------- ; These sections identify source disks and files for installation. They are ; shown here as an example, but commented out. ;[SourceDisksNames] ;1 = \"Install Disk\",Disk1,, 1 = \"Install Disk\",pcidrv.sys,, ;[SourceDisksFiles] ;Pcidrv.sys = 1,, pcidrv.sys = 1,, ;--------- ClassInstall/ClassInstall32 Section ------------------------------- ; Not necessary if using a standard class ; 9X Style [ClassInstall] Addreg=Class_AddReg ; NT Style [ClassInstall32] Addreg=Class_AddReg [Class_AddReg] HKR,,,,%DeviceClassName% HKR,,Icon,,\"-18\" ;--------- DestinationDirs Section ------------------------------------------- [DestinationDirs] Pcidrv_Files_Driver = 10,System32\\Drivers ;--------- Manufacturer and Models Sections ---------------------------------- [Manufacturer] %MfgName%=Mfg0 [Mfg0] ; PCI hardware IDs use the form ; PCI\\VEN_aaaa&DEV_bbbb&SUBSYS_cccccccc&REV_dd ; %DeviceDesc%=Pcidrv_DDI, PCI\\VEN_104c&DEV_ac60&SUBSYS_00000000&REV_00 ;---------- DDInstall Sections ----------------------------------------------- ; --------- Windows 9X ----------------- ; Experimentation has shown that DDInstall root names greater than 19 characte rs ; cause problems in Windows 98 [Pcidrv_DDI] CopyFiles=Pcidrv_Files_Driver AddReg=Pcidrv_9X_AddReg [Pcidrv_9X_AddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,Pcidrv.sys HKR, \"Parameters\", \"BreakOnEntry\", 0x00010001, 0 ; --------- Windows NT ----------------- [Pcidrv_DDI.NT] CopyFiles=Pcidrv_Files_Driver AddReg=Pcidrv_NT_AddReg [Pcidrv_DDI.NT.Services] Addservice = Pcidrv, 0x00000002, Pcidrv_AddService [Pcidrv_AddService] DisplayName = %SvcDesc% ServiceType = 1 ; SERVICE_KERNEL_DRIVER StartType = 3 ; SERVICE_DEMAND_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %10%\\System32\\Drivers\\Pcidrv.sys [Pcidrv_NT_AddReg] HKLM, \"System\\CurrentControlSet\\Services\\Pcidrv\\Parameters\",\\ \"BreakOnEntry\", 0x00010001, 0 ; --------- Files (common) ------------- [Pcidrv_Files_Driver] Pcidrv.sys ;--------- Strings Section --------------------------------------------------- [Strings] ProviderName=\"Your Company Name here\" MfgName=\"Name of HW Manufacturer here\" DeviceDesc=\"Description of Device here\" DeviceClassName=\"pcidrv\" SvcDesc=\"Description of NT service here\" 但是,当我使用这个INF文件进行安装驱动程序的时候,却显示出\"指定位置不包含有关硬件 的信息\"! 为了这个问题郁闷了两三天了,请各位大虾帮帮小弟!!!!! 不胜感激!!!!!!!!!!1 |
|
|
沙发#
发布于:2003-09-12 01:17
change
%DeviceDesc%=Pcidrv_DDI, PCI\\VEN_104c&DEV_ac60&SUBSYS_00000000&REV_00 to %DeviceDesc%=Pcidrv_DDI, PCI\\VEN_104c&DEV_ac60 and try |
|
板凳#
发布于:2003-09-12 01:37
按照网友的建议改了INF文件,还是不行。
我使用的类class=pcidrv,是我自己通过工具定义的,我看到网友说,这种class=pcidrv(自定义的类),在98下可以,但是在WIN2K下是不允许的,请问在WIN2K下如何处理自己定义的类呢? 谢谢! |
|
|
地板#
发布于:2003-09-13 14:06
DS生成的INF文件其实可以直接安装了,你可以不用修改那个class name,直接用都行,只要你的VendorID和DeviceID对了的话,试试看看吧!
|
|
|
地下室#
发布于:2003-09-13 20:53
按照网友的建议改了INF文件,还是不行。 我以前也遇到过这种情况,也是象hong说的改了就好了 我用的是ds生成的inf文件,和你一样也是自己改的class,98、2k、xp下都很好用 |
|
|
5楼#
发布于:2003-09-15 21:38
你可以参看DDK帮助文档中有关INF文件一节的内容,里面有说明的。
你自己改了Class之后,要在注册表中相应的位置给出你所设的Class相同的键值的,我试过是可以的 |
|
6楼#
发布于:2003-09-18 16:26
你安装driver 的时候假如注册表里面没有你定义的DEVICECLASS 的话,OS当然不会认识你的类型了。所以在你的inf里面应当加一个节:
ADDINSTALL32,不晓得写对冒得,好久没有搞了。 |
|
|
7楼#
发布于:2003-09-19 10:05
你先把class改成unknown试一下看看。
搞定以后再试自定义class好了。 主要是vendorid和deviceid这两项啊。 |
|
|
8楼#
发布于:2003-09-19 12:09
yjhleaf 说得对,自定义的class必须注册。
查一下DDK吧(用classGUID搜一下就行)。 |
|
|
9楼#
发布于:2003-09-25 22:15
我来回答你的问题吧。我开发时遇到了你同样的问题。解决的办法是:将卡上的Vendor和DeviceId及Subclass等与注册表里的deviceclass标识一致就ok.
|
|
10楼#
发布于:2003-10-01 22:35
i have the same problem, you can solve this way:(win2k)
1. run Regedit.exe; 2. locate HKEY_LOCAL_MACHINE ->SYSTEM ->CONTROLSET001 ->Control ->Class 3. check the items below each class, if there is any one has registered PCI\\VEN_104c&DEV_ac60... or you can use search function to find this. 4. delete this. (or delete this class) 5. after this, you will be able to install that pci card with the new class you defined. |
|