Macro aliases for WPP tracing

247 Views Asked by At

I started using WPP for tracing in my driver. I defined the macro DoTraceLevelMessage in order to support log level (similar to TraceDrv sample code). My tracing code looks like this:

DoTraceLevelMessage(TRACE_LEVEL_INFORMATION, DEFAULT_FLAG, "Driver is loaded");

This makes the tracing lines a little long, so I want to use some kind of aliases, for example:

#define LOG_INFO(msg,...) DoTraceLevelMessage(TRACE_LEVEL_INFORMATION, DEFAULT_FLAG, msg, __VA_ARGS__)

So the above code will look like this:

LOG_INFO("Driver is loaded");

I can't seem to make it work with WPP. I think WPP pre-processor runs before the compiler pre-processor so the above macro doesn't expand as I expect. I get the following compilation error:

1>test_driver.c(70): error C4013: 'WPP_CALL_test_driver_c70' undefined; assuming extern returning int
1>test_driver.c(70): error C2065: 'DEFUALT_FLAG': undeclared identifier

When I use the DoTraceLevelMessage macro, everything is ok. Any idea how can I define such aliases?

0

There are 0 best solutions below