ERROR_PROC_NOT_FOUND

Hi, trying to start my driver with StartService return ERROR_PROC_NOT_FOUND,
which gives me the suggestion it cannot find the DriverEntry entry point.
The driver installs properly and the weird thing is that changing only one
line of trivial code at an arbitrary place (which does not even get
executed anyway) may eliminate this behavior and my driver gets started
properly. Also changing from checked build to free build or vice versa may
remove this problem, however everytime I change or add some code I may run
again into the problem that my driver refuses to start.

I am using Win2003 SP1 DDK (build 3790.1830) but I tried also others. My
driver is doing nothing weird, no hooks or undocumented stuff or so. I am
however pretty clueless what might be causing this problem, anyone has any
suggestions ?

Anybody has any suggestion ?

Thanks,

Daniel Terhell
Resplendence Software Projects Sp
xxxxx@resplendence.com
http://www.resplendence.com

  1. what OS are you loading your driver on?
  2. Run depends.exe. it could be that you are importing a function that
    is not exported on the OS you are loading on
  3. you can load your driver as a dump file in windbg and see if the
    entry point DriverEntry is defined, see
    http://blogs.msdn.com/doronh/archive/2006/03/10/549036.aspx

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
Sent: Sunday, March 12, 2006 12:21 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] ERROR_PROC_NOT_FOUND

Hi, trying to start my driver with StartService return
ERROR_PROC_NOT_FOUND,
which gives me the suggestion it cannot find the DriverEntry entry
point.
The driver installs properly and the weird thing is that changing only
one
line of trivial code at an arbitrary place (which does not even get
executed anyway) may eliminate this behavior and my driver gets started
properly. Also changing from checked build to free build or vice versa
may
remove this problem, however everytime I change or add some code I may
run
again into the problem that my driver refuses to start.

I am using Win2003 SP1 DDK (build 3790.1830) but I tried also others. My

driver is doing nothing weird, no hooks or undocumented stuff or so. I
am
however pretty clueless what might be causing this problem, anyone has
any
suggestions ?

Anybody has any suggestion ?

Thanks,

Daniel Terhell
Resplendence Software Projects Sp
xxxxx@resplendence.com
http://www.resplendence.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Thanks, I am loading on Win XP SP2 and Win2003 Server SP1 with the same
behavior. I tried Win2000, WinXP and Win2003 target builds with no
difference and the compiler never complains about unresolved externals.
Depends says:

Error: At least one module has an unresolved import due to a missing export
function in an implicitly dependent module. It shows some red Cs which
suggest
unresolved functions:

NTOSKRNL.EXE: KeTickCount and _except handler 3
NTDLL: _chkstk

But none of my code uses any of this stuff.

If I load the driver in Windbg it does show a DriverEntry point.

Regards,

/Daniel

“Doron Holan” wrote in message
news:xxxxx@ntdev…
0) what OS are you loading your driver on?
1) Run depends.exe. it could be that you are importing a function that
is not exported on the OS you are loading on
2) you can load your driver as a dump file in windbg and see if the
entry point DriverEntry is defined, see
http://blogs.msdn.com/doronh/archive/2006/03/10/549036.aspx

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
Sent: Sunday, March 12, 2006 12:21 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] ERROR_PROC_NOT_FOUND

Hi, trying to start my driver with StartService return
ERROR_PROC_NOT_FOUND,
which gives me the suggestion it cannot find the DriverEntry entry
point.
The driver installs properly and the weird thing is that changing only
one
line of trivial code at an arbitrary place (which does not even get
executed anyway) may eliminate this behavior and my driver gets started
properly. Also changing from checked build to free build or vice versa
may
remove this problem, however everytime I change or add some code I may
run
again into the problem that my driver refuses to start.

I am using Win2003 SP1 DDK (build 3790.1830) but I tried also others. My

driver is doing nothing weird, no hooks or undocumented stuff or so. I
am
however pretty clueless what might be causing this problem, anyone has
any
suggestions ?

Anybody has any suggestion ?

Thanks,

Daniel Terhell
Resplendence Software Projects Sp
xxxxx@resplendence.com
http://www.resplendence.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

>ERROR_PROC_NOT_FOUND,

which gives me the suggestion it cannot find the DriverEntry entry point.

Maybe this is due to unresolved imports in the driver binary?

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

But my kernel files do export the symbols that Depends complains about and
the compiler shows no messages about unresolved externals and my code does
not even use any of this stuff. It is so weird that this problem comes and
goes at random when I add some code, like when I add a DbgPrint somewhere.

/Daniel

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> >ERROR_PROC_NOT_FOUND,
>> which gives me the suggestion it cannot find the DriverEntry entry point.
>
> Maybe this is due to unresolved imports in the driver binary?
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>

Put a breakpoint on MmLoadSystemImage and then try to load your driver.
When the first bp hits, put a bp on MiResolveSystemImageImports (or
something like that, eliyasy posted how to do this on the list in the
past 2weeks or so and had the right name). when the 2nd bp hits, note
the last 2 parameters via a ‘dv’ command (the pointers), and then go
continue back to the caller. Then look at the pointers after the call
returned. That will tell you the unresolved import. I will blog on how
to do this this week so it will be easier to follow.
D

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
Sent: Sunday, March 12, 2006 4:57 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND

But my kernel files do export the symbols that Depends complains about
and
the compiler shows no messages about unresolved externals and my code
does
not even use any of this stuff. It is so weird that this problem comes
and
goes at random when I add some code, like when I add a DbgPrint
somewhere.

/Daniel

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> >ERROR_PROC_NOT_FOUND,
>> which gives me the suggestion it cannot find the DriverEntry entry
point.
>
> Maybe this is due to unresolved imports in the driver binary?
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

For setting kernel breakpoints in Windbg I need multiple computers and
cables which is a lot of hassle. The question is if I find the unresolved
import how is that going to help me build a proper driver and what can I
possibly do after to get rid of these problems which appear and disappear at
random and do not seem at all related to my code. Did Depends not tell me
already they were KeTickCount, _except_handler_3 and _chkstk, even though
they are anyway exported by NTOSKRNL and NTDLL ?

Thanks,

/Daniel

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Put a breakpoint on MmLoadSystemImage and then try to load your driver.
When the first bp hits, put a bp on MiResolveSystemImageImports (or
something like that, eliyasy posted how to do this on the list in the
past 2weeks or so and had the right name). when the 2nd bp hits, note
the last 2 parameters via a ‘dv’ command (the pointers), and then go
continue back to the caller. Then look at the pointers after the call
returned. That will tell you the unresolved import. I will blog on how
to do this this week so it will be easier to follow.
D

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
Sent: Sunday, March 12, 2006 4:57 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND

But my kernel files do export the symbols that Depends complains about
and
the compiler shows no messages about unresolved externals and my code
does
not even use any of this stuff. It is so weird that this problem comes
and
goes at random when I add some code, like when I add a DbgPrint
somewhere.

/Daniel

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> >ERROR_PROC_NOT_FOUND,
>> which gives me the suggestion it cannot find the DriverEntry entry
point.
>
> Maybe this is due to unresolved imports in the driver binary?
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Then use Softice, which works on a single machine. You are developing
system software, so you should already have a debugging system set up
and in place. Its just inaddmisble to think thata nyone writes driver
whithout having a setup for debugging them. Its almost hilarious.

Or you develope drivers and debug by means of “DbgPrint” ? Very bad
if you do this.

Dan

----- Original Message -----
From: “Daniel Terhell”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, March 13, 2006 12:58 PM
Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND

> For setting kernel breakpoints in Windbg I need multiple computers and
> cables which is a lot of hassle. The question is if I find the unresolved
> import how is that going to help me build a proper driver and what can I
> possibly do after to get rid of these problems which appear and disappear
> at random and do not seem at all related to my code. Did Depends not tell
> me already they were KeTickCount, _except_handler_3 and _chkstk, even
> though they are anyway exported by NTOSKRNL and NTDLL ?
>
> Thanks,
>
> /Daniel
>
>
>
> “Doron Holan” wrote in message
> news:xxxxx@ntdev…
> Put a breakpoint on MmLoadSystemImage and then try to load your driver.
> When the first bp hits, put a bp on MiResolveSystemImageImports (or
> something like that, eliyasy posted how to do this on the list in the
> past 2weeks or so and had the right name). when the 2nd bp hits, note
> the last 2 parameters via a ‘dv’ command (the pointers), and then go
> continue back to the caller. Then look at the pointers after the call
> returned. That will tell you the unresolved import. I will blog on how
> to do this this week so it will be easier to follow.
> D
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
> Sent: Sunday, March 12, 2006 4:57 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>
> But my kernel files do export the symbols that Depends complains about
> and
> the compiler shows no messages about unresolved externals and my code
> does
> not even use any of this stuff. It is so weird that this problem comes
> and
> goes at random when I add some code, like when I add a DbgPrint
> somewhere.
>
> /Daniel
>
>
> “Maxim S. Shatskih” wrote in message
> news:xxxxx@ntdev…
>> >ERROR_PROC_NOT_FOUND,
>>> which gives me the suggestion it cannot find the DriverEntry entry
> point.
>>
>> Maybe this is due to unresolved imports in the driver binary?
>>
>> Maxim Shatskih, Windows DDK MVP
>> StorageCraft Corporation
>> xxxxx@storagecraft.com
>> http://www.storagecraft.com
>>
>>
>>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

The issue is that my driver is using no symbols which are not exported by
NTOSKRNL or NTDLL. Now I have to set up a remote debugging system to find
the unresolved external. I can do this of course but I am not understanding
how this can help me build a driver which starts properly, the only thing I
am able to imagine is that there are bugs in the DDK linker which builds
invalid system images. If I am wrong and somebody can speculate on something
I could possibly be doing wrong I am very greatful to learn something. By
not fooling around with multiple systems set up for remote debugging I am
saving myself an incredible amount of time. I do use kernel debuggers but
only in the case of an emergency, there are faster ways of finding and
resolving nearly all of the problems I am encountering doing driver
development.

/Daniel

“Dan Partelly” wrote in message news:xxxxx@ntdev…
> Then use Softice, which works on a single machine. You are developing
> system software, so you should already have a debugging system set up
> and in place. Its just inaddmisble to think thata nyone writes driver
> whithout having a setup for debugging them. Its almost hilarious.
>
> Or you develope drivers and debug by means of “DbgPrint” ? Very bad
> if you do this.
>
> Dan
>
> ----- Original Message -----
> From: “Daniel Terhell”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Monday, March 13, 2006 12:58 PM
> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>
>
>> For setting kernel breakpoints in Windbg I need multiple computers and
>> cables which is a lot of hassle. The question is if I find the unresolved
>> import how is that going to help me build a proper driver and what can I
>> possibly do after to get rid of these problems which appear and disappear
>> at random and do not seem at all related to my code. Did Depends not tell
>> me already they were KeTickCount, _except_handler_3 and _chkstk, even
>> though they are anyway exported by NTOSKRNL and NTDLL ?
>>
>> Thanks,
>>
>> /Daniel
>>
>>
>>
>> “Doron Holan” wrote in message
>> news:xxxxx@ntdev…
>> Put a breakpoint on MmLoadSystemImage and then try to load your driver.
>> When the first bp hits, put a bp on MiResolveSystemImageImports (or
>> something like that, eliyasy posted how to do this on the list in the
>> past 2weeks or so and had the right name). when the 2nd bp hits, note
>> the last 2 parameters via a ‘dv’ command (the pointers), and then go
>> continue back to the caller. Then look at the pointers after the call
>> returned. That will tell you the unresolved import. I will blog on how
>> to do this this week so it will be easier to follow.
>> D
>>
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
>> Sent: Sunday, March 12, 2006 4:57 PM
>> To: Windows System Software Devs Interest List
>> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>>
>> But my kernel files do export the symbols that Depends complains about
>> and
>> the compiler shows no messages about unresolved externals and my code
>> does
>> not even use any of this stuff. It is so weird that this problem comes
>> and
>> goes at random when I add some code, like when I add a DbgPrint
>> somewhere.
>>
>> /Daniel
>>
>>
>> “Maxim S. Shatskih” wrote in message
>> news:xxxxx@ntdev…
>>> >ERROR_PROC_NOT_FOUND,
>>>> which gives me the suggestion it cannot find the DriverEntry entry
>> point.
>>>
>>> Maybe this is due to unresolved imports in the driver binary?
>>>
>>> Maxim Shatskih, Windows DDK MVP
>>> StorageCraft Corporation
>>> xxxxx@storagecraft.com
>>> http://www.storagecraft.com
>>>
>>>
>>>
>>
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
>
>

>>I do use kernel debuggers but only in the case of an emergency, there are

>faster ways of finding and resolving nearly all of the problems I am
>encountering doing driver development.

Most of us think very differently. You usually save time by working
with 2 systems as a kernel devloper , permanantly. You dont waste time
setting a debugging system up, you should always develope with 2
systems, dedicated for driver development use. I think your devlopment
strategy is flawed.

> but I am not understanding how this can help me build a driver which
> starts properly

Just debug and most likely youll be able to repsond your own question. It is
important to know the name of the failing export, then you can get an ideea
*why* this happens. By tracing the PE loader code , you can 100% determine
this.
It might be a bug, it might be not, user error, running driver linked for
XP code in 2000,
but untill you debug and pinpoint it, its just *speculation*. Most likely
with my devlopment
setup I would already find the reason in the time necessary for those
emails to be exchanged.

----- Original Message -----
From: “Daniel Terhell”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, March 13, 2006 1:21 PM
Subject: Re:[ntdev] Re:ERROR_PROC_NOT_FOUND

> The issue is that my driver is using no symbols which are not exported by
> NTOSKRNL or NTDLL. Now I have to set up a remote debugging system to find
> the unresolved external. I can do this of course but I am not
> understanding how this can help me build a driver which starts properly,
> the only thing I am able to imagine is that there are bugs in the DDK
> linker which builds invalid system images. If I am wrong and somebody can
> speculate on something I could possibly be doing wrong I am very greatful
> to learn something. By not fooling around with multiple systems set up for
> remote debugging I am saving myself an incredible amount of time. I do use
> kernel debuggers but only in the case of an emergency, there are faster
> ways of finding and resolving nearly all of the problems I am encountering
> doing driver development.
>
> /Daniel
>
>
>
>
> “Dan Partelly” wrote in message
> news:xxxxx@ntdev…
>> Then use Softice, which works on a single machine. You are developing
>> system software, so you should already have a debugging system set up
>> and in place. Its just inaddmisble to think thata nyone writes driver
>> whithout having a setup for debugging them. Its almost hilarious.
>>
>> Or you develope drivers and debug by means of “DbgPrint” ? Very bad
>> if you do this.
>>
>> Dan
>>
>> ----- Original Message -----
>> From: “Daniel Terhell”
>> Newsgroups: ntdev
>> To: “Windows System Software Devs Interest List”
>> Sent: Monday, March 13, 2006 12:58 PM
>> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>>
>>
>>> For setting kernel breakpoints in Windbg I need multiple computers and
>>> cables which is a lot of hassle. The question is if I find the
>>> unresolved import how is that going to help me build a proper driver and
>>> what can I possibly do after to get rid of these problems which appear
>>> and disappear at random and do not seem at all related to my code. Did
>>> Depends not tell me already they were KeTickCount, _except_handler_3 and
>>> _chkstk, even though they are anyway exported by NTOSKRNL and NTDLL ?
>>>
>>> Thanks,
>>>
>>> /Daniel
>>>
>>>
>>>
>>> “Doron Holan” wrote in message
>>> news:xxxxx@ntdev…
>>> Put a breakpoint on MmLoadSystemImage and then try to load your driver.
>>> When the first bp hits, put a bp on MiResolveSystemImageImports (or
>>> something like that, eliyasy posted how to do this on the list in the
>>> past 2weeks or so and had the right name). when the 2nd bp hits, note
>>> the last 2 parameters via a ‘dv’ command (the pointers), and then go
>>> continue back to the caller. Then look at the pointers after the call
>>> returned. That will tell you the unresolved import. I will blog on how
>>> to do this this week so it will be easier to follow.
>>> D
>>>
>>>
>>> -----Original Message-----
>>> From: xxxxx@lists.osr.com
>>> [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
>>> Sent: Sunday, March 12, 2006 4:57 PM
>>> To: Windows System Software Devs Interest List
>>> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>>>
>>> But my kernel files do export the symbols that Depends complains about
>>> and
>>> the compiler shows no messages about unresolved externals and my code
>>> does
>>> not even use any of this stuff. It is so weird that this problem comes
>>> and
>>> goes at random when I add some code, like when I add a DbgPrint
>>> somewhere.
>>>
>>> /Daniel
>>>
>>>
>>> “Maxim S. Shatskih” wrote in message
>>> news:xxxxx@ntdev…
>>>> >ERROR_PROC_NOT_FOUND,
>>>>> which gives me the suggestion it cannot find the DriverEntry entry
>>> point.
>>>>
>>>> Maybe this is due to unresolved imports in the driver binary?
>>>>
>>>> Maxim Shatskih, Windows DDK MVP
>>>> StorageCraft Corporation
>>>> xxxxx@storagecraft.com
>>>> http://www.storagecraft.com
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>>
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

_chkstk is a compiler generated function. It is usually inserted
automatically
by a compiler when you have functions which consume a lot of locals space
on stack, more than a treshold. Check your driver for functions which
eat a lot of locals space.

----- Original Message -----
From: “Daniel Terhell”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, March 13, 2006 1:21 PM
Subject: Re:[ntdev] Re:ERROR_PROC_NOT_FOUND

> The issue is that my driver is using no symbols which are not exported by
> NTOSKRNL or NTDLL. Now I have to set up a remote debugging system to find
> the unresolved external. I can do this of course but I am not
> understanding how this can help me build a driver which starts properly,
> the only thing I am able to imagine is that there are bugs in the DDK
> linker which builds invalid system images. If I am wrong and somebody can
> speculate on something I could possibly be doing wrong I am very greatful
> to learn something. By not fooling around with multiple systems set up for
> remote debugging I am saving myself an incredible amount of time. I do use
> kernel debuggers but only in the case of an emergency, there are faster
> ways of finding and resolving nearly all of the problems I am encountering
> doing driver development.
>
> /Daniel
>
>
>
>
> “Dan Partelly” wrote in message
> news:xxxxx@ntdev…
>> Then use Softice, which works on a single machine. You are developing
>> system software, so you should already have a debugging system set up
>> and in place. Its just inaddmisble to think thata nyone writes driver
>> whithout having a setup for debugging them. Its almost hilarious.
>>
>> Or you develope drivers and debug by means of “DbgPrint” ? Very bad
>> if you do this.
>>
>> Dan
>>
>> ----- Original Message -----
>> From: “Daniel Terhell”
>> Newsgroups: ntdev
>> To: “Windows System Software Devs Interest List”
>> Sent: Monday, March 13, 2006 12:58 PM
>> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>>
>>
>>> For setting kernel breakpoints in Windbg I need multiple computers and
>>> cables which is a lot of hassle. The question is if I find the
>>> unresolved import how is that going to help me build a proper driver and
>>> what can I possibly do after to get rid of these problems which appear
>>> and disappear at random and do not seem at all related to my code. Did
>>> Depends not tell me already they were KeTickCount, _except_handler_3 and
>>> _chkstk, even though they are anyway exported by NTOSKRNL and NTDLL ?
>>>
>>> Thanks,
>>>
>>> /Daniel
>>>
>>>
>>>
>>> “Doron Holan” wrote in message
>>> news:xxxxx@ntdev…
>>> Put a breakpoint on MmLoadSystemImage and then try to load your driver.
>>> When the first bp hits, put a bp on MiResolveSystemImageImports (or
>>> something like that, eliyasy posted how to do this on the list in the
>>> past 2weeks or so and had the right name). when the 2nd bp hits, note
>>> the last 2 parameters via a ‘dv’ command (the pointers), and then go
>>> continue back to the caller. Then look at the pointers after the call
>>> returned. That will tell you the unresolved import. I will blog on how
>>> to do this this week so it will be easier to follow.
>>> D
>>>
>>>
>>> -----Original Message-----
>>> From: xxxxx@lists.osr.com
>>> [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
>>> Sent: Sunday, March 12, 2006 4:57 PM
>>> To: Windows System Software Devs Interest List
>>> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>>>
>>> But my kernel files do export the symbols that Depends complains about
>>> and
>>> the compiler shows no messages about unresolved externals and my code
>>> does
>>> not even use any of this stuff. It is so weird that this problem comes
>>> and
>>> goes at random when I add some code, like when I add a DbgPrint
>>> somewhere.
>>>
>>> /Daniel
>>>
>>>
>>> “Maxim S. Shatskih” wrote in message
>>> news:xxxxx@ntdev…
>>>> >ERROR_PROC_NOT_FOUND,
>>>>> which gives me the suggestion it cannot find the DriverEntry entry
>>> point.
>>>>
>>>> Maybe this is due to unresolved imports in the driver binary?
>>>>
>>>> Maxim Shatskih, Windows DDK MVP
>>>> StorageCraft Corporation
>>>> xxxxx@storagecraft.com
>>>> http://www.storagecraft.com
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>>
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

The issue is that my driver is using no symbols which are not exported by
NTOSKRNL or NTDLL.

\And anyway, what have ntdll.dll with a kernel mode driver ? Its a user mode
DLL, it’s exports cant be used
in kernel mode, and no kernel mode driver should ever reference it.

Your problem is most likely _chkstk , which is not exported by ntoskrnl, and
which is inserted by compilers to check your stack usage. Just dont use so
much locals
space and youll be fine, IMHO.

Dan

----- Original Message -----
From: “Daniel Terhell”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, March 13, 2006 1:21 PM
Subject: Re:[ntdev] Re:ERROR_PROC_NOT_FOUND

> The issue is that my driver is using no symbols which are not exported by
> NTOSKRNL or NTDLL. Now I have to set up a remote debugging system to find
> the unresolved external. I can do this of course but I am not
> understanding how this can help me build a driver which starts properly,
> the only thing I am able to imagine is that there are bugs in the DDK
> linker which builds invalid system images. If I am wrong and somebody can
> speculate on something I could possibly be doing wrong I am very greatful
> to learn something. By not fooling around with multiple systems set up for
> remote debugging I am saving myself an incredible amount of time. I do use
> kernel debuggers but only in the case of an emergency, there are faster
> ways of finding and resolving nearly all of the problems I am encountering
> doing driver development.
>
> /Daniel
>
>
>
>
> “Dan Partelly” wrote in message
> news:xxxxx@ntdev…
>> Then use Softice, which works on a single machine. You are developing
>> system software, so you should already have a debugging system set up
>> and in place. Its just inaddmisble to think thata nyone writes driver
>> whithout having a setup for debugging them. Its almost hilarious.
>>
>> Or you develope drivers and debug by means of “DbgPrint” ? Very bad
>> if you do this.
>>
>> Dan
>>
>> ----- Original Message -----
>> From: “Daniel Terhell”
>> Newsgroups: ntdev
>> To: “Windows System Software Devs Interest List”
>> Sent: Monday, March 13, 2006 12:58 PM
>> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>>
>>
>>> For setting kernel breakpoints in Windbg I need multiple computers and
>>> cables which is a lot of hassle. The question is if I find the
>>> unresolved import how is that going to help me build a proper driver and
>>> what can I possibly do after to get rid of these problems which appear
>>> and disappear at random and do not seem at all related to my code. Did
>>> Depends not tell me already they were KeTickCount, _except_handler_3 and
>>> _chkstk, even though they are anyway exported by NTOSKRNL and NTDLL ?
>>>
>>> Thanks,
>>>
>>> /Daniel
>>>
>>>
>>>
>>> “Doron Holan” wrote in message
>>> news:xxxxx@ntdev…
>>> Put a breakpoint on MmLoadSystemImage and then try to load your driver.
>>> When the first bp hits, put a bp on MiResolveSystemImageImports (or
>>> something like that, eliyasy posted how to do this on the list in the
>>> past 2weeks or so and had the right name). when the 2nd bp hits, note
>>> the last 2 parameters via a ‘dv’ command (the pointers), and then go
>>> continue back to the caller. Then look at the pointers after the call
>>> returned. That will tell you the unresolved import. I will blog on how
>>> to do this this week so it will be easier to follow.
>>> D
>>>
>>>
>>> -----Original Message-----
>>> From: xxxxx@lists.osr.com
>>> [mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
>>> Sent: Sunday, March 12, 2006 4:57 PM
>>> To: Windows System Software Devs Interest List
>>> Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND
>>>
>>> But my kernel files do export the symbols that Depends complains about
>>> and
>>> the compiler shows no messages about unresolved externals and my code
>>> does
>>> not even use any of this stuff. It is so weird that this problem comes
>>> and
>>> goes at random when I add some code, like when I add a DbgPrint
>>> somewhere.
>>>
>>> /Daniel
>>>
>>>
>>> “Maxim S. Shatskih” wrote in message
>>> news:xxxxx@ntdev…
>>>> >ERROR_PROC_NOT_FOUND,
>>>>> which gives me the suggestion it cannot find the DriverEntry entry
>>> point.
>>>>
>>>> Maybe this is due to unresolved imports in the driver binary?
>>>>
>>>> Maxim Shatskih, Windows DDK MVP
>>>> StorageCraft Corporation
>>>> xxxxx@storagecraft.com
>>>> http://www.storagecraft.com
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>>
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

“Dan Partelly” wrote in message news:xxxxx@ntdev…
>
> Your problem is most likely _chkstk , which is not exported by ntoskrnl,
> and which is inserted by compilers to check your stack usage. Just dont
> use so much locals
> space and youll be fine, IMHO.
>

Thanks, I had already thought about that. My driver uses no more than a
couple of bytes of local variables. What is also weird is the bug check IO
VERIFICATION ERROR I am sometimes receiving for executing no code at all. I
agree it is time for a kernel debugger, I got a friend downtown with a copy
of SoftIce, I am going to load and try to start my driver on one of his
machines.

/Daniel

Daniel Terhell wrote:

But my kernel files do export the symbols that Depends complains about and
the compiler shows no messages about unresolved externals and my code does
not even use any of this stuff. It is so weird that this problem comes and
goes at random when I add some code, like when I add a DbgPrint somewhere.

Depends.exe is a user-mode tool. It doesn’t know anything about how to
satisfy imports for a kernel driver.


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

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> Daniel Terhell wrote:
>
>>But my kernel files do export the symbols that Depends complains about and
>>the compiler shows no messages about unresolved externals and my code does
>>not even use any of this stuff. It is so weird that this problem comes
>>and
>>goes at random when I add some code, like when I add a DbgPrint somewhere.
>>
>>
>
> Depends.exe is a user-mode tool. It doesn’t know anything about how to
> satisfy imports for a kernel driver.
>

I think this makes no sense as drivers are also executables in PE format.

/Daniel

Yes, depends.exe can work on a driver b/c it just a PE file. This is
what oney’s book uses to demonstrate dependencies IIRC.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
Sent: Monday, March 13, 2006 10:29 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> Daniel Terhell wrote:
>
>>But my kernel files do export the symbols that Depends complains about
and
>>the compiler shows no messages about unresolved externals and my code
does
>>not even use any of this stuff. It is so weird that this problem
comes
>>and
>>goes at random when I add some code, like when I add a DbgPrint
somewhere.
>>
>>
>
> Depends.exe is a user-mode tool. It doesn’t know anything about how
to
> satisfy imports for a kernel driver.
>

I think this makes no sense as drivers are also executables in PE
format.

/Daniel


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Daniel Terhell wrote:

“Tim Roberts” wrote in message news:xxxxx@ntdev…
>
>
>>Daniel Terhell wrote:
>>
>>
>>
>>>But my kernel files do export the symbols that Depends complains about and
>>>the compiler shows no messages about unresolved externals and my code does
>>>not even use any of this stuff. It is so weird that this problem comes
>>>and
>>>goes at random when I add some code, like when I add a DbgPrint somewhere.
>>>
>>>
>>>
>>>
>>Depends.exe is a user-mode tool. It doesn’t know anything about how to
>>satisfy imports for a kernel driver.
>>
>>
>
>I think this makes no sense as drivers are also executables in PE format.
>
>

But depends doesn’t know that it’s supposed to look at .sys files to
satisfy imports. It’s only going to use the normal system DLL search
path, which finds only user-mode DLLs.


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

You are in error Tim. Daniel is right that dependcy walkers *DO* work.

Dan

----- Original Message -----
From: “Tim Roberts”
To: “Windows System Software Devs Interest List”
Sent: Monday, March 13, 2006 8:40 PM
Subject: Re: [ntdev] ERROR_PROC_NOT_FOUND

> Daniel Terhell wrote:
>
>>“Tim Roberts” wrote in message news:xxxxx@ntdev…
>>
>>
>>>Daniel Terhell wrote:
>>>
>>>
>>>
>>>>But my kernel files do export the symbols that Depends complains about
>>>>and
>>>>the compiler shows no messages about unresolved externals and my code
>>>>does
>>>>not even use any of this stuff. It is so weird that this problem comes
>>>>and
>>>>goes at random when I add some code, like when I add a DbgPrint
>>>>somewhere.
>>>>
>>>>
>>>>
>>>>
>>>Depends.exe is a user-mode tool. It doesn’t know anything about how to
>>>satisfy imports for a kernel driver.
>>>
>>>
>>
>>I think this makes no sense as drivers are also executables in PE format.
>>
>>
>
> But depends doesn’t know that it’s supposed to look at .sys files to
> satisfy imports. It’s only going to use the normal system DLL search
> path, which finds only user-mode DLLs.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

> But depends doesn’t know that it’s supposed to look at .sys files to

satisfy imports. It’s only going to use the normal system DLL search
path, which finds only user-mode DLLs.

Not, it also shows NTOSKRNL and HAL imports fine.

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

I described it in better detail and put up an annotated debugger log to
follow along.

http://blogs.msdn.com/doronh/archive/2006/03/13/550844.aspx

The 2ndary bp is for nt!MiResolveImageReferences, not
MiResolveSystemImageImports :wink:

d

-----Original Message-----
From: Doron Holan
Sent: Sunday, March 12, 2006 5:18 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ERROR_PROC_NOT_FOUND

Put a breakpoint on MmLoadSystemImage and then try to load your driver.
When the first bp hits, put a bp on MiResolveSystemImageImports (or
something like that, eliyasy posted how to do this on the list in the
past 2weeks or so and had the right name). when the 2nd bp hits, note
the last 2 parameters via a ‘dv’ command (the pointers), and then go
continue back to the caller. Then look at the pointers after the call
returned. That will tell you the unresolved import. I will blog on how
to do this this week so it will be easier to follow.
D

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel Terhell
Sent: Sunday, March 12, 2006 4:57 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] ERROR_PROC_NOT_FOUND

But my kernel files do export the symbols that Depends complains about
and
the compiler shows no messages about unresolved externals and my code
does
not even use any of this stuff. It is so weird that this problem comes
and
goes at random when I add some code, like when I add a DbgPrint
somewhere.

/Daniel

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> >ERROR_PROC_NOT_FOUND,
>> which gives me the suggestion it cannot find the DriverEntry entry
point.
>
> Maybe this is due to unresolved imports in the driver binary?
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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