Would you believe:
KdPrint((“My value is %d\n”, nMyValue));
Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@Broadstor.com
xxxxx@inland.net
-----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?
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: xxxxx@broadstor.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></stdio.h>
OK, I was happy to help, but your response leads to an obvious question.
Did you not read the docs on DbgPrint, which explicitly state that DbgPrint
supports the same formatting specs as printf, before asking your question?
-----Original Message-----
From: Miguel Monteiro [mailto:xxxxx@criticalsoftware.com]
Sent: Thursday, May 31, 2001 4:22 AM
To: NT Developers Interest List
Subject: [ntdev] RE: A quick one: sprintf in KM?
[snip]
Anyway, Phil Barila and Max gave a good tip (I wasn’t sure
DbgPrint/KdPrint supported the same syntax).
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 a note on DbgPrint:
Better do not use something like ‘DbgPrint(lpSomeString)’. If
lpSomeString is Data that you do not directly control(e.g. contents of
packet). It may happen that the string has format identifiers in it.
This leads to unpredictable results.
To circumvent that use ‘DbgPrint(“%s”,lpSomeString)’.
Sorry, if this was to obvious and trivial ?
By the way: Does a not interpreting output function exist ?
| Norbert Kawulski | mailto:xxxxx@stollmann.de |
| Stollmann T.P.GmbH, Development | http://www.stollmann.de |
–If it’s ISDN or Bluetooth, make sure it’s driven by Stollmann–
“The most difficult thing in the world is to know how to do a thing
and watch someone doing it wrong, without commenting - T.H. White”
OK, I was happy to help, but your response leads to an obvious question.
Did you not read the docs on DbgPrint, which explicitly state that DbgPrint
supports the same formatting specs as printf, before asking your question?
-----Original Message-----
From: Miguel Monteiro [mailto:xxxxx@criticalsoftware.com]
Sent: Thursday, May 31, 2001 4:22 AM
To: NT Developers Interest List
Subject: RE: A quick one: sprintf in KM?
[snip]
Anyway, Phil Barila and Max gave a good tip (I wasn’t sure
DbgPrint/KdPrint supported the same syntax).
You are currently subscribed to ntdev as: xxxxx@stollmann.de
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