阅读:2263回复:6
如何把一端口地址给一个KIoRange类对象?
我现在要在WDM程序里把起始地址为0x300-0x30f这段地址进行读写操作,我应该如何初始化?
定义了一个KIoRange m_IoPortRang0; 是不是用KIoRange m_IoPortRang0.Initialize()函数进行初始化; 请教我该如何定义Initialize()函数的各个参数来达到我的目的! |
|
沙发#
发布于:2002-08-02 17:26
在OnStartDevice函数中:
PCM_RESOURCE_LIST pResListRaw = I.AllocatedResources(); PCM_RESOURCE_LIST pResListTranslated = I.TranslatedResources(); m_IoPortRang0.Initialize( pResListRaw, pResListTranslated, 0, TRUE ); 端口地址应该在INF文件中指定。 |
|
|
板凳#
发布于:2004-03-21 22:41
在inf怎样指定呀,不明呀!
INF不是只用于安装驱动程序的吗? |
|
地板#
发布于:2004-03-22 10:49
我也不知道,是不是程序的路径什么的!
|
|
|
地下室#
发布于:2004-03-23 18:37
接着楼主的问题,我想问问:
假如我要初始化的不是一个端口,而是相连的八个i/o口,比如: 0x308~~~~~~0x30f 那么,我用:KIoRange m_IoPortRang0 ; 我声明的仅仅一个KioRange类型的实例,就可以把这八个口都初始化了么 ??是不是需要声明八个类似的KioRange类型的实例呢?比如:KioRange m_IoPortRang1 KioRange m_IoPortRang2 KioRange m_IoPortRang3 。。。。。。。。。。。。。。。。。 KioRange m_IoPortRang7 等等 |
|
5楼#
发布于:2004-03-24 12:01
这个我知道,不用!
|
|
6楼#
发布于:2004-03-24 13:01
;/*++
; ;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" |
|