exit on failed macro using PRE and POST forms of WPP

Hi ,

I am trying to get the PRE and POST forms of WPP working as explained in the microsft tracedrv sample.

I already have one customized trace message “TraceEvents” defined in traceDrv.h file .

// begin_wpp config
// FUNC TraceEvents(LEVEL, FLAGS, MSG, …);
// end_wpp

Now I want to add one more customized trace message which should only print incase of failure condition and I am doing below in the same traceDrv.h file

//begin_wpp config
//USEPREFIX (TRACE_RETURN, “%!STDPREFIX!”);
//FUNC TRACE_RETURN{FLAG=DBG_INIT}(EXP);
//USESUFFIX (TRACE_RETURN, “Function Return=%!STATUS!”,EXP);
//end_wpp
#define WPP_FLAG_EXP_PRE(FLAGS, HR) {if (HR != STATUS_SUCCESS) {
#define WPP_FLAG_EXP_POST(FLAGS, HR) ;}}
#define WPP_FLAG_EXP_ENABLED(FLAGS, HR) WPP_FLAG_ENABLED(FLAGS)
#define WPP_FLAG_EXP_LOGGER(FLAGS, HR) WPP_FLAG_LOGGER(FLAGS)

and then when i call “TRACE_RETURN(status)” in the source file I get weird compilation errors like below
Error C4013 ‘WPP_RECORDER_FLAG_EXP_FILTER’ undefined; assuming extern returning int
Error C2065 ‘DBG_INIT’: undeclared identifier
Error C4013 ‘WPP_RECORDER_FLAG_EXP_ARGS’ undefined; assuming extern returning int
Warning C4022 ‘WPP_RECORDER_SF_d’: pointer mismatch for actual parameter 1
Warning C4047 ‘function’: ‘ULONG’ differs in levels of indirection from ‘const GUID *’
Warning C4024 ‘WPP_RECORDER_SF_d’: different types for formal and actual parameter 3
Warning C4242 ‘function’: conversion from ‘NTSTATUS’ to ‘USHORT’, possible loss of data
Error C2198 ‘WPP_RECORDER_SF_d’: too few arguments for call

am i missing some more setting in the proj file or something ? Please help