Don’t name your service “serial” (remember the name of the service does
not necessarily map 1:1 with the name of the binary). Change this
AddService = Serial, 0x00000002, Serial_Service_Inst,
Serial_EventLog_Inst
To
AddService = AmtSerial, 0x00000002, Serial_Service_Inst,
Serial_EventLog_Inst
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@Amtote.com
Sent: Thursday, May 10, 2007 12:20 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Multiple Monolithic Serial Drivers
Doron,
thanks for the reply. with renewed optimism i attacked the INF file
again and the system now appears to have the desired result - my driver
on COM1, standard ms driver on other com ports. however, i added a
custom IOCTL in the driver so an application can confirm that it is
installed and it seems to respond on all of the com ports. when i
remove my driver the new IOCTL returns an error as expected. also, the
driver install doesn’t really kick in until after a reboot, but the
device manager doesn’t request one?
for the time being i’m installing via the device manager, though i’d
like to do it programmatically eventually, which brings me to another
question - how can i make UpdateDriverForPlugAndPlayDevices() update a
driver for an existing port rather than adding a new one?
i’ve attached my INF file (slimmed down from msports.inf) for reference
in case the problem lies there - thanks again!
; AMTSERIAL.INF
; Copyright (c) 2007 AmTote International
[version]
LayoutFile=layout.inf
signature=“$CHICAGO$”
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%AMT%
DriverVer=05/10/2007,0.1.2605.0
[DestinationDirs]
DefaultDestDir = 11 ;LDID_SYS
ComPort.NT.Copy = 12 ;DIRID_DRIVERS
SerialEnumerator.NT.Copy=12 ;DIRID_DRIVERS
; Install class “Ports”
;----------------------------------------------------------
[ClassInstall]
AddReg=PortsClass.AddReg
[PortsClass.AddReg]
HKR,%PortsClassName%
[ClassInstall32.NT]
AddReg=PortsClass.NT.AddReg
[PortsClass.NT.AddReg]
HKR,%PortsClassName%
HKR,Icon,“-23”
HKR,Installer32,“MsPorts.Dll,PortsClassInstaller”
[ControlFlags]
ExcludeFromSelect=MF\EISA_HWP1C10_DEV0,MF\EISA_HWP1C10_DEV1
; Drivers
;----------------------------------------------------------
[Manufacturer]
%Std%=Std
[Std]
%*PNP0500.DeviceDesc% = ComPort, *PNP0500, *PNP0501 ; Communications
Port
; COM sections
;----------------------------------------------------------
[ComPort]
CopyFiles=ComPort.Copy
AddReg=ComPort.AddReg
LogConfig=c14,c1a,c23,c2a,c34,c3a,c43,c4a,caa
[ComPort.Copy]
serial.vxd
serialui.dll
[ComPort.AddReg]
HKR,PortSubClass,1,01
[ComPort.NT]
CopyFiles=ComPort.NT.Copy
AddReg=ComPort.AddReg, ComPort.NT.AddReg
LogConfig=c14,c1a,c23,c2a,c34,c3a,c43,c4a,caa
SyssetupPnPFlags = 1
[ComPort.NT.HW]
AddReg=ComPort.NT.HW.AddReg
[ComPort.NT.Copy]
amtserial.sys
serenum.sys
[ComPort.NT.AddReg]
HKR,EnumPropPages32,“MsPorts.dll,SerialPortPropPageProvider”
; Uncomment the following line if you want to override the advanced
dialog for
; your device. See msports.h for protoype of OverrideAdvancedFunction
; HKR,EnumAdvancedDialog,“yourdll.dll,OverrideAdvancedFunction”
[ComPort.NT.HW.AddReg]
HKR,“UpperFilters”,0x00010000,“serenum”
; The serial enumerator by itself, so that other INFs can install
serenum w/out amtserial.sys
; -------------------------------------------------------
[SerialEnumerator.NT]
CopyFiles=SerialEnumerator.NT.Copy
[SerialEnumerator.NT.Copy]
serenum.sys
;-------------- Service installation
; Port Driver (function driver for this device)
[ComPort.NT.Services]
AddService = Serial, 0x00000002, Serial_Service_Inst,
Serial_EventLog_Inst
AddService = Serenum,Serenum_Service_Inst
[MultiComPort.NT.Services]
AddService = Serial, 0x00000002, Serial_Service_Inst,
Serial_EventLog_Inst
AddService = Serenum,Serenum_Service_Inst
[SerialEnumerator.NT.Services]
AddService = Serenum,Serenum_Service_Inst
; -------------- Serial Port Driver install sections
[Serial_Service_Inst]
DisplayName = %Serial.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 1 ; SERVICE_SYSTEM_START (this driver may
do detection)
ErrorControl = 0 ; SERVICE_ERROR_IGNORE
ServiceBinary = %12%\amtserial.sys
LoadOrderGroup = Extended base
; -------------- Serenum Driver install section
[Serenum_Service_Inst]
DisplayName = %Serenum.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\serenum.sys
LoadOrderGroup = PNP Filter
[Serial_EventLog_Inst]
AddReg = Serial_EventLog_AddReg
[Serial_EventLog_AddReg]
HKR,EventMessageFile,0x00020000,“%%SystemRoot%%\System32\IoLogMsg.dll;%
%SystemRoot%%\System32\drivers\amtserial.sys”
HKR,TypesSupported,0x00010001,7
[*pnp0500.det]
AddReg=Ports.AddReg,DevMap.AddReg
; The following sections are COM port resource configs.
; Section name format means:
; Char 1 = c (COM port)
; Char 2 = I/O config: 1 (3f8), 2 (2f8), 3 (3e8), 4 (2e8), a (any)
; Char 3 = IRQ config: #, a (any)
[c14] ; COM1,IRQ4
ConfigPriority=HARDRECONFIG
IOConfig=3f8-3ff(3ff:
IRQConfig=S:4
[c1a] ; COM1, any IRQ
ConfigPriority=HARDRECONFIG
IOConfig=3f8-3ff(3ff:
IRQConfig=S:3,4,5,7,9,10,11,12,14,15
[c23] ; COM2, IRQ3
ConfigPriority=HARDRECONFIG
IOConfig=2f8-2ff(3ff:
IRQConfig=S:3
[c2a] ; COM2, any IRQ
ConfigPriority=HARDRECONFIG
IOConfig=2f8-2ff(3ff:
IRQConfig=S:3,4,5,7,9,10,11,12,14,15
[c34] ; COM3, IRQ4
ConfigPriority=HARDRECONFIG
IOConfig=3e8-3ef(3ff:
IRQConfig=S:4
[c3a] ; COM3, any IRQ
ConfigPriority=HARDRECONFIG
IOConfig=3e8-3ef(3ff:
IRQConfig=S:3,4,5,7,9,10,11,12,14,15
[c43] ; COM4, IRQ3
ConfigPriority=HARDRECONFIG
IOConfig=2e8-2ef(3ff:
IRQConfig=S:3,5
[c4a] ; COM4, any IRQ
ConfigPriority=HARDRECONFIG
IOConfig=2e8-2ef(3ff:
IRQConfig=S:3,4,5,7,9,10,11,12,14,15
[caa] ; Any base, any IRQ
ConfigPriority=HARDRECONFIG
IOConfig=8@100-ffff%fff8(3ff:
IRQConfig=S:3,4,5,7,9,10,11,12,14,15
; End COM port LogConfig sections
[ComPort.PosDup]
*PNP0500,*PNP0501
[ComPort.NT.PosDup]
*PNP0500,*PNP0501
[DevMap.AddReg]
HKLM,hardware\devicemap\serialcomm,COM1,COM1
HKLM,hardware\devicemap\serialcomm,COM2,COM2
; “NoDrv” section: We do not yet support these port devices.
;----------------------------------------------------------
[NoDrv]
; User readable strings
;----------------------------------------------------------
[Strings]
AMT = “Amtote”
Std = “(Standard port types)”
PortsClassName = “Ports (COM & LPT)”
*PNP0500.DeviceDesc = “Communications Port”
Serial.SVCDESC = “Serial port driver”
Serenum.SVCDESC = “Serenum Filter Driver”
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