I've created a simple installation/removal program that uses the
various Setup() API routines to install my sample driver on both
Windows 2000 and 2003. Everything works fine under 2003 but when I
try to install it under 2000 I see the following error from the
setupapi.log:
Error 0xe000022d: The driver selected for this device does not support
Windows 2000.
Also, I see the following message from my WinDbg session:
A SCSI driver is not a Win NTdriver.
Thing is, a previous version of my installation program/INF file
worked fine and I don't want to use the older INF file (which was WAY
too complicated). I've found that I can remove the [ControlFlags]
section in my INF file and it WILL work under 2000. Alternatively if
I use the INSTALLFLAG_FORCE option when using
UpdateDriverForPlugAndPlayDevices() it also works. The INF file is
provided below.
I've compiled my test driver using the latest DDK, compiling under the
Windows 2000 checked build environment. I've also ran the INF file
against chkINF and it gives me warning messages about unreferenced
sections. They ARE valid -- I call them directly from my installation
program via SetupInstallFromInfSection().
Any thoughts or ideas?
Regards,
Bob
;
; mydriver.inf - version 5.01 (Windows 2000 and above only)
;
[Version]
Signature="$WINDOWS NT$"
Class=SCSIAdapter
ClassGuid={4D36E97B-E325-11CE-BFC1-08002BE10318}
Provider=%MY_PROVIDER%
CatalogFile=mydriver.cat
DriverVer=08/20/2003,39.10.30.00
[DestinationDirs]
DefaultDestDir = 12
MyInstallDriver_CopyFiles = 12
MyInstallLog_CopyFiles = 11
My.DelFiles = 12
[Manufacturer]
%MY_PROVIDER%=MyProvider
; Models section for Windows 2000
[MyProvider]
%VIRTUAL_BUS%=MyInstall,ROOT\MyVirtualAdapter
; ===============================================================
; Control Flags Section
; ===============================================================
[ControlFlags]
ExcludeFromSelect = *
; ===============================================================
; Install Section
; ===============================================================
[MyInstall]
DriverVer=08/20/2003,39.10.30.00
CopyFiles = MyInstallDriver_CopyFiles, MyInstallLog_CopyFiles
AddReg = MyInstallDriverAddReg
[MyInstallDriver_CopyFiles]
mydriver.sys
[MyInstallLog_CopyFiles]
myLogMsg.dll
[MyInstallDriverAddReg]
HKLM,
System\CurrentControlSet\Control\Class{4D36E97B-E325-11CE-BFC1-08002BE10318},
UpperFilters, %REG_MULTI_SZ_APPEND%, mydriver
; ===============================================================
; Service Install Section
; ===============================================================
[MyInstall.Services]
AddService = mydriver, %SPSVCINST_ASSOCSERVICE%, my_Service_Inst,
my_EventLog_Inst
[my_Service_Inst]
DisplayName = %VIRTUAL_BUS%
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = 0
ErrorControl = %SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\mydriver.sys
LoadOrderGroup = SystemBusExtender
AddReg = MyCommonSettings
[my_EventLog_Inst]
AddReg = my_EventLog_AddReg
[my_EventLog_AddReg]
HKR,,EventMessageFile,%REG_EXPAND_SZ%,"%%SystemRoot%%\System32\myLogMsg.dll"
HKR,,TypesSupported,%REG_DWORD%,7
[MyCommonSettings]
HKR,%PARAMETERS_PATH%,"DebugLevel",%REG_DWORD%,0x0
HKR,%PARAMETERS_PATH%,"ErrorLevel",%REG_DWORD%,0x3
; ===== O/S specific stuff =====
HKR,%PARAMETERS_PATH%,"PnPRootEnumerated",%REG_DWORD%,0x1
HKR,%PARAMETERS_PATH%,"ScanInterval",%REG_DWORD%,0x1
HKR,"Parameters\PnpInterface", "5", %REG_DWORD%, 0x1
HKR,,"ErrorControl",%REG_DWORD%,0x1
HKR,,"Tag",%REG_DWORD%,0x1
;
; Uninstall Section
;
[DefaultUninstall]
DelReg = MyUninstallDriverDelReg
DelFiles = My.DelFiles
[DefaultUninstall.Services]
DelService = mydriver
[MyUninstallDriverDelReg]
HKLM,
System\CurrentControlSet\Control\Class{4D36E97B-E325-11CE-BFC1-08002BE10318},
UpperFilters, %REG_MULTI_SZ_DELETE%, mydriver
[My.DelFiles]
mydriver.sys,,,1
;
; Source Disks Section
;
[SourceDisksNames]
1 = %MY_INSTALL_DISK%,,,""
[SourceDisksFiles]
mydriver.sys = 1,,
myLogMsg.dll = 1,,
;
; Strings Section
;
[Strings]
MY_PROVIDER = ""
PARAMETERS_PATH="Parameters"
MY_INSTALL_DISK="My Installation Disk"
REG_EXPAND_SZ=0x00020000
REG_DWORD=0x00010001
REG_MULTI_SZ_APPEND=0x00010008
REG_MULTI_SZ_DELETE=0x00018002
SERVICE_KERNEL_DRIVER = 0x01
SERVICE_ERROR_NORMAL = 0x01
SPSVCINST_ASSOCSERVICE=0x00000002
VIRTUAL_BUS="My Multi-Path Pseudo-Bus"