Hi guys,
Sorry to bother you with such a silly question
but here goes:
What’s the quickest way of sending a formatted output from a km driver
to WinDbg?
Something along these lines:
:
char szBuffer[64];
short nMyValue;
:
sprintf (szBuffer, “My value is %d”, nMyValue);
DbgPrint (szBuffer);
:
I would ‘#include <stdio.h>’ (DDK won’t complain) but I’m not sure if
it’s
advisable…
Of course, I could use ‘RtlIntegerToUnicodeString’
followed by a
couple of DbgPrint calls… but isn’t there an easy way (or does
#include <stdio.h>
work just fine)?
(P.S. - Of course I have access to ‘nMyValue’ on WinDbg; it’s just that
I would
like to quickly check some changing values inside a short loop, without
having
to break in all the time…)
Thanx,
Miguel Monteiro
xxxxx@criticalsoftware.com
www.criticalsoftware.com
------------------------------------------------------------
«Humour and love are God’s answers
to Human weaknesses»
------------------------------------------------------------
—
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</stdio.h></stdio.h>
DbgPrint(“My value is %d”, nMyValue);
Use KdPrint if you want it to disappear in Free builds.
-----Original Message-----
From: Miguel Monteiro [mailto:xxxxx@criticalsoftware.com]
Sent: Wednesday, May 30, 2001 10:43 AM
To: NT Developers Interest List
Subject: [ntdev] A quick one: sprintf in KM?
Hi guys,
Sorry to bother you with such a silly question
but here goes:
What’s the quickest way of sending a formatted output from a km driver
to WinDbg?
[snip]
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
> DbgPrint(“My value is %d”, nMyValue);
Use KdPrint if you want it to disappear in Free builds.
Any such string must end with \r\n or SoftIce will display them incorrectly.
Max
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
Just “\n”, but you are absolutely right. I copied it straight from the OP’s
example code, without noticing the obvious. It will eventually show up,
when a newline char finally flushes the buffer, but that’s probably not the
intended behavior, based on the context of the OP’s code.
Phil
-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Wednesday, May 30, 2001 11:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: A quick one: sprintf in KM?
DbgPrint(“My value is %d”, nMyValue);
Use KdPrint if you want it to disappear in Free builds.
Any such string must end with \r\n or SoftIce will display them incorrectly.
Max
You are currently subscribed to ntdev as: xxxxx@intel.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
Thanx Phil, Max. 
I wasn’t sure if DbgPrint/KdPrint supported that…
«Humour and love are God’s answers
to Human weaknesses»
On Wednesday, May 30, 2001 9:34 PM “Phil Barila” wrote:
Just “\n”, but you are absolutely right. I copied it straight from the
OP’s
example code, without noticing the obvious. It will eventually show
up,
when a newline char finally flushes the buffer, but that’s probably not
the
intended behavior, based on the context of the OP’s code.
On Wednesday, May 30, 2001 11:22 AM “Maxim S. Shatskih” wrote:
> DbgPrint(“My value is %d”, nMyValue);
>
> Use KdPrint if you want it to disappear in Free builds.
Any such string must end with \r\n or SoftIce will display them
incorrectly.
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
DbgPrint is the right solution for your problem but it could be from
interest for you that sprintf as well as wsprintf and vsprintf are available
in KM (a version of stdio.h is provided with the DDK).
-----Original Message-----
From: Barila, Phil [mailto:xxxxx@intel.com]
Sent: Wednesday, May 30, 2001 7:47 PM
To: NT Developers Interest List
Subject: [ntdev] RE: A quick one: sprintf in KM?
DbgPrint(“My value is %d”, nMyValue);
Use KdPrint if you want it to disappear in Free builds.
-----Original Message-----
From: Miguel Monteiro [mailto:xxxxx@criticalsoftware.com]
Sent: Wednesday, May 30, 2001 10:43 AM
To: NT Developers Interest List
Subject: [ntdev] A quick one: sprintf in KM?
Hi guys,
Sorry to bother you with such a silly question
but here goes:
What’s the quickest way of sending a formatted output from a km driver
to WinDbg?
[snip]
You are currently subscribed to ntdev as: xxxxx@baslerweb.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
As I said, DDK won’t complain if I simply declare the sprintf function:
int __cdecl sprintf(char *, const char *, …);
he will happily compile the driver and use sprintf… But I wasn’t sure
it was a DDK specific version of stdio.h - that’s why I asked if an
#include <stdio.h> statement would be correct.
Anyway, Phil Barila and Max gave a good tip (I wasn’t sure
DbgPrint/KdPrint supported the same syntax). 
Thank you guys, 
Miguel Monteiro
xxxxx@criticalsoftware.com
www.criticalsoftware.com
------------------------------------------------------------
«Humour and love are God’s answers
to Human weaknesses»
------------------------------------------------------------
----- Original Message -----
From: “Moebius, V.”
To: “NT Developers Interest List”
Sent: Thursday, May 31, 2001 11:57 AM
Subject: [ntdev] RE: A quick one: sprintf in KM?
DbgPrint is the right solution for your problem but it could be from
interest for you that sprintf as well as wsprintf and vsprintf are
available
in KM (a version of stdio.h is provided with the DDK).
> -----Original Message-----
> From: Barila, Phil [mailto:xxxxx@intel.com]
> Sent: Wednesday, May 30, 2001 7:47 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: A quick one: sprintf in KM?
>
>
> DbgPrint(“My value is %d”, nMyValue);
>
> Use KdPrint if you want it to disappear in Free builds.
>
> -----Original Message-----
> From: Miguel Monteiro [mailto:xxxxx@criticalsoftware.com]
> Sent: Wednesday, May 30, 2001 10:43 AM
> To: NT Developers Interest List
> Subject: [ntdev] A quick one: sprintf in KM?
>
>
> Hi guys,
> Sorry to bother you with such a silly question
but here goes:
> What’s the quickest way of sending a formatted output from a km driver
> to WinDbg?
>
> [snip]
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@baslerweb.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@criticalsoftware.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</stdio.h>