阅读:1521回复:6
入门级问题
windows2003
vc.net2003 windows ddk2003 driverstudio v3.2 我做了个usb驱动,inf如下: ; ; File Name: abc.inf ; Install information file for abc Driver ; ; Generated by C DriverWizard 3.2.0 (Build 2485) ; Requires DDK Only ; File created on 3/30/2005 ; ;--------- Version Section --------------------------------------------------- [Version] Signature=\"$WINDOWS NT$\" Class=abc ClassGUID={A7A8A4AC-2429-4053-8FC1-E556D8368045} Provider=%Provider% DriverVer=3/30/2005,1.00.0000 CatalogFile=abc.cat [ControlFlags] ; Pnp drivers should not be installable via non-PnP hardware dialogs ExcludeFromSelect = * ;--------- ClassInstall/ClassInstall32 Section ------------------------------- ; Not necessary if using a standard class ; 9X Style [ClassInstall] Addreg=abcClassAddReg ; NT Style [ClassInstall32] Addreg=abcClassAddReg [abcClassAddReg] ;reg-root,[subkey],[value-entry-name],[flags],[value] HKR,,,%REG_SZ%,%DeviceClassName% HKR,,Icon,,\"-18\" HKR,,DeviceCharacteristics,%REG_DWORD%,0x100 ; FILE_DEVICE_SECURE_OPEN HKR,,Security,,\"D:P(A;;GR;;;WD)(A;;GA;;;SY)(A;;GA;;;BA)\" ; generic read - everybody ; generic all access - system and admin ;--------- DestinationDirs Section ------------------------------------------- [DestinationDirs] DefaultDestDir = 10 abc_Files_Driver = 12 ;--------- SourceDiskNames and SourceDiskFiles Section ----------------------- ; These sections identify source disks and files for installation. [SourceDisksNames] 1 = %DiskId1%,,,\"\" [SourceDisksFiles] abc.sys = 1,, ;--------- Manufacturer and Models Sections ---------------------------------- [Manufacturer] %MfgName% = abc_Mfg [abc_Mfg] ; DisplayName Section DeviceId %abc_DeviceDesc%=abc_DDI, USB\\VID_10D6&PID_1000 ;---------- DDInstall Sections ----------------------------------------------- ; --------- Windows 98 ----------------- ; Experimentation has shown that DDInstall root names greater than 19 characters ; cause problems in Windows 98 [abc_DDI] CopyFiles=abc_Files_Driver AddReg=abc_9X_AddReg [abc_9X_AddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,abc.sys HKR,,Description,,%abc_DeviceDesc% ; --------- Windows NT ----------------- [abc_DDI.NT] CopyFiles=abc_Files_Driver [abc_DDI.NT.Services] Addservice = abc, %FLG_ADDREG_NOCLOBBER%, abc_Service ; --------- Service ---------------------- [abc_Service] DisplayName = %abc_SvcDesc% ServiceType = %SERVICE_KERNEL_DRIVER% StartType = %SERVICE_DEMAND_START% ErrorControl = %SERVICE_ERROR_NORMAL% ServiceBinary = %12%\\abc.sys LoadOrderGroup = Extended Base ; --------- Files ---------------------- [abc_Files_Driver] abc.sys,,,2 ;--------- Strings Section --------------------------------------------------- [Strings] Provider = \"hl\" MfgName = \"hl\" abc_DeviceDesc = \"abc Device\" DeviceClassName=\"Class for abc devices\" abc_SvcDesc = \"Driver for abc Device\" DiskId1 = \"abc Device Installation Disk #1\" REG_SZ = 0x00000000 REG_MULTI_SZ = 0x00010000 REG_EXPAND_SZ = 0x00020000 REG_BINARY = 0x00000001 REG_DWORD = 0x00010001 REG_NONE = 0x00020001 SERVICE_KERNEL_DRIVER = 0x00000001 SERVICE_FILE_SYSTEM_DRIVER = 0x00000002 SERVICE_ADAPTER = 0x00000004 SERVICE_RECOGNIZER_DRIVER = 0x00000008 SERVICE_BOOT_START = 0x0 SERVICE_SYSTEM_START = 0x1 SERVICE_AUTO_START = 0x2 SERVICE_DEMAND_START = 0x3 SERVICE_DISABLED = 0x4 SERVICE_ERROR_IGNORE = 0x00000000 SERVICE_ERROR_NORMAL = 0x00000001 SERVICE_ERROR_SEVERE = 0x00000002 SERVICE_ERROR_CRITICAL = 0x00000003 FLG_ADDREG_NOCLOBBER = 0x00000002 FLG_ADDREG_DELVAL = 0x00000004 FLG_ADDREG_APPEND = 0x00000008 FLG_ADDREG_KEYONLY = 0x00000010 FLG_ADDREG_OVERWRITEONLY = 0x00000020 FLG_ADDREG_64BITKEY = 0x00001000 FLG_ADDREG_KEYONLY_COMMON = 0x00002000 FLG_ADDREG_32BITKEY = 0x00004000 在添加新硬件时选择从软盘安装,定位到该inf所在文件夹点击确定后 系统出现短时停顿,好像是windows惊讶的看了看这个inf,心想是哪个不懂行的人居然做这样不入流的inf,然后不懈一顾的抛弃掉,不在下一个对话框中显示;或者windows是个好心肠,想尽一切办法希望能读懂但因为这个inf有着不可弥补的缺陷,最终他也无能为力... 请高手帮帮我,我刚开始学驱动编程。谢谢! |
|
|
沙发#
发布于:2005-03-31 17:11
你是驱动不能安装吗?请确保你的PID和VID是否正确
|
|
|
板凳#
发布于:2005-03-31 17:39
我的PID和VID是工程在创建时由DriverStudio3.2的DriverWizard检测到的,就是在工程建立时的step Navigation的第4部:Hardware Bus
中我选择Select physical device to load configuration and resource information from(设置物理设备去读结构和资源信息) 中选择的,应该没错吧? |
|
|
地板#
发布于:2005-03-31 18:12
我所指的windows不能识别是指在添加硬件时,在到了下面的对话框时
在型号和厂商中列表框中没有我的abc这个类型。 simple WDM Device 是我编译DriverStudio3.2中自带的hellowdm工程产生的驱动。 [编辑 - 3/31/05 by hanlei] |
|
|
地下室#
发布于:2005-03-31 18:13
1
|
|
|
5楼#
发布于:2005-03-31 18:14
怎样显示图片?
|
|
|
6楼#
发布于:2005-04-03 20:07
如果我将
ExcludeFromSelect = * 这句去掉,就能安装驱动了,但是一旦安完驱动,马上就蓝屏了. |
|
|