First, sorry about it not being a “real” reply wrt threading the
answers. Outlook auto-encodes and cannot be told not to. Thus, if the
source uses specific encodings (which ones, I don’t know), replies from
Outlook 2007 are rejected. PITA, but it’s what we have to live with. >>
Please look at the Vista WDK’s CDROM.SYS sample code, specifically
trace.h, where it defines the method to log a binary blob:
// define the ‘xstr’ structure for logging buffer and length pairs
// and the ‘log_xstr’ function which returns it to create one in-place.
// this enables logging of complex data types.
typedef struct xstr { char * _buf; short _len; } xstr_t;
__inline xstr_t log_xstr( size_t length, void * p) {
if (length >= MAXSHORT) {
xstr_t xs = {(char*)p,MAXSHORT};
return xs;
} else {
xstr_t xs = {(char*)p,(SHORT)length};
return xs;
}
}
// define the macro required for a hexdump
// use as:
// DoTrace(( “%!HEXDUMP!\n”, log_xstr(buffersize,(char *)buffer) ));
//
#define WPP_LOGHEXDUMP(x) WPP_LOGPAIR(2, &((x)._len))
WPP_LOGPAIR((x)._len, (x)._buf)
This gets dumped as a hex blob (similar to 'db
' in the
debugger) which sounds like what you want.
Henry Gabryjelski
Senior Software Development Engineer
US - Windows Device Experience
Microsoft Corporation
-----Original Message-----
From: xxxxx@rediffmail.com [mailto:xxxxx@rediffmail.com]
Sent: Monday, July 23, 2007 10:26 PM
Subject: RE: Logging binary data using WPP
So it looks like I have to have my own version of tracefmt.exe which
acts normally for trace messages by driver but differently for
len/buffer pair (firmware messages). Is there no other way to tell the
tracefmt.exe either as a command line argument or using WPP macros from
driver to act differently? The idea of coming up with an alternate to
tracefmt.exe looks like an overkill to me...
Thanks,
Aniketa