See comment inline.
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of veera jothi
Sent: Wednesday, August 30, 2006 1:49 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Access to Memory mapped port
Hi Doron,
To install the driver with PNP I should make use of the INF driver. I am making use of the Kbfilter.inf file available in the ddk. I am using the same hardware ID used by the VGA driver. When I try to install my driver, the Finish wizard ends with the error.
The error displayed is “The wizard could not find a better match for your hardware than the software you currently have installed”.
I am using “Update Driver” in the device manager to install the driver. INF file is given below.
; kbfiltr.inf
;
; Installation inf for the Device that needs filtering adapter.
;
; (c) Copyright 1999 Microsoft
;
[Version]
Signature=“$Windows NT$”
Provider=%DDK_Ex%
ClassGUID={4D36E968-E325-11CE-BFC1-08002BE10318}
Class=Display
;CatalogFile=kbfiltr.cat
DriverVer=07/20/1999
[DestinationDirs]
DefaultDestDir = 12
;
; Driver information
;
[Manufacturer]
%DDK_Ex% = DDK_Ex.Mfg
[DDK_Ex.Mfg]
%DDK_Ex% = kbfiltr, pci\ven_1a03&dev_2000&subsys_20001a03&rev_00
;
; General installation section
;
[kbfiltr]
; perform port related actions from keyboard.inf
Include=Oem22.inf
Needs=AST
; Copy the driver over
CopyFiles=kbfiltr.CopyFiles
;
; File sections
;
[kbfiltr.CopyFiles]
devlower.sys
;
; Service Installation
;
[kbfiltr.Services]
AddService = kbfiltr, , kbfiltr_Service_Inst
; Install the port driver and mouclass from keyboard.inf
Include=oem22.inf
Needs=AST.Services
[kbfiltr_Service_Inst]
DisplayName = %kbfiltr.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 0 ; SERVICE_ERROR_IGNORE
;LoadOrderGroup = Keyboard Port
ServiceBinary = %12%\devlower.sys
[kbfiltr.HW]
; Add the device upper filter
AddReg = kbfiltr.HW.AddReg
; run the directives need by the port driver
Include=oem22.inf
Needs=AST.SoftwareSettings
[CG]
Are you sure the AST.SoftwareSettings is in the driver’s .HW section? It’s very unusual a miniport driver would put registry key in the .HW section since videoprt doesn’t have API to read data from that location. Miniport driver’s inf would put registry values in a special location( don’t recall where exactly it was), the display classinstaller will append an instance GUID to the path.
[kbfiltr.HW.AddReg]
HKR,“lowerFilters”,0x00010000,“kbfiltr”
;
; Source file information
;
; use [SourceDisksNames.x86] for x86 only installs
; use [SourceDisksNames.alpha] for alpha only installs
[SourceDisksNames]
1 = %DiskId1%,
[SourceDisksFiles]
devlower.sys = 1,
[Strings]
;
; Non-Localizable Strings
;
REG_SZ = 0x00000000
REG_MULTI_SZ = 0x00010000
REG_EXPAND_SZ = 0x00020000
REG_BINARY = 0x00000001
REG_DWORD = 0x00010001
SERVICEROOT = “System\CurrentControlSet\Services”
;
; Localizable Strings
;
DiskId1 = “DDK Example Installation Disk #1 (Keyboard)”
DDK_Ex = “DDK Example Device that needs filtering”
kbfiltr.SvcDesc=“Keyboard Filter Example”
Thanks and Regards,
Jothi.R
Doron Holan wrote:
You need to install your driver as an upper or lower filter with pnp. You will not explicitly open the device and attach to it, rather you AddDevice() routine will be called when you have properly setup your driver in the pnp stack…but it sounds like in case 1) you did just that. After you AddDevice() routine is called in case 1) and you have created your devobj and attached to the stack, break into the debugger (the command __debugbreak() in the code works well for this) and run !devstack with your newly created device object and send the output.
d
________________________________________
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of veera jothi
Sent: Tuesday, August 29, 2006 11:45 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Access to Memory mapped port
Hi All,
As Jake and Doron say, I have written a Filter driver.
1. Load my driver as lower filter driver. In this case I can attach my driver to the driver stack and I am able to read the Configuration space. But I couldnt access the allocated resource. My start device routine is never triggered. I tried to get the resource list using IoGetDeviceProperty(). But IoGetDeviceProperty() returns error telling my device object is not a valid device object.
2. Then I tried to load my driver as a upper filter driver. In this case, I am trying to load my filter driver over the VGA driver. I have the device name i.e \Device\Video3. Using ZwOpenFile, I am opening the device with FILE_READ_ATTRIBUTES as access parameter. But ZwOpenFile returns 0xC0000022( Access denied error status). To attach my filter driver i need the PDO. But the VGA driver does not permit me to get the PDO.
I am assigned to Read/Write to the BAR1 address register.
Can any one tell me which filter driver method(upper filter/ lower filter driver) should i follow?
Also in both the cases i am facing problem as specified above. Any one please suggest me how to come over the problem?
Thanks and Regards,
Jothi.R
veera jothi wrote:
Hi All,
I have a PCI card with VGA support and it comes with a VGA driver. The card has two Memory(BAR0 and BAR1) and one IO port. The resource allocation for the device is done by the VGA driver.
Now my work is to map the BAR1 address of the PCI device for performing basic Read/Write. Can any one tell me how to access the allocated resource(BAR1) for Read/Write operation to be performed?
Regards,
Jothi.R
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1?/min. — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Stay in the know. Pulse on the new Yahoo.com. Check it out. — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
________________________________
Do you Yahoo!?
Get on board. You’re invited http: to try the new Yahoo! Mail. — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</http:>