wdbgexts and dbgeng cooperate well, you can use IDebugControl::GetWindbgExtensionApis[32|64] to get the wdbgexts function pointer table, then use the wdbgexts macros as usual.
If you want to collect output the most flexible way would be to use IDebugClient::SetOutputCallbacks to install your own output callbacks. You’ll then get all output that your extension or command produces. You then restore the original callbacks when you’re done. The debugger samples have examples of implementing output callbacks.
If you don’t want to use callbacks you can open a log file and then close it to collect output during a particular period of time. To be cooperative you’d have to check for previous log settings and restore them after you’re done.
As other mail mentioned you can use IDebugControl::Execute to execute any arbitrary debugger command.
From: xxxxx@lists.osr.com on behalf of Alon
Sent: Wed 11/9/2005 12:03 AM
To: Kernel Debugging Interest List
Subject: RE:[windbg] Using exisiting deubgger extnesion from a new one
Hi again,
Well, first I would like to say that I’m using the
“WdbgExts” interface which doesn’t work with
IDebugControl::…,
Other thing is that I want to understand how can I get
the output from these function, or that I just can
call them?
If it is possible to send here a sample code calling
external extension It will be very helpfull…What
regarding non-extension command (e.g.: dt
nt!_UNICODE_STRING
) hoe can I call this one
from my code?
Thanks in advance
Alon
"Drew Bliss" wrote in
message news:xxxxx@windbg...
Extensions are just DLLs, so LoadLibrary and
GetProcAddress will work
fine. However, the recommended way of calling between
extensions is to
use IDebugControl::GetExtensionFunction. That wraps
the LoadLibrary and
GetProcAddress for you. Your callee extension defines
EFN_whatever and
your caller extension uses GetExtensionFunction(0,
"whatever", &Func) to
get the function pointer (you can also look up your
callee extension by
path to get a specific handle if you want to avoid
walking the extension
chain).
If you just want to call a regular text-based
extension in the extension
chain you can use IDebugControl::CallExtension.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf
Of Alon
Sent: Tuesday, November 08, 2005 8:19 AM
To: Kernel Debugging Interest List
Subject: [windbg] Using exisiting deubgger extnesion
from a new one
Hi,
I'm writing my own debugger extension, I have a
question regarding using
existing extension from my own extension:
Is there a way to call an existing debugger extension
from my debugger
extension code? (for example - I want to call "!irp
" when
is something I've found - any way to do so?
I tried calling LoadLibrary and GetProcAddress but I
didn't success to
make it work ;-(
Thanks
Alon
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
---
You are currently subscribed to windbg as:
xxxxx@winse.microsoft.com To
unsubscribe send a blank email to
xxxxx@lists.osr.com
__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs
---
You are currently subscribed to windbg as: xxxxx@winse.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com