Error: Preinstall is not a supported operation for driver type 1

Hello,

So, I am stumped by trying to get DPInst to deploy our kmdf driver. I am trying to install our non-PnP, non-power-managed, software only, kernel service using DPInst. We have a simple .inx file that currently only supports amd64. When I load our driver using DevCon, all is well and it works with our user mode application. When I try to load our driver using DPInst, I am getting two critical errors:

“Error: Preinstall is not a supported operation for driver type 1”
“Error: Could not get services associated with driver package.”

I suspect that I have an error in my .inx file. All of the files in the driver package have been properly signed with our Authenticode information. The following lists our files, the contents of our .inx file, and the DPInst log. I would really, really appreciate your comments and suggestions. :slight_smile:

Thank you,

Mike

***********************************************
***********************************************
********* Files in the Driver Package *********
***********************************************
***********************************************

xxxxdriver.cat
xxxxdriver.inf
xxxxdriver.sys
WdfCoInstaller01009.dll

***********************************************
***********************************************
*************** xxxxdriver.inx ****************
***********************************************
***********************************************

[Version]
Signature=“$WINDOWS NT$”
Class=System
ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318}
Provider=%ABOH%
; You may need to change this version in xxxxdriver.rc.
DriverVersion=03/03/2011,1.0.0.0
DriverPackageType=KernelService
CatalogFile=xxxxdriver.cat

[DestinationDirs]
DefaultDestDir = 12

;*****************************************
; xxxxdriver Device Install Section
;*****************************************

[Manufacturer]
%AbohMfg%=Standard,NT$ARCH$

[Manufacturer]
%AbohMfg%= xxxxdriver_Model,NTamd64

[xxxxdriver_Model.NTamd64]
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device, {0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

; For Win2K
[Standard]
; DisplayName Section DeviceId
; ----------- ------- --------
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device, {0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

; For XP and later
[Standard.NT$ARCH$]
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device, {0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

[xxxxdriver_Device.NT]
CopyFiles=xxxxdriver_Device.NT.Copy

[xxxxdriver_Device.NT.Copy]
xxxxdriver.sys

;-------------- Service installation

[xxxxdriver_Device.NT.Services]
AddService = xxxxdriver, %SPSVCINST_ASSOCSERVICE%, xxxxdriver_Service_Inst

[xxxxdriver_Service_Inst]
DisplayName = %xxxxdriver.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\xxxxdriver.sys
LoadOrderGroup = Extended Base

[SourceDisksNames]
; diskid = description[, [tagfile] [, , subdir]]

[SourceDisksNames]
1 = %DiskId1%,“”

[SourceDisksNames.amd64]
1 = %DiskId1%,“”

[SourceDisksFiles]

[SourceDisksFiles.amd64]
xxxxdriver.cat = 1,
xxxxdriver.inf = 1,
xxxxdriver.sys = 1,
WdfCoInstaller01009.dll = 1,

[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ABOH = “A Bit of Help”
AbohMfg = “A Bit of Help, Inc.”
DiskId1 = “A Bit of Help’s Kernel Services Installation Disk #1
xxxxdriverDevice.DeviceDesc = “Kernel Services for ABOH”
xxxxdriver.SVCDESC = “A Bit of Help’s kernel services”



DPInst Log***


INFO: Option set: dumping log info to console.
INFO: Current working directory: ‘C:\PROJECTS\xxxx\DEPLOYMENT\DPInst\x64’
INFO: Running on path ‘C:\PROJECTS\xxxx\DEPLOYMENT\Drivers\x64’
INFO: No valid ‘dpinst.xml’ file provided.
INFO: Install option set: Force install if driver is not better.
INFO: Found driver package: ‘C:\PROJECTS\xxxx\DEPLOYMENT\Drivers\x64\xxxxdriver.inf’.
INFO: Preinstalling ‘c:\projects\xxxx\deployment\drivers\x64\xxxxdriver.inf’ .
INFO: ENTER: DriverPackagePreinstallW
ERROR: Preinstall is not a supported operation for driver type 1
INFO: RETURN: DriverPackagePreinstallW (0x1)
INFO: ENTER: DriverPackageGetPathW
INFO: No driver store entry for c:\projects\xxxx\deployment\drivers\x64\xxxxdr
iver.inf found. (Error code 0xE0000302.)
INFO: RETURN: DriverPackageGetPathW (0xE0000302)
INFO: ENTER: DriverPackageInstallW
INFO: xxxxdriver.inf: checking signature with catalog ‘c:\projects\xxxx\deploy
ment\drivers\x64\xxxxdriver.cat’ …
INFO: Driver package ‘xxxxdriver.inf’ is Authenticode signed.
INFO: Copied ‘xxxxdriver.inf’ to driver store…
INFO: Copied ‘xxxxdriver.cat’ to driver store…
INFO: Commiting queue…
INFO: Copied file: ‘c:\projects\xxxx\deployment\drivers\x64\xxxxdriver.sys’ ->
‘C:\Windows\system32\DRVSTORE\xxxxdriver_C80F8143490442D1335A8CC5F97E4CD64BFAA6
51\xxxxdriver.sys’.
ERROR: Could not get services associated with driver package.
ERROR: The driver installation failed. Attempting to undo system changes … (E
rror code 0x643: Fatal error during installation.)
INFO: Driver store reference information does not exist for service ‘’. So, no
undo for this service.
ERROR: Unable to revert to a previous driver store for service ‘’.
ERROR: Will attempt to uninstall the driver.
ERROR: Error unable to open service ‘’ to delete it because of error 0x7B
ERROR: Error occurred while deleting service to uninstall the driver store.
ERROR: Error encountered while uninstalling driver store.
ERROR: Error 0x643 encountered while trying to undo the install of driver store

INFO: Driver Store entry ‘’ removed.
INFO: RETURN: DriverPackageInstallW (0x643)
INFO: Returning with code 0x80010000

I’ve reviewed “DIFx Driver Package Requirements for Kernel Services Drivers” and we satisfy all of the requirements except that “DIFx tools also require that you include the following sections in the INF file: (1) DefaultInstall; (2) DefaultInstall.Service; …” We don’t have these two sections… Could this be the reason that DPInst is failing?

xxxxx@a-bit-of-help.com wrote:

So, I am stumped by trying to get DPInst to deploy our kmdf driver. I am trying to install our non-PnP, non-power-managed, software only, kernel service using DPInst. We have a simple .inx file that currently only supports amd64.

That’s not quite true. You left in the NT%ARCH% sections in the inx,
which means it will generate inf files for each of the architectures.
If you only need one architecture, you don’t need to go through the
inx->inf step.

You said this was a non-PnP driver, and DriverPackageType=KernelService
implies that, but that’s not true. You have a plug-and-play identifier
here:

%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device, {0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

Such a driver will only be loaded when a PDO is created for that PnP ID,
and that will be a PnP driver. If you truly have a legacy non-PnP
service driver, then you don’t need an INF file at all, and you
certainly don’t want to associate yourself with a PnP ID. Indeed,
there’s no point in having an INF file for a legacy driver, since Device
Manager will never go searching for you.

You said it worked with “devcon”. I’m guessing you did “devcon
install”. That pre-installs a plug-and-play driver package, and then
creates a fake device with that identifier. Is that what you wanted?
That can be made to work, but it’s different from what you described.

Do you expect this to be loaded via that device ID GUID (in which case
it is a PnP driver), or do you expect this to be loaded via the Service
Control Manager (i.e., “net start”)?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim,

Thank you very much for taking the time to review my posting. Unfortunately, the DDK examples and docs do not give examples for creating a INX/INF for a kmdf, non-pnp, non-power-managed, kernel service, so I have been trying to create a correct one through studying docs and scouring the Net. Basically, I started with a kmdf, pnp driver and have been adjusting it for our needs.

DIFx Driver Package Requirements say that we must have an INF including a Version, DefaultInstall, DefaultInstall.Services sections. Additionally, our driver uses WdfCollection, so we have to install the coinstaller. So, it seems that we need to have some form of INF file. I just need to figure out what goes into it! I'd appreciate your help to beat mine into shape.

So, you've said that I should remove the items in the following REMOVE section since they only apply to PNP drivers. I think that I will need to change the following items to their corresponding DefaultInstall and DefaultInstall.Service items. Right?


[xxxxdriver_Device.NT]
CopyFiles=xxxxdriver_Device.NT.Copy

[xxxxdriver_Device.NT.Copy]
xxxxdriver.sys

[xxxxdriver_Device.NT.Services]
AddService = xxxxdriver, %SPSVCINST_ASSOCSERVICE%, xxxxdriver_Service_Inst

[xxxxdriver_Service_Inst]
DisplayName = %xxxxdriver.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\xxxxdriver.sys
LoadOrderGroup = Extended Base

------------------------ REMOVE -------------------------------------------------
[Manufacturer]
%AbohMfg%=Standard,NT$ARCH$

[Manufacturer]
%AbohMfg%= xxxxdriver_Model,NTamd64

[xxxxdriver_Model.NTamd64]
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device,
{0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

; For Win2K
[Standard]
; DisplayName Section DeviceId
; ----------- ------- --------
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device,
{0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

; For XP and later
[Standard.NT$ARCH$]
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device,
{0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

xxxxx@a-bit-of-help.com wrote:

Thank you very much for taking the time to review my posting. Unfortunately, the DDK examples and docs do not give examples for creating a INX/INF for a kmdf, non-pnp, non-power-managed, kernel service, so I have been trying to create a correct one through studying docs and scouring the Net. Basically, I started with a kmdf, pnp driver and have been adjusting it for our needs.

DIFx Driver Package Requirements say that we must have an INF including a Version, DefaultInstall, DefaultInstall.Services sections. Additionally, our driver uses WdfCollection, so we have to install the coinstaller. So, it seems that we need to have some form of INF file. I just need to figure out what goes into it! I’d appreciate your help to beat mine into shape.

You don’t need an INF file for a legacy, non-PnP driver, nor do you need
DIFx. You just have your installer app (or batch file!) copy the driver
file into place, use the service manager (or the “sc” command) to create
the Services entry, and off you go. You CAN do all of that with an INF
file that has a [DefaultInstall] section, but that’s not a “real” INF
file. It’s a shortcut for a software installer.

So, you’ve said that I should remove the items in the following REMOVE section since they only apply to PNP drivers. I think that I will need to change the following items to their corresponding DefaultInstall and DefaultInstall.Service items. Right?

Yes, it’s little more than this:

[Version]

[DestinationDirs]
DefaultDestDir = 12

[DefaultInstall]
OptionDesc = %xxxxdriver.SVCDESC%
CopyFiles = @xxxxdriver.sys

[DefaultInstall.Services]
AddService = xxxxdriver, %SPSVCINST_ASSOCSERVICE%,
xxxdriver_Service_Inst

[xxxxdriver_Service_Inst]
…etc…

DPInst is still not going to handle this. You would install it via:

rundll32 setupdi,InstallHinfSection DefaultInstall 132 xxx.inf

And by the time you’ve done that, you might as well have written a
50-line installer application, or a 2-line batch file:

copy xxxxdriver.sys %WINDIR%\system32\drivers
sc create xxxxdriver type= kernel start= demand binPath=
system32\drivers\xxxxdriver.sys

It has the exact same effect.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

For a nonpnp kmdf driver you need an inf file and an install program to
install the driver. The nonpnp sample includes a sample inf file and a
sample install program. The inf DefaultInstall will not install the kmdf
stuff.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@a-bit-of-help.com
Sent: Friday, March 04, 2011 3:42 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Error: Preinstall is not a supported operation for
driver type 1

Hi Tim,

Thank you very much for taking the time to review my posting.
Unfortunately, the DDK examples and docs do not give examples for creating a
INX/INF for a kmdf, non-pnp, non-power-managed, kernel service, so I have
been trying to create a correct one through studying docs and scouring the
Net. Basically, I started with a kmdf, pnp driver and have been adjusting it
for our needs.

DIFx Driver Package Requirements say that we must have an INF including a
Version, DefaultInstall, DefaultInstall.Services sections. Additionally,
our driver uses WdfCollection, so we have to install the coinstaller. So,
it seems that we need to have some form of INF file. I just need to figure
out what goes into it! I'd appreciate your help to beat mine into shape.

So, you've said that I should remove the items in the following REMOVE
section since they only apply to PNP drivers. I think that I will need to
change the following items to their corresponding DefaultInstall and
DefaultInstall.Service items. Right?


[xxxxdriver_Device.NT]
CopyFiles=xxxxdriver_Device.NT.Copy

[xxxxdriver_Device.NT.Copy]
xxxxdriver.sys

[xxxxdriver_Device.NT.Services]
AddService = xxxxdriver, %SPSVCINST_ASSOCSERVICE%, xxxxdriver_Service_Inst

[xxxxdriver_Service_Inst]
DisplayName = %xxxxdriver.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\xxxxdriver.sys
LoadOrderGroup = Extended Base

------------------------ REMOVE

[Manufacturer]
%AbohMfg%=Standard,NT$ARCH$

[Manufacturer]
%AbohMfg%= xxxxdriver_Model,NTamd64

[xxxxdriver_Model.NTamd64]
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device,
{0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

; For Win2K
[Standard]
; DisplayName Section DeviceId
; ----------- ------- --------
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device,
{0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver

; For XP and later
[Standard.NT$ARCH$]
%xxxxdriverDevice.DeviceDesc%=xxxxdriver_Device,
{0A8AXXXX-138C-4ABD-XXXX-9CE52047XXXX}\xxxxdriver


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:

To unsubscribe, visit the List Server section of OSR Online at

Bill Wandel wrote:

For a nonpnp kmdf driver you need an inf file and an install program to
install the driver. The nonpnp sample includes a sample inf file and a
sample install program. The inf DefaultInstall will not install the kmdf
stuff.

Excellent point – I got so wrapped up in righteous indignation that I
lost track of this point.

The “nonpnp” sample is in src\general\ioctl\kmdf. The INF file in there
is really just a fake to satisfy the KMDF coinstaller. When I wrote an
installer for a KMDF non-PnP driver, I just generated the INF file on
the fly and erased it immediately thereafter.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Bill & Tim,

Thank you for clarifying things! As Tim expected, after making the changes that I mentioned, our INF file is working and our user mode application can access it. WooHoo! I still need to add multiple platforms and compare my INF to the one that you’ve mentioned, but at least we are much closer to our final version! I will post our final INF so it may help someone in the future, but here is our current version that is basically working:

[Version]
Signature=“$WINDOWS NT$”
Class=System
ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318}
Provider=%ABOH%
; You may need to change this version in xxxxdriver.rc.
DriverVersion=03/03/2011,1.0.0.0
DriverPackageType=KernelService
CatalogFile=xxxxdriver.cat

[DestinationDirs]
DefaultDestDir = 12

;*****************************************
; xxxxdriver Device Install Section
;*****************************************

[Manufacturer]
%XxxxMfg%=Standard,NT$ARCH$

; ------------- Default installation
[DefaultInstall]
CopyFiles=xxxxdriver_Device.NT.Copy

[xxxxdriver_Device.NT.Copy]
xxxxdriver.sys

[DefaultInstall.Services]
AddService = xxxxdriver, %SPSVCINST_ASSOCSERVICE%, xxxxdriver_Service_Inst

;-------------- Service installation
[xxxxdriver_Service_Inst]
DisplayName = %xxxxdriver.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\xxxxdriver.sys
LoadOrderGroup = Extended Base

In the end, this driver will be installed as part of an InstallShield installation of our user mode application. I just built a quickie device driver installer using IS, and it installed successfully. I still am going to incorporate Tim’s tweaks and have it target multiple platforms. Can you see anything else in what I just posted that is outright wrong?

Thank you again for all your help! I really appreciate it!

Mike