PipCallDriverAddDevice: Unable to reference driver

Hi Seniors,

I am new to Windows Driver development and I am not speak English in nature. So please forgive me if my words look silly. I am writing a simple PCI I/O card. Now I have two cards installed. My driver is based on and modified from the PLX9x5x example that comes with KMDF 1.1 package.

The problem is, my driver can be installed smoothly if I compile it in the environment of DDK 3970.1830 + KMDF 1.1 combination, and two cards can be recognized correctly. But if I use the environment of WDK 6000 to compile my driver, the installation always fails with message:

Windows cannot initialize the device driver for the hardware. (Code 37)

and the WinDbg:

PipCallDriverAddDevice: Unable to reference driver \Driver.… (…)

I fight the problem days, but the WDK 6000 always fails, now I fall back to DDK + KMDF. It does not seem to have much answer in the forum. I hope I can use WDK 6000 to develop my driver in the future since it integrated DDK and KMDF, that easier to handle.

Debugee:
Windows XP Professional Version 2002 (Debug)
Build 2600

Thanks for any opinion!

Search the archives on this one. There was recently a huge thread,
although I don’t recall the consensus.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Monday, August 13, 2007 10:16
To: Windows System Software Devs Interest List
Subject: [ntdev] PipCallDriverAddDevice: Unable to reference driver

Hi Seniors,

I am new to Windows Driver development and I am not speak English in
nature. So please forgive me if my words look silly. I am writing a
simple PCI I/O card. Now I have two cards installed. My driver is based
on and modified from the PLX9x5x example that comes with KMDF 1.1
package.

The problem is, my driver can be installed smoothly if I compile it in
the environment of DDK 3970.1830 + KMDF 1.1 combination, and two cards
can be recognized correctly. But if I use the environment of WDK 6000 to
compile my driver, the installation always fails with message:

Windows cannot initialize the device driver for the hardware. (Code 37)

and the WinDbg:

PipCallDriverAddDevice: Unable to reference driver \Driver.… (…)

I fight the problem days, but the WDK 6000 always fails, now I fall back
to DDK + KMDF. It does not seem to have much answer in the forum. I hope
I can use WDK 6000 to develop my driver in the future since it
integrated DDK and KMDF, that easier to handle.

Debugee:
Windows XP Professional Version 2002 (Debug)
Build 2600

Thanks for any opinion!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Is your driver even loading? For example, set a breakpoint your
driver’s DriverEntry routine in windbg. You can do this before the
driver is loaded by setting an unresolved breakpoint. In windbg you
would type

bu !DriverEntry

Another thing that might be going wrong is that your driver is importing
a function which is not exported on the OS your are trying to load your
driver on. This entry
http://blogs.msdn.com/doronh/archive/2006/03/13/550844.aspx talks a bit
on how to debug this.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Monday, August 13, 2007 7:16 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] PipCallDriverAddDevice: Unable to reference driver

Hi Seniors,

I am new to Windows Driver development and I am not speak English in
nature. So please forgive me if my words look silly. I am writing a
simple PCI I/O card. Now I have two cards installed. My driver is based
on and modified from the PLX9x5x example that comes with KMDF 1.1
package.

The problem is, my driver can be installed smoothly if I compile it in
the environment of DDK 3970.1830 + KMDF 1.1 combination, and two cards
can be recognized correctly. But if I use the environment of WDK 6000 to
compile my driver, the installation always fails with message:

Windows cannot initialize the device driver for the hardware. (Code 37)

and the WinDbg:

PipCallDriverAddDevice: Unable to reference driver \Driver.… (…)

I fight the problem days, but the WDK 6000 always fails, now I fall back
to DDK + KMDF. It does not seem to have much answer in the forum. I hope
I can use WDK 6000 to develop my driver in the future since it
integrated DDK and KMDF, that easier to handle.

Debugee:
Windows XP Professional Version 2002 (Debug)
Build 2600

Thanks for any opinion!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

This may be your problem (but it is a guess with more than a few assumptions behind it).

Make sure that you that you update the INF file for the driver package you build with WDK 6000 so it uses wdfcoinstaller01005.dll and sets Kmdf_LibraryVersion=1.5.

When you compile the driver with WDK 6000, it is KMDF 1.5 and I suspect you may be using the 1.1 coinstaller to install it. The installation won’t fail, either because KMDF 1.1 is on the machine already, or because the INF says it is 1.1, so the coinstaller is happy. But KMDF 1.1 cannot support uplevel drivers, so you will fail before your DriverEntry is even called.

Not that I would recommend doing so, but the opposite direction should actually work (installing a 1.1 or 1.0 driver with a 1.5 coinstaller and INF).

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Monday, August 13, 2007 7:16 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] PipCallDriverAddDevice: Unable to reference driver

Hi Seniors,

I am new to Windows Driver development and I am not speak English in nature. So please forgive me if my words look silly. I am writing a simple PCI I/O card. Now I have two cards installed. My driver is based on and modified from the PLX9x5x example that comes with KMDF 1.1 package.

The problem is, my driver can be installed smoothly if I compile it in the environment of DDK 3970.1830 + KMDF 1.1 combination, and two cards can be recognized correctly. But if I use the environment of WDK 6000 to compile my driver, the installation always fails with message:

Windows cannot initialize the device driver for the hardware. (Code 37)

and the WinDbg:

PipCallDriverAddDevice: Unable to reference driver \Driver.… (…)

I fight the problem days, but the WDK 6000 always fails, now I fall back to DDK + KMDF. It does not seem to have much answer in the forum. I hope I can use WDK 6000 to develop my driver in the future since it integrated DDK and KMDF, that easier to handle.

Debugee:
Windows XP Professional Version 2002 (Debug)
Build 2600

Thanks for any opinion!

Thank for reply! I tried again today. I uninstalled the failed device from the device manager, manually removed .sys, oem(n).inf, and the WdfCoInstaller from their installing location. Recompile driver in WDK 6000 environment. This time I make sure the CoInstaller version is set to 1.5, and have it in the source location:


[CoInstaller_CopyFiles]
WdfCoInstaller01005.dll

[SourceDiskFiles]
WdfCoInstaller01005.dll = 1 ; make sure the number matches with SourceDisksNames

[CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000, “WdfCoInstaller01005.dll,WdfCoInstalle”

[Axxx_Inst.NT.Wdf]
KmdfService = Axxx, Axxx_wdfsect

[Axxx_wdfsect]
KmdfLibraryVersion = 1.5

I tried both WdfCoInstaller01005.dll and WdfCoInstaller01005_chk.dll. After installation, they are copied to \WINDOWS\system32, but still failed with different last messages:


WdfCoInstaller01005.dll
Windows:
Fatal error during installation.
WinDbg:
InstallDev Error =643
(s: 0 0x500.514 Explorer.EXE) USER-[Wrn=1401] HMValidateHandle: Invalid:00000000 Type:0x2
(s: 0 0x500.514 explorer.exe) USRK-[Wrn=1401] HMValidateHandle: Invalid:00000000 Type:0x2


WdfCoInstaller01005_chk.dll
Windows:
Windows cannot initialize the device driver for this hardware. (Code 37)
WinDbg:
PipCallDriverAddDevice: Unable to reference driver \Driver\aiio (c0000365)
InstallDev CM_Get_DevNode_Status()=0 DevNodeStatus=1802400 Problem=25
(s: 0 0x540.554 Explorer.EXE) USER-[Wrn=1401] HMValidateHandle: Invalid:00000000 Type:0x2
(s: 0 0x540.554 explorer.exe) USRK-[Wrn=1401] HMValidateHandle: Invalid:00000000 Type:0x2

I think my driver does not load, because there does not message I set in DriverEntry shows, and the break point at DriverEntry is not hit. If I switch back to DDK 3790.1830 + KMDF 1.1, the set message shows and break point is hit.