Tech Support > Microsoft Windows > Drivers > driver cannot be loaded - code 39
driver cannot be loaded - code 39
Posted by kobi n on June 25th, 2008


Hi,

i have a very strange situation that i can't seem to deal with.

my driver is WDF based. it's a pci card driver which is functioning well and
in the middle of the development. i use the 6001 package to build it and all
went fine until, whole of a sudden, my driver cannot be loaded. using WinDBG
i can see that DriverEntry is never called. it is very strange since i
havn't done any changes in the PnP sections of the driver and neither in the
..inf file.

the error i get from windows PnP :
windows cannot load the device driver for this hardware. driver may be
corrupted or missing.
THE THING IS : when i try it with some older version of my driver (again,
without any differences in the PnP sections) it works fine.


any ideas ?

thanks,
kobi

Posted by Doron Holan [MSFT] on June 25th, 2008


i would guess that you are using an export that is supported on one OS but
not another. What build window did you build your driver in? what OS are
you trying to load your driver in?

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"kobi n" <kobin@discussions.microsoft.com> wrote in message
news:708F4FFB-5554-4ECF-9EF6-C79481E9F6DD@microsoft.com...

Posted by kobi n on June 29th, 2008



sorry for the delay.
this became a very strange problem :

i opened my driver (.sys file) with the dependency tool and saw the NTOSKRNL
was missing a _chkstk method.

after a real hard investigation of my code i noticed that one of my
functions was using a struct. if i changed my implementation and changed that
to be a pointer to the struct i opened my .sys fiel again with the dependency
tool and saw that the _chkstk method was not needed.

i guess that either way my version of the NTOSKRNL is lacking the _chkstk
method.


anyway... it was very hard to find since my error (during device
installation) was- driver corrupted or missing.


"Doron Holan [MSFT]" wrote:

Posted by Esha on June 30th, 2008


kobi,

I'm also, facing a similar problem. I'm working on a PCI card driver.
Checked build works perfectly fine but the free build doesn't even
install and it gives the error - code 39.

I'm using DriverWorks (ver 3.2) and DDK (2600.1106) for building both
free and checked build for Windows XP SP2.

Regards
Esha

Which is the dependency tool you used ?

kobi n wrote:

Posted by Esha on June 30th, 2008


When I used the dependency walker 2.2 to open my free build .sys file, i
found this erro - Warning: At least one module has an unresolved import
due to a missing export function in a delay-load dependent module."
related to the dll MPR.dll. Does this depend on the .NET installed ? I
have 2.0 with SP1.

Regards
Esha


kobi n wrote:

Posted by Maxim S. Shatskih on June 30th, 2008


It is full of issues, and nothing surprising that the driver does not load.
Some DriverWorks issue nearly for sure.

The suggestion is to switch to KMDF.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


Posted by Don Burn on June 30th, 2008


_chkstk is a sure flag you are using way to much stack in a single routine
for a kernel operation. IThe other alternative is you are not using the
BUILD environment from the WDK. Either way you need to fix it.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply




"kobi n" <kobin@discussions.microsoft.com> wrote in message
news:07517D49-DC85-4E56-A70F-D74C9966354B@microsoft.com...


Posted by Don Burn on June 30th, 2008


The 2600 DDK is obsolete, and you should upgrade to the WDK. As Max already
pointed out DriverWorks has a ton of problems (running modern code analysis
tools on the source a few years ago I found over 2000 major bugs), get rid
of this.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply



"Esha" <iimeandmyself@yahoo.com> wrote in message
news:uhI0wHq2IHA.528@TK2MSFTNGP02.phx.gbl...