Unable to load driver

Hi all,

I am a newbie at driver development and I try to learn.
I have a usb device and I have tried to implement a simple usb driver for it. I have used the usbsamp as a base and changed it to work with my device (at least I think I have).

I have also looked at this homepage http://www.osronline.com/ddkx/install/create-inf_4l47.htm to see how to create a inf file for my driver.

But now when I tries to install and load the driver (by using the install hardware guide in windows xp), I got a error message saying that it was not able to load the driver with error code 39.

I have tried to find out what is wrong for almost 3 days now but I can’t understand it. And I also understand that you of course not can tell me what is wrong, but perhaps someone can answer my (probably stupied) questions.

First of all, can this problem be connected with some error in the inf-file I created? And I don’t talk about syntax errors but perhaps some fault in how to install the driver?
Or is it more likely to be something I don’t do (or do wrong?) in the driver code?

For example, my device is a usb modem with three pipes, and I think I open all the pipes and creates correct IO queues and all that, but if I don’t, can this lead to this error?

I hope someone can help me with this questions.

On 06/07/2010 08:50, xxxxx@tjelvar.org wrote:

But now when I tries to install and load the driver (by using the install hardware guide in windows xp), I got a error message saying that it was not able to load the driver with error code 39.

There are quite a few possibilities for this. To find out more precisely
what the issue is, you’ll need to look at the installation logs.

My advice is to take a copy of and then clear (make empty) these files:

%systemroot&\setupapi.log
%systemroot&\setupapi.app
%systemroot&\setupapi.dev

retry the install, and the have a go at interpreting the log, as per:

http://www.osronline.com/ddkx/install/troubleshoot_1jhj.htm

On windows 7, the log files are typically found in %windir%\inf

MH.

Ok, thanks I will give it a try! :slight_smile:

But just one question, are you sure that all theese files exist in XP?
I can just find setupapi.log.

For PnP devices and driver installation you have:
On XP:
%systemroot%\setupapi.log
On Vista and higher:
%systemroot%\inf\setupapi.dev.log

Kris

-----Original Message-----
From: xxxxx@tjelvar.org [mailto:xxxxx@tjelvar.org]
Posted At: Tuesday, July 06, 2010 10:47 AM
Posted To: ntdev
Conversation: Unable to load driver
Subject: RE: Unable to load driver

Ok, thanks I will give it a try! :slight_smile:

But just one question, are you sure that all theese files exist in XP?
I can just find setupapi.log.

On 06/07/2010 10:47, xxxxx@tjelvar.org wrote:

Ok, thanks I will give it a try! :slight_smile:

But just one question, are you sure that all theese files exist in XP?
I can just find setupapi.log.

I stand corrected: The other two are:

setupapi.app.log
setupapi.dev.log

(windows not displaying file extensions confused me).

MH.

Ok, now I have studied the logs and I don’t get any further any way. :frowning:
I probably don’t understand the logs or it don’t give me any usefull information. I don’t know how to go on so I posts my logg here and perhaps someone can help me see if it is any usefull information. :slight_smile:


[SetupAPI Log]
OS Version = 5.1.2600 Service Pack 3
Platform ID = 2 (NT)
Service Pack = 3.0
Suite = 0x0100
Product Type = 1
Architecture = x86
[2010/07/06 13:19:03 792.16 Driver Install]
#-019 Searching for hardware ID(s): usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s): usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s): usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s): usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s): usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s): usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s): usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s): usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#I022 Found “USB\Vid_05F3&Pid_0200” in c:\myUsb\myUsb.inf; Device: “Frans Usb Modem”; Driver: “Frans Usb Modem”; Provider: “Frans Handel”; Mfg: “Frans”; Section name: “Modem1”.
#I087 Driver node not trusted, rank changed from 0x00000001 to 0x00008001.
#I023 Actual install section: [Modem1.NT]. Rank: 0x00008001. Effective driver date: 07/06/2010.
#-124 Doing copy-only install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2”.
#E366 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver “Frans Usb Modem” will be installed (Policy=Warn, user said ok). Error 0xe000022f: The third-party INF does not contain digital signature information.
#W187 Install failed, attempting to restore original files.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver “Frans Usb Modem” will be installed (Policy=Warn). Error 0xe000022f: The third-party INF does not contain digital signature information.
#-024 Copying file “c:\myUsb\myUsb.sys” to “C:\WINDOWS\system32\DRIVERS\myUsb.sys”.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver “Frans Usb Modem” will be installed (Policy=Warn). 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 [Modem1.NT.Interfaces] from “c:\myUsb\myUsb.inf”.
#I054 Interfaces installed.
#-166 Device install function: DIF_INSTALLDEVICE.
#I123 Doing full install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2”.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver “Frans Usb Modem” will be installed (Policy=Warn). Error 0xe000022f: The third-party INF does not contain digital signature information.
#I163 Device not started: Device has problem: 0x27: CM_PROB_DRIVER_FAILED_LOAD.
#I121 Device install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2” finished successfully.

This piece of code catch my eye but I can’t find any information about what is making it.

I mean this code: 0x27: CM_PROB_DRIVER_FAILED_LOAD. :slight_smile:

That is the proximate cause of the failure. Lots of reasons why the driver
load could fail, for example installing a driver built for some other
platform than xp 32bit.

depends.exe in the wdk is a useful tool for taking a first pass at a driver
.sys file to make sure it can load on a given platform.

Mark Roddy

On Tue, Jul 6, 2010 at 8:13 AM, wrote:

> CM_PROB_DRIVER_FAILED_LOAD

It’s saying that your driver is not correctly signed (it will prevent
driver from being loaded on Vista and higher) - for starter you can try
to turn off signature checks in boot menu (F8 -> “Disable Driver
Signature Enforcement”). Another option is to have kernel debugger
connected or use test signing.

If you are using XP (and if you clicked your way thru to actually use
unsigned drivers) I would check if your sys file is the correct one. It
has to be compiled in the right build environment to match your test
system architecture (e.g. either x86 or amd64).

Kris

-----Original Message-----
From: xxxxx@tjelvar.org [mailto:xxxxx@tjelvar.org]
Posted At: Tuesday, July 06, 2010 1:13 PM
Posted To: ntdev
Conversation: Unable to load driver
Subject: RE: Unable to load driver

Ok, now I have studied the logs and I don’t get any further any way. :frowning:
I probably don’t understand the logs or it don’t give me any usefull
information. I don’t know how to go on so I posts my logg here and
perhaps someone can help me see if it is any usefull information. :slight_smile:



[SetupAPI Log]
OS Version = 5.1.2600 Service Pack 3
Platform ID = 2 (NT)
Service Pack = 3.0
Suite = 0x0100
Product Type = 1
Architecture = x86
[2010/07/06 13:19:03 792.16 Driver Install]
#-019 Searching for hardware ID(s):
usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s):
usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s):
usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s):
usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s):
usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s):
usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s):
usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s):
usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#I022 Found “USB\Vid_05F3&Pid_0200” in c:\myUsb\myUsb.inf; Device:
“Frans Usb Modem”; Driver: “Frans Usb Modem”; Provider: “Frans Handel”;
Mfg: “Frans”; Section name: “Modem1”.
#I087 Driver node not trusted, rank changed from 0x00000001 to
0x00008001.
#I023 Actual install section: [Modem1.NT]. Rank: 0x00008001. Effective
driver date: 07/06/2010.
#-124 Doing copy-only install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2”.
#E366 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for
driver “Frans Usb Modem” will be installed (Policy=Warn, user said ok).
Error 0xe000022f: The third-party INF does not contain digital signature
information.
#W187 Install failed, attempting to restore original files.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for
driver “Frans Usb Modem” will be installed (Policy=Warn). Error
0xe000022f: The third-party INF does not contain digital signature
information.
#-024 Copying file “c:\myUsb\myUsb.sys” to
“C:\WINDOWS\system32\DRIVERS\myUsb.sys”.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for
driver “Frans Usb Modem” will be installed (Policy=Warn). 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 [Modem1.NT.Interfaces] from
“c:\myUsb\myUsb.inf”.
#I054 Interfaces installed.
#-166 Device install function: DIF_INSTALLDEVICE.
#I123 Doing full install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2”.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for
driver “Frans Usb Modem” will be installed (Policy=Warn). Error
0xe000022f: The third-party INF does not contain digital signature
information.
#I163 Device not started: Device has problem: 0x27:
CM_PROB_DRIVER_FAILED_LOAD.
#I121 Device install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2” finished
successfully.


This piece of code catch my eye but I can’t find any information about
what is making it.

Ok and what does the following thing from depends.exe mean?

Error: At least one required implicit or forwarded dependency was not found.
WDFLDR.SYS Error opening file. Couldn’t find file (2).

Krzysztof, I’m using XP and I have clicked me thru to use unsigned drivers.

And I do think I use the right one? I compiled it with the Windows XP x86 Free Build Environment and I have Windows XP and x86 system architecture. But I will check it again.

And thx for the help anyway! :slight_smile:

On 06/07/2010 13:13, xxxxx@tjelvar.org wrote:

Is this setupapi.log?

What about setupapi.dev.log? that might give you more detailed
information…

#I123 Doing full install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2”.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver “Frans Usb Modem” will be installed (Policy=Warn). Error 0xe000022f: The third-party INF does not contain digital signature information.

So, the installation is going ahead despite signing problems.

#I163 Device not started: Device has problem: 0x27: CM_PROB_DRIVER_FAILED_LOAD.
#I121 Device install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2” finished successfully.

You might actually have gotten as far as DriverEntry - have you tried
putting a breakpoint on it?

MH.

Martin, yes it is setupapi.log and it is the only log-file I can found here on my XP computer. I have looked where you said it should be, I have search for it and so on and I can’t find it.
So are you sure that is existing on XP? And if so, where should it be?

And no, I have not tried to putt a breakpoint on it, mostly because I don’t know how to do it. :stuck_out_tongue:

On 06/07/2010 13:58, xxxxx@tjelvar.org wrote:

Martin, yes it is setupapi.log and it is the only log-file I can found here on my XP computer. I have looked where you said it should be, I have search for it and so on and I can’t find it.
So are you sure that is existing on XP? And if so, where should it be?

I’m not sure - I don’t develop drivers for XP.

And no, I have not tried to putt a breakpoint on it, mostly because I don’t know how to do it. :stuck_out_tongue:

OK, well best way is to setup a debugger, and then before your driver
has loaded, use the command:

“bp !DriverEntry”

Have you set up WinDbg on the target system yet? If not, try the
following resources:

http://www.microsoft.com/whdc/devtools/debugging/default.mspx
http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx

MH.

ok, no I have not set up WinDbg yet but I have looked at it. And I will set up it now.
Thanks for your help and patiance with a newbie like me! :slight_smile:

Is this a 64 bit system? If so you will have to sign the driver with either
an Authenticode certificate, or by creating your own test certificate and
connecting to a host running windbg. 64 bit drivers MUST be signed, or
signing disabled for that boot session.

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@tjelvar.org
Sent: Tuesday, July 06, 2010 7:13 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Unable to load driver

Ok, now I have studied the logs and I don’t get any further any way. :frowning: I
probably don’t understand the logs or it don’t give me any usefull
information. I don’t know how to go on so I posts my logg here and perhaps
someone can help me see if it is any usefull information. :slight_smile:



[SetupAPI Log]
OS Version = 5.1.2600 Service Pack 3
Platform ID = 2 (NT)
Service Pack = 3.0
Suite = 0x0100
Product Type = 1
Architecture = x86
[2010/07/06 13:19:03 792.16 Driver Install]
#-019 Searching for hardware ID(s):
usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s):
usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s):
usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s):
usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s):
usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s):
usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#-019 Searching for hardware ID(s):
usb\vid_05F3&pid_0200&rev_0100,usb\vid_05F3&pid_0200
#-018 Searching for compatible ID(s):
usb\class_02&subclass_02&prot_01,usb\class_02&subclass_02,usb\class_02
#I022 Found “USB\Vid_05F3&Pid_0200” in c:\myUsb\myUsb.inf; Device: “Frans
Usb Modem”; Driver: “Frans Usb Modem”; Provider: “Frans Handel”; Mfg:
“Frans”; Section name: “Modem1”.
#I087 Driver node not trusted, rank changed from 0x00000001 to 0x00008001.
#I023 Actual install section: [Modem1.NT]. Rank: 0x00008001. Effective
driver date: 07/06/2010.
#-124 Doing copy-only install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2”.
#E366 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver
“Frans Usb Modem” will be installed (Policy=Warn, user said ok). Error
0xe000022f: The third-party INF does not contain digital signature
information.
#W187 Install failed, attempting to restore original files.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver
“Frans Usb Modem” will be installed (Policy=Warn). Error 0xe000022f: The
third-party INF does not contain digital signature information.
#-024 Copying file “c:\myUsb\myUsb.sys” to
“C:\WINDOWS\system32\DRIVERS\myUsb.sys”.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver
“Frans Usb Modem” will be installed (Policy=Warn). 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 [Modem1.NT.Interfaces] from “c:\myUsb\myUsb.inf”.
#I054 Interfaces installed.
#-166 Device install function: DIF_INSTALLDEVICE.
#I123 Doing full install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2”.
#E362 An unsigned or incorrectly signed file “c:\myUsb\myUsb.inf” for driver
“Frans Usb Modem” will be installed (Policy=Warn). Error 0xe000022f: The
third-party INF does not contain digital signature information.
#I163 Device not started: Device has problem: 0x27:
CM_PROB_DRIVER_FAILED_LOAD.
#I121 Device install of “USB\VID_05F3&PID_0200\5&100A8EFE&0&2” finished
successfully.


This piece of code catch my eye but I can’t find any information about what
is making it.


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 KMDF one? Are you running dependency walker on the same
machine you are trying to run your driver? If so then it likely means
that part of the WDF framework is missing (wdfldr.sys) hence the error.

Kris

-----Original Message-----
From: xxxxx@tjelvar.org [mailto:xxxxx@tjelvar.org]
Posted At: Tuesday, July 06, 2010 1:41 PM
Posted To: ntdev
Conversation: Unable to load driver
Subject: RE: Unable to load driver

Ok and what does the following thing from depends.exe mean?

Error: At least one required implicit or forwarded dependency was not
found.
WDFLDR.SYS Error opening file. Couldn’t find file (2).

I think it means you have a kmdf driver and you have not installed it
correctly.
Mark Roddy

On Tue, Jul 6, 2010 at 8:41 AM, wrote:

> Ok and what does the following thing from depends.exe mean?
>
> Error: At least one required implicit or forwarded dependency was not
> found.
> WDFLDR.SYS Error opening file. Couldn’t find file (2).
>
>
>
> —
> 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
>

Gary, no it is a 32-bit system so I don’t have to sign it.

Kris, yes my driver is a KDMF driver and your are indeed right that I tried to run it on the same machine that I trying to run my driver on.
But what is wdfldr.sys and can I get it somewhere? Or should I run them on different systems?

Mark, what do you mean with not installed it correctly?

Check an INF file that installs a KMDF driver. It requires references to
WDFCOINSTALLERxxxx. That version, the xxxx, must agree with the version of
the WDK you use to build your driver.

Gary G. Little

H (952) 223-1349

C (952) 454-4629

xxxxx@comcast.net

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Tuesday, July 06, 2010 9:26 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Unable to load driver

I think it means you have a kmdf driver and you have not installed it
correctly.
Mark Roddy

On Tue, Jul 6, 2010 at 8:41 AM, wrote:

Ok and what does the following thing from depends.exe mean?

Error: At least one required implicit or forwarded dependency was not found.
WDFLDR.SYS Error opening file. Couldn’t find file (2).


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

— 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