All
I have a protocl driver running on W2k3 and later LH.
I abstraced writing debug msgs by wrapping it in a macro.
MyDbgPrint(MyComponnet, MyComponnetLogLevel, IN PCHAR Format, . .[arguments] );
It just resolves to DbgPrint after doing some prolog on whether to invoke DbgPrint or not depending on the MyComponnet and MyComponnetLogLevel for that component.
Basically provides another level of indirection where I can selectively see msgs belonging to only selected logical component (SEND, RCV, INIT, UNLOAd etc ) depending on MyComponentLogLevel (ERROR, WARNING, INFORMATION etc) of my protocol driver.
That way I can verbosity and severity of my components.
I call something like
MyDbgPrint(INIT, INFO, (“DriverEntry”));
Since my driver has to eventually run on LH, I wanted to use DbgPrintEx, but the problem with DbgPrintEx is
-it has 2 preceeding params before we can list the print va_list and va_args and
-it behaves as below.,
Not printed
DbgPrintEx(DPFLTR_IHVDRIVER_ID, 0xFFFFFFFF, (“DriverEntry”));
Printed
DbgPrintEx(DPFLTR_IHVDRIVER_ID, 0xFFFFFFFF, “DriverEntry”));
PS: Assume all masks, Filters are valid, enabled etc etc.
Q1) Can someone let me know why the first one does not print or how to make the first one print or (can MS make that format (with extra pair of braces) also to be printed ???).
I tried some macro stuff, but not able to come up with one that resolves to usable DbgPrintEx. I want
#define MyDbgPrint(MyComponnet, MyComponnetLogLevel, IN PCHAR Format, . .[arguments] );
to resolve to
DbgPrintEx(DPFLTR_IHVDRIVER_ID, 0xFFFFFFFF, IN PCHAR Format, . .[arguments]);
Q2) After I get this resolved, can I assume the following will alsways be printed irrespective of what the mask value is in registry or not have to set in dbgview or poke registry etc.
DbgPrintEx(DPFLTR_IHVDRIVER_ID, 0xFFFFFFFF, “XX”);
(I think) it should, but just want to confirm as DDK help makes conflicting statements on usability of DbgPrint in W2k3, LH and masks (WIN2000) etc.
–thanks