Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to break on entry point of a DLL?

1,555 views
Skip to first unread message

Matt McLin

unread,
Jun 2, 2004, 11:32:48 AM6/2/04
to
Hello,

I would like to be able to set breakpoints on DriverEntry and DLLMain
functions, but have not been able to do this successfully.

It seems that until the module actually gets loaded, WinDbg has no
idea of its existence (even if I have the symbols path pointing to a
.pdb file for it), and so I can't reference one of its functions.

I have tried using bm foo!DriverEntry and bu foo!DriverEntry.

If I wait until the module has been loaded, then I can Ctrl-Break into
WinDbg and set some other breakpoint in the module, but then I have
missed the code I actually wanted to look at.

Has anyone been able to do this, and if so, could you explain?

Thanks,
Matt

Marley Lucy

unread,
Jun 2, 2004, 5:35:36 PM6/2/04
to
Use DbgBreakPoint(); it will break every time its hit. You'd better have
the debugger already to go.

Finecats

"Matt McLin" <matt....@barco.com> wrote in message
news:7fe35f33.04060...@posting.google.com...

Don Burn

unread,
Jun 2, 2004, 7:05:43 PM6/2/04
to
Use the bu command from the command window this sets an unresolved
breakpoint that when the module is loaded gets set. See "Using
Breakpoints" in the WinDBG documentation for details.

--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply


"Matt McLin" <matt....@barco.com> wrote in message
news:7fe35f33.04060...@posting.google.com...

Andre Vachon [MS]

unread,
Jun 2, 2004, 11:24:59 PM6/2/04
to
bu foo!DriverEntry should work fine.
You have to breakin before the driver gets loaded, set the breakpoint, and
then g.

-Andre

"Don Burn" <bu...@stopspam.acm.org> wrote in message
news:10bsnb1...@corp.supernews.com...

Matt McLin

unread,
Jun 3, 2004, 1:42:26 PM6/3/04
to
Thank you all for the suggestions. I think stuffing a DbgBreakpoint()
in my entry routine sounds like my best bet.

As I noted in my original e-mail, using bu foo!function doesn't work
for me until the module has been loaded. Not sure why. I'm using
WndDbg 6.2.0013.0. Does it make a difference that I'm talking about a
display driver DLL vs. a regular user-mode DLL?

For the "bu" command, when does the actual breakpoint get resolved?
Does WndDbg go through it's list of unresolved breakpoints every time
a module gets loaded?

Thanks,
Matt

"Andre Vachon [MS]" <and...@online.microsoft.com> wrote in message news:<u5dstpR...@TK2MSFTNGP09.phx.gbl>...

Staffan Gustafsson

unread,
Jun 8, 2004, 4:02:20 PM6/8/04
to
sxe ld:<module.dll>

is another alternative.

0 new messages