Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 2  
10 Nov 17 10:54
Arie Elazar
xxxxxx@perasotech.com
Join Date: 10 Nov 2017
Posts To This List: 1
Define WPP custom data type

Hi, I'm trying to enable WPP tracing, while the requirement is to be backward compatible to existing trace format. I have the next print macro that should work with WPP Existing Format: #define MAC_ADDRESS_PRINTF_FORMAT "%02x:%02x:%02x:%02x:%02x:%02x" #define MAC_ADDRESS_PRINTF(addr) \ addr[0], \ addr[1], \ addr[2], \ addr[3], \ addr[4], \ addr[5] Print(MODULE_A, TRACE_ERROR, "RX PeerMacAddr=" MAC_ADDRESS_PRINTF_FORMAT, MAC_ADDRESS_PRINTF(peer_address)); For printing the same log with WPP infrastructure I used the WPP DEFINE_CPLX_TYPE and defined MAC_ADDRESS_PRINTF_FORMAT MAC_ADDRESS_PRINTF. // begin_wpp config // DEFINE_CPLX_TYPE(MACADDRESS, WPP_LOGMACADDRESSDUMP, const unsigned char*, ItemMacAddr, "s", _MAC_ADDR_, 0, 1); // WPP_FLAGS(-DWPP_LOGMACADDRESSDUMP(addr) WPP_LOGPAIR(6, (addr)) ); // end_wpp #define MAC_ADDRESS_PRINTF_FORMAT "%!MACADDRESS!" #define MAC_ADDRESS_PRINTF(_addr) _addr Unfortunately I'm getting following error wpp: (parseLegacy) 0 argument(s) expected, argument(s) supplied: 1 It seems like WPP preprocessor is not taking into account my define for MAC_ADDRESS_PRINTF_FORMAT. While replacing MAC_ADDRESS_PRINTF_FORMAT with "%!MACADDRESS! it is working fine. Any suggestion on how something like this could be achieved would be appreciated. Thanks. --
  Message 2 of 2  
10 Nov 17 13:31
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11654
Define WPP custom data type

xxxxx@perasotech.com wrote: >   > > I’m trying to enable WPP tracing, while the requirement is to be > backward compatible to existing trace format. > > ... >   > > For printing the same log with WPP infrastructure I used the WPP >  DEFINE_CPLX_TYPE and defined MAC_ADDRESS_PRINTF_FORMAT <...excess quoted lines suppressed...> As the name implies, WPP is a pre-processor.  It does its work before compilation starts, which means it is scanning your code before the C pre-processor has done its thing.  It does not do the same string substitution that the C pre-processor does, so it's not expanding your macro.  You will probably need to supply the string instead of the symbol. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 00:34.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license