views:

1449

answers:

2

I am developing a Browser Helper Object running inside Internet Explorer. I am writing debugging messages with ATLTRACE("..."); These appear fine when Visual Studio is attached to the iexplore.exe process, but this is slow for a quick test. DebugView captures nothing from my BHO.

Why does DebugView not show BHO debug messages? Is it something to do with Internet Explorer running at low integrity level?

+6  A: 

Assuming that you're running IE on Vista or later (which it sounds like since you're talking about integrity levels), you can set the integrity level of DebugView to a lower integrity so any application can send messages to it:

icacls dbgview.exe /setintegritylevel low

And if you don't like the idea of permanently setting dbgview to low integrity (it might make saving logs and whatnot a bit of a pain, as they will only go into the low-integrity store) you can run a particular instance of dbgview at low integrity using Sysinternals' psexec tool:

psexec -l dbgview

Finally, if all you're worried about is the amount of time that it takes to load up the VS debugger to attach to the process, you can use a command line debugger (like ntsd.exe or cdb.exe). Ntsd.exe comes with Windows, but a newer version comes with the "Debugging Tools for Windows" package, which also includes the very similar cdb.exe.

Michael Burr
This sounds odd, do you have any more details on why this would work? Tracing uses OutputDebugString, not messaging.
jdigital
My recollection is that OutputDebugString uses a shared memory section with a mutex and events to pass the data around. I assume (possibly incorrectly) that opening a shared section or signaling events from a low integrity process to a higher integrity process is blocked.
Michael Burr
Gave psexec a go - works great. Vaguely recollect similar issues in the past I'd forgotten how I solved. Running DbgView at low does the job, but rather annoying!Time-wise, its Visual Studio loading IE symbols that's taking the time. I could probably speed it up a bit.
Mat
If you don't need the symbols, you can disable automatic symbol loading, and then just load them lazily as you need them, if you need them.
Logan Capaldo
Michael, thanks for the explanation.
jdigital
A: 

For your quick tests, is Visual Studio still running? If so, that might cause this problem.

jdigital
I follow your line of thinking - Visual Studio is running, but not debugging.
Mat
So shut it down and see if DebugView works.
jdigital