WDF build&install

I have more problems installing wdf drivers than actually writing them. I want to get a clear understanding of the build and installation. I’ve gotten it to work before but it was after so many guesses I lost track of what I did right and wrong

My target system is using an AMD 64 3200+.
I have 32 bit free versions of Windows 2000 and Windows XP installed.
I’m using the WDK 6000 to build my driver.

I think that I should be using the free x86 build environment with the free x86 coinstaller because I have a 32 bit operating system. Is that wrong? I’m also doing the build with the Windows XP free build environment. My install always fails without even loading the driver. The log files seem to suggest I’m using a wrong version of the conistaller.

What is the WUDFUpdate_01005.dll for?
Which coinstaller version should I use?
Which build environment can I use(IA-64, x64, x86, WindowsXP, 2000, Server 2003)?
I do a checked build for debugging, is that ok?
I’ve seen a wdf*.sys file, do I need to concern myself with that?
To start clean what files do I need to remove from my system?

*I’ve used the x86 Windows XP checked build to build a wdm driver that worked correctly on my system.

*I see errors like this in the 3 different log files:

Setup cannot continue because one or more prerequisites required to install Wdf01005 failed.

WdfCoInstaller: [09/27/2007 11:40.39.953] ArpEntryPresent wasn’t found so we will assume the package was removed: error(2) The system cannot find the file specified.

WdfCoInstaller: [09/27/2007 11:40.42.500] Update process returned error code :error(1603) Fatal error during installation.
. Possible causes are running free version of coinstaller on checked version of OS or vice versa. Look at the Kmdf documentation as to what steps need to be followed to install the correct versionof the coinstaller

E360 An unsigned or incorrectly signed file “e:\temp\amcc_wdf\siamccwdf.inf” for driver “amcc based SI-C31DSP” will be installed (Policy=Ignore). Error 0xe000022f: The third-party INF does not contain digital signature information.
#-166 Device install function: DIF_REGISTER_COINSTALLERS.
#I056 Coinstallers registered.
#-166 Device install function: DIF_INSTALLINTERFACES.
#-011 Installing section [SIamccWDF_Inst.NT.Interfaces] from “e:\temp\amcc_wdf\siamccwdf.inf”.
#I054 Interfaces installed.
#-166 Device install function: DIF_INSTALLDEVICE.
#E151 Coinstaller 1 of 1 failed. Error 1603: Fatal error during installation.

xxxxx@yahoo.com wrote:

I have more problems installing wdf drivers than actually writing them. I want to get a clear understanding of the build and installation. I’ve gotten it to work before but it was after so many guesses I lost track of what I did right and wrong

My target system is using an AMD 64 3200+.
I have 32 bit free versions of Windows 2000 and Windows XP installed.
I’m using the WDK 6000 to build my driver.

I think that I should be using the free x86 build environment with the free x86 coinstaller because I have a 32 bit operating system. Is that wrong?

That’s right. You can certainly use the checked build environment for
debugging, although you still use the free coinstaller.

What is the WUDFUpdate_01005.dll for?

It installs the necessary DLLs and registry entries for UMDF drivers.
If you have a KMDF driver, you don’t need it. Note that UMDF drivers do
not work in Windows 2000.

Which coinstaller version should I use?

1.5, free. 6000\redist\wdf\x86\WdfCoInstaller01005.dll. You can copy
the necessary INF entries from any of the samples.

Which build environment can I use(IA-64, x64, x86, WindowsXP, 2000, Server 2003)?

Depends on your needs, but for 32-bit drivers, I would expect XP.

I do a checked build for debugging, is that ok?

Yes, but REMEMBER: that doesn’t mean that you use the “checked” version
of the coinstaller!!! The “checked” coinstaller is only used if you
install the checked operating system, which most people do not do.

I’ve seen a wdf*.sys file, do I need to concern myself with that?

That’s the KMDF helper driver. That’s where all of those WdfXxxXxx APIs
are located.

To start clean what files do I need to remove from my system?

system32\WdfCoInstaller01005.dll, system32\drivers\wdf01000.sys,
system32\drivers\wdfldr.sys.


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

The checked coinstaller was a problem I encountered the first time around. That is the only thing I'm sure about now.

I deleted all of these files:
system32\WdfCoInstaller01005.dll,
system32\drivers\wdf01000.sys,
system32\drivers\wdfldr.sys.

I rebuilt my driver from VC++ 6.0 using ddkbuild.
My build uses -WXP for ddkbuild and I have WXPBASE set as E:\WINDDK\6000 which is the locaction of my WDK install.
checked, and -cZg build options are used.

The build reports no errors or warnings.
*As I mentioned before this works on WDM drivers and installs fine

I put my sys and inf files in a folder along with the 'free x86' dll on my debug machines desktop.
I point the hardware wizard to this folder.

I get the same error as always:
An error occurred during the installation of the device.
Fatal error during installation.

What could the problem be?
I had a very similar problem months ago but somehow got it working by swapping infs and dlls.
I think my inf file is ok. I modified a version that worked updating the device name and ID as well as the kmdf version number and wdfcointstaller numbers.
Where could the problem exist?
I see no evidence of the driver being loaded so I assume it is an inf or coinstaller problem.

My log files report the following:
WDF01005Inst.log reports:
5.563: FileInUse:: Added to Filelist: d:\windows\wdf01005.cat
5.563: FileInUse:: Added to Filelist: d:\windows\system32\drivers\wdfldr.sys
5.563: FileInUse:: Added to Filelist: d:\windows\system32\drivers\wdf01000.sys
5.766: FileInUse:: PrintTasksUsingModule: No tasks found using d:\windows\wdf01005.cat
5.766: FileInUse:: PrintTasksUsingModule: No tasks found using d:\windows\system32\drivers\wdfldr.sys
5.781: FileInUse:: PrintTasksUsingModule: No tasks found using d:\windows\system32\drivers\wdf01000.sys
6.781: LoadFileQueues: UpdSpGetSourceFileLocation for halaacpi.dll failed: 0xe0000102
6.844: Num Ticks for Backup : 1328
6.953: Num Ticks for creating uninst inf : 109
6.953: Registering Uninstall Program for -> Wdf01005, Wdf01005 , 0x0
6.953: Unable to get File Version
6.953: Failed to copy spupdsvc.exe to system32
6.969: DeRegistering the Uninstall Program -> Wdf01005, 0
6.969: Wdf01005 Setup canceled.
6.969: Update.exe extended error code = 0xf00d
6.969: Update.exe return code was masked to 0x643 for MSI custom action compliance.

SETUPACT.log reports:
WdfCoInstaller: [09/27/2007 14:15.43.468] DIF_INSTALLDEVICE: Pre-Processing

WdfCoInstaller: [09/27/2007 14:15.43.515] ReadComponents: WdfSection for Driver Service SIamccWDF using KMDF lib version Major 0x1, minor 0x5

WdfCoInstaller: [09/27/2007 14:15.44.171] VerifyMSRoot: exit: error(0) The operation completed successfully.

WdfCoInstaller: [09/27/2007 14:15.53.250] Update process returned error code :error(1603) Fatal error during installation.
. Possible causes are running free version of coinstaller on checked version of OS or vice versa. Look at the Kmdf documentation as to what steps need to be followed to install the correct versionof the coinstaller

SETUPACT.log reports:(Part of the lowest portion)
[2007/09/27 14:15:51 684.854 Driver Install]
#-019 Searching for hardware ID(s): usbstor\disksandisk_sansa_e260__________,usbstor\disksandisk_sansa_e260______,usbstor\disksandisk_,usbstor\sandisk_sansa_e260_______,sandisk_sansa_e260_______,usbstor\gendisk,gendisk
#-018 Searching for compatible ID(s): usbstor\disk,usbstor\raw
#-198 Command line processed: d:\e3e7b9723037ba439bf09a3c\update\update.exe /quiet
#I063 Selected driver installs from section [disk_install] in "d:\windows\inf\disk.inf".
#I320 Class GUID of device remains: {4D36E967-E325-11CE-BFC1-08002BE10318}.
#I060 Set selected driver.
#-147 Loading class installer module for "Disk drive".
#E360 An unsigned or incorrectly signed file "D:\WINDOWS\system32\StorProp.Dll" for driver "Disk drive" will be installed (Policy=Ignore). Error 0x800b0100: No signature was present in the subject.
#-148 Loading coinstaller modules for "Disk drive".
#E360 An unsigned or incorrectly signed file "D:\WINDOWS\system32\SysSetup.Dll" for driver "Disk drive" will be installed (Policy=Ignore). Error 0x800b0100: No signature was present in the subject.
#E360 An unsigned or incorrectly signed file "D:\WINDOWS\system32\SysSetup.Dll" for driver "Disk drive" will be installed (Policy=Ignore). Error 0x800b0100: No signature was present in the subject.
[2007/09/27 14:15:51 684.859 Driver Install]
#-019 Searching for hardware ID(s): v1394\nic1394
#-018 Searching for compatible ID(s): v1394\nic1394
#-198 Command line processed: d:\e3e7b9723037ba439bf09a3c\update\update.exe /quiet
#I063 Selected driver installs from section [nic1394.ndi] in "d:\windows\inf\net1394.inf".
#I320 Class GUID of device remains: {4D36E972-E325-11CE-BFC1-08002BE10318}.
#I060 Set selected driver.
#-147 Loading class installer module for "1394 Net Adapter".
#E360 An unsigned or incorrectly signed file "D:\WINDOWS\system32\NetCfgx.dll" for driver "1394 Net Adapter" will be installed (Policy=Ignore). Error 0x800b0100: No signature was present in the subject.
[2007/09/27 14:15:51 684.865 Driver Install]
#-019 Searching for hardware ID(s): {1a3e09be-1e45-494b-9174-d7385b45bbf5}\nvnet_dev00df
#-198 Command line processed: d:\e3e7b9723037ba439bf09a3c\update\update.exe /quiet
#I063 Selected driver installs from section [NVENET_XP.NDI] in "d:\windows\inf\oem3.inf".
#I320 Class GUID of device remains: {4D36E972-E325-11CE-BFC1-08002BE10318}.
#I060 Set selected driver.
#-147 Loading class installer module for "NVIDIA nForce Networking Controller".
#E360 An unsigned or incorrectly signed file "D:\WINDOWS\system32\NetCfgx.dll" for driver "NVIDIA nForce Networking Controller" will be installed (Policy=Ignore). Error 0x800b0100: No signature was present in the subject.
#-148 Loading coinstaller modules for "NVIDIA nForce Networking Controller".
#E360 An unsigned or incorrectly signed file "D:\WINDOWS\system32\fdco1.dll" for driver "NVIDIA nForce Networking Controller" will be installed (Policy=Ignore). Error 0x800b0100: No signature was present in the subject.
[2007/09/27 14:09:57 1640.2]
#-166 Device install function: DIF_INSTALLDEVICE.
#E151 Coinstaller 1 of 1 failed. Error 1603: Fatal error during installation.

I'm clueless on how to proceed or debug this.

What does setupapi.log report? The other thing you might try is to delete any registry entries for your device, in addition to the wdf files, assuming that nothing else needs them.

mm

The last entry was the setupapi. I accidentally typed setupact twice for two separate entries

I’ve tried to install the device on three different machines so I don’t think it is a registry problem. Each time the computer crashes(only the very first time) and after the reboot every additional attempt to reinstall reports an error and the driver never gets installed. It fails before loading the driver.

My bad. I also missed the part about the crash, which is significant. Yes indeed, installation is a lot of fun. It my opinion, it is hands down, no second place, both historically and presently the worst feature of Windows. In any case, a few questions:

  1. When you say that the system is crashing, is that occuring immediately on install, or during an install mandated reboot.

  2. Is it possible that it is getting installed the first time, something causes the crash, and the booting from last known good wipes it out, but leaves some files around, causing the trouble? You may have already covered this, but as I missed the part about crashing, I’m not sure. If so, my apologies.

  3. What is the actual driver on which you are working? The nVidia from above? If so, working on the theory that it is getting installed once, what is the ErrorControl set to?

  4. What does the blue screen look like (roughly, as I don’t imagine that you are looking to recreate it)? Is it something to do with unsigned drivers?

  5. Is “D:\WINDOWS\system32\fdco1.dll” your coinstaller? That’s what it reads like, if I read it correctly. What is it’s purpose?

I’m not sure how much help I can be on this one, but I’ll give it my best. Where is Doron when you need him?

Good luck,

mm

A couple of links you may already no about:

http://www.microsoft.com/whdc/Driver/tips/KMDF_install.mspx

http://www.microsoft.com/whdc/driver/install/setupapilog.mspx

Good luck,

mm

>Questions: 1. When you say that the system is crashing, is that occuring immediately on install, or >during an install mandated reboot.

The crash was immediately on install the first time and never again since.

  1. Is it possible that it is getting installed the first time, something causes the crash, and the booting >from last known good wipes it out, but leaves some files around, causing the trouble? You may have >aeady covered this, but as I missed the part about crashing, I’m not sure. If so, my apologies.

I believe I have been careful to clean up on several reinstall attempts with no crash.

  1. What is the actual driver on which you are working? The nVidia from above? If so, working on >the theory that it is getting installed once, what is the ErrorControl set to?

The driver is my own driver called siamccwdf. I have no idea how the ErrorControl is set so i would have to say it is the default setting.

  1. What does the blue screen look like (roughly, as I don’t imagine that you are looking to recreate >it)? Is it something to do with unsigned drivers?

I do not remember the blue screen details. Though, on the first installation attempt there was a warning message about the driver being unsigned. Just like the crash it did not appear on future install attempts

  1. Is “D:\WINDOWS\system32\fdco1.dll” your coinstaller? That’s what it reads like, if I read it >correctly. What is it’s purpose? I’m not sure how much help I can be on this one, but I’ll give it my >best. Where is Doron when you need him? Good luck, mm

The coinstaller is the wdfcoinstaller01005.dll. The one you mentioned is unrelated to my problem. I am using no other dlls. My driver is pretty simple at this point but it never appears to actually get installed. The failure appears before my sys file is installed as far as I can see. The setupapi.log file is very lengthy and cryptic to me at this point. The initial crash that is never repeated is strange too.

I have seen those links but have not explored them thoroughly. I will revisit them. It appears similar to info in my WDF book but nothing has been fruitful yet.

Thanks

I think you certainly need to address the initial crash before worrying about the rest of this. Do you have a kernel debugger connected? It doesn’t sound like it. If not, this is the place to start. It will help you figure out why you are crashing.

Good luck,

mm

FWIW, I (and the dev who wrote most of the coinstaller) have been trying to work with OP to understand these problems and to get him running again. I contacted him off-list because for the last several weeks most of my attempts to post via email fail (yes, I should follow up, but most of the time someone else solves things adequately, and I consider it something of a blessing). Being a creaure of habit- I usually only think of the web interface when I’m at home (like now)…

As I mention on my MSDN blog, I am concerned about installation issues occurring on XP- anecdotally people are having problems they shouldn’t more often than they should, and once someone finds a workaround- even a dangerous and non-optimal one- they’re generally no longer interested in working with us to find a cause. Nothing unusual- that’s the way the world works- I expect we’ll eventually find ways to get the data we need to understand such problems and not violate anyone’s privacy. Who knows when “eventually” is…

We appreciate OP (and others, such as Martin and Tim) posting about this [it gives us things to do to try to reproduce these problems], and don’t mean to interfere with the process of getting him back to work. But if we can, we would also like to get the info we need so we can understand what’s breaking, and what we can do better (both in the coinstaller and the associated test processes) so fewer devs, and more importantly fewer end users, experience this kind of frustration with our product.

Basically, setupapi and setupact.logs and the wdfxxxinst.logs. I also pasted a batch file in one of my early blog entries that gives us a snap of framework installation health. If it’s big, ZIP it up and send it to us. I’ll look into FTP if we have to do that. If you want to protect something, do what you must [but it would really help if you mention it, because when we notice discrepancies we have to try to sort out why they are there]. We’re actively considering other tools to keep this collection process easy [but that’s in a context of a zillion other things to do].

Sorry to be so wordy (one reason I say my stuff not making it is probably a blessing)- and as always, thanks for using KMDF (UMDF, too, of course).

Bob Kjelgaard
Sr. SDET
Windows Driver Frameworks QA

Bob:

Where and to whom would one send the logs, if one can deal with the privacy issue?

Thanks,

mm

If you can fit them reasonably in an email- send them to me directly. If it’s urgent, send an email to xxxxx@microsoft.com and ask who you can send them to [that avoids cases where I’m OOF for whatever reason, but also avoids replicating some huge file for a bunch of recipients who don’t need the local copy].

What I was thinking of primarily in terms of privacy/IP issues is the editing of these files to obscure or alter product information- usually something gets missed or typo’d and sometimes its just really obvious what got changed, but other times we have to check. But I’m pragmatic- partially obscured info is better than nothing, and I don’t want someone fired for sending me information I thought I needed [including myself, I suppose].

I suppose a flood of these could ensue, and I’ll have to modify that- but so far, I got close to nuttin’.

It would also help, of course, if you’ve made some of your own attempts to fix things to describe what you can remember of them.

Thanks,
Bob Kjelgaard

Thanks, Bob.

I sent my files last night. I’m assuming they were received.

I have connected it to a Kernel Debugger(Windbg) but it was not conected the first time I tried and I missed the crash. The crash has never reoccurred and Windbg seems useless at this point. The driver never gets installed.

I also tried a couple versions of the AMCC5933 sample driver in the WDK. I tried one version in which I created a VC++ 6.0 project with a resource file for versioning and made the minimum number of tweaks to support my AMCC5933 PCI board. I added the resource file so that it resembled my project. I also tried the most basic AMCC driver I could. I used the sample AMCC driver in the WDK and changed only the inx to reflect the DID/VID on my AMCC5933 board but the results were the same. This lends me to believe that my resource file has no ill effects.

I’m going to attempt to use an older WDK to see if I can it working.

Yes, we have received the files- I have been looking at them for most of the last several hours (except when a fire alarm required me to vacate- WHAT a day).

There is no problem with how the driver is being built- the problem is in the framework installation itself [much as it was for Mr. Kraft so many months ago], and we are still working on understanding it.

The initial crash may have triggered this if it happens on both machines, but that doesn’t matter all that much. It should have worked afterwards, and it ought to be working now.

There is nothing wrong [at least as far as installation is concerned] with the driver or how it is being built.

It is getting even stranger. I was able to install my amcc driver on a plx board(with a VID change to my inf). This only worked on one system. My usual target system continues to fail.

My most recent tests have made things more confusing. I used 2 systems, 2 boards, and 3 drivers.

SYSTEM 1: PLX board.
MY PLX DRIVER: WDF 1.1 - Installs ok
MY AMCC DRIVER: WDF 1.5 - Installs ok
WDK AMCC DRIVER: WDF 1.5 - Installs ok

SYSTEM 1: AMCC board.
MY PLX DRIVER: WDF 1.1 - Installs ok
MY AMCC DRIVER: WDF 1.5 - Fails
WDK AMCC DRIVER: WDF 1.5 - Fails


SYSTEM 2: PLX board.
MY PLX DRIVER: WDF 1001 - Fails
MY AMCC DRIVER: WDF 1001 - Fails
WDK AMCC DRIVER: WDF 1001 -Fails

SYSTEM 2: AMCC board.
MY PLX DRIVER: WDF 1001 - Fails
MY AMCC DRIVER: WDF 1001 - Fails
WDK AMCC DRIVER: WDF 1001 - Fails

*System 2 does not even place the wdf*.sys files on my system on install attempts any longer


Does anyone have suggestions on what to try or look at? After each install attempt I saved the log files but I have not seen anything helpful yet.

I copied the wdf*.sys files into the drivers folder myself and was able to get my PLX WDF 1.1 driver working on my SYSTEM 2(for the AMCC board) but NOT the AMCC WDF 1.5 driver on the AMCC board. I did not try the AMCC board again.