While writing a simple debugger extension DLL I ran into
a puzzling situation that I believe must be common.
I want my DLL to provide some simple commands to dump
some of the structs used by my drivers.
Because the structs use many definitions from NTDDK.H
and other DDK header files, I can’t just include them
in my Win32 DLL project because of redefinitions, etc.
Instead, I use a namespace to enfold the inclusion of
any DDK stuff into my Win32 DLL project. It’s just
like Nebbett’s example at the start of his book.
But to use namespaces, I must compile with the C++
compiler rather than the C compiler, and it’s much
pickier. I end up with syntax errors when the compiler
parses wdbgexts.h such as:
wdbgexts.h(1978) : error C2664: ‘GetFieldData’ : cannot convert parameter 2
from ‘char [6]’ to ‘unsigned char *’
So… I’m wondering, what’s the easiest way of printing out
your structs that use DDK definitions and getting your Win32
debugger extension DLL to compile without complaining?
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You should not include ntddk.h or any of your header files.
The way you should dump structures is to call the debugger APIs to get the
field addresses and values from your data structures - which the debugger
gets from the .pdb file.
This will allow your extension to always work, even if you add ot remove a
field in your data structures.
This will also allow your extension to “just work” if you port to 64 bit.
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
How about the DT command already present in WinDbg. I think it works for
Win2K and above targets. But the structure you are trying to dump must be
present in one of the debug symbol files.
----- Original Message -----
From: “Nate Bushman”
To: “NT Developers Interest List”
Sent: Monday, April 02, 2001 5:00 PM
Subject: [ntdev] Writing a debugger extension…
> While writing a simple debugger extension DLL I ran into
> a puzzling situation that I believe must be common.
>
> I want my DLL to provide some simple commands to dump
> some of the structs used by my drivers.
>
> Because the structs use many definitions from NTDDK.H
> and other DDK header files, I can’t just include them
> in my Win32 DLL project because of redefinitions, etc.
>
> Instead, I use a namespace to enfold the inclusion of
> any DDK stuff into my Win32 DLL project. It’s just
> like Nebbett’s example at the start of his book.
>
> But to use namespaces, I must compile with the C++
> compiler rather than the C compiler, and it’s much
> pickier. I end up with syntax errors when the compiler
> parses wdbgexts.h such as:
>
> wdbgexts.h(1978) : error C2664: ‘GetFieldData’ : cannot convert parameter
2
> from ‘char [6]’ to ‘unsigned char *’
>
> So… I’m wondering, what’s the easiest way of printing out
> your structs that use DDK definitions and getting your Win32
> debugger extension DLL to compile without complaining?
>
> —
> You are currently subscribed to ntdev as: xxxxx@hotmail.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Yeah, of course you’re right. After posting the initial query I discovered
that dt could describe any type defined in a .pdb Love it. Thanks!
-----Original Message-----
From: Noman Smith [mailto:xxxxx@hotmail.com]
Sent: Friday, April 06, 2001 6:44 PM
To: NT Developers Interest List
Cc: Nate Bushman
Subject: [ntdev] Re: Writing a debugger extension…
How about the DT command already present in WinDbg. I think it works for
Win2K and above targets. But the structure you are trying to dump must be
present in one of the debug symbol files.
----- Original Message -----
From: “Nate Bushman”
To: “NT Developers Interest List”
Sent: Monday, April 02, 2001 5:00 PM
Subject: [ntdev] Writing a debugger extension…
> While writing a simple debugger extension DLL I ran into
> a puzzling situation that I believe must be common.
>
> I want my DLL to provide some simple commands to dump
> some of the structs used by my drivers.
>
> Because the structs use many definitions from NTDDK.H
> and other DDK header files, I can’t just include them
> in my Win32 DLL project because of redefinitions, etc.
>
> Instead, I use a namespace to enfold the inclusion of
> any DDK stuff into my Win32 DLL project. It’s just
> like Nebbett’s example at the start of his book.
>
> But to use namespaces, I must compile with the C++
> compiler rather than the C compiler, and it’s much
> pickier. I end up with syntax errors when the compiler
> parses wdbgexts.h such as:
>
> wdbgexts.h(1978) : error C2664: ‘GetFieldData’ : cannot convert parameter
2
> from ‘char [6]’ to ‘unsigned char *’
>
> So… I’m wondering, what’s the easiest way of printing out
> your structs that use DDK definitions and getting your Win32
> debugger extension DLL to compile without complaining?
>
> —
> You are currently subscribed to ntdev as: xxxxx@hotmail.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@legato.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com