阅读:1352回复:1
求助,请教:
在DDK下有个关于端口读写的例子,其中只对一段端口进行操作,如:300h-303h(默认),现在我想把它对一段端口改为两段,如:
200h-20fh,300h-30fh,请问在DriverEntry中如何进行资源进行初始化及分配。 请各位高手指教。 |
|
|
沙发#
发布于:2002-04-17 21:51
呵呵,看看那个例子的inf文件吧,你可以找到答案的。
/////////////////////////// ;/*++ ; ;Copyright (c) 1990-2000 Microsoft Corporation All rights Reserved ; ;Module Name: ; ; Portio.INF ; ;Abstract: ; INF file for installing sample portio driver ; ;--*/ [Version] Signature=\"$WINDOWS NT$\" Class=Sample ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171} Provider=%MSFT% DriverVer=06/16/1999,5.00.2072 [DestinationDirs] DefaultDestDir = 12 ; ================= Class section ===================== [ClassInstall32] Addreg=SampleClassReg [SampleClassReg] HKR,,,0,%ClassName% HKR,,Icon,,-5 ; ================= Device Install section ===================== [Manufacturer] %MSFT%=MSFT [SourceDiskFiles] genport.sys=1 [SourceDiskNames] 1=\"Install disk\", [MSFT] ; DisplayName Section DeviceId ; ----------- ------- -------- %PortIO.DRVDESC%=PortIO_Inst,root\\portio [PortIO_Inst.NT] CopyFiles=PortIO.CopyFiles LogConfig=PortIO.LC0, PortIO.LC1 [PortIO.CopyFiles] genport.sys [PortIO_Inst.NT.Services] AddService=portio,0x00000002,PortIO_Service ;Uncomment following lines if your device can only work with factory default settings ;[PortIO.NT.FactDef] ;ConfigPriority=HARDRECONFIG ;IOConfig=300-303(3ff::) ; 10 bit decode ranging from 300 - 303 [PortIO.LC0] ConfigPriority=DESIRED IOConfig=300-303(3ff::) ; 10 bit decode ranging from 300 - 303 [PortIO.LC1] ConfigPriority=NORMAL IOConfig=4@300-3ff(3ff::) ; 4 ports starting anywhere between 300 and 3fc [PortIO_Service] DisplayName = %PortIO.SVCDESC% ServiceType = 1 ; SERVICE_KERNEL_DRIVER StartType = 3 ; SERVICE_DEMAND_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %12%\\genport.sys [Strings] MSFT = \"Microsoft\" ClassName = \"Sample Drivers\" PortIO.SVCDESC = \"Sample PortIO Service\" PortIO.DRVDESC = \"Sample PortIO Driver\" //////////////////////////////////////// |
|
|