Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I am working on adding a WPP trace logging support to a virtual storport miniport driver, but it is not working in my case only for this type of driver. For other kernel mode drivers (WDF, WDM), WPP trace logging support is working fine, and I can see the traces coming in TraceView.
Links referred:
• https://social.msdn.microsoft.com/Forums/azure/en-US/c42ba85c-37cd-46f7-9bfa-ff5829909544/physical-storport-miniport-and-wppcleanup?forum=wdk
• https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/wpp-preprocessor
• https://lists.openfabrics.org/pipermail/nvmewin/2014-October/001013.html
I referred to the above links and done the following implementation:
1. Added trace.h header file which includes=>
• WPP_CONTROL_GUIDS macro is defined
• Flags and levels macros are defined
• TraceEvents macro is defined
-scan:".\header\Trace.h" is added
For storage miniport driver:
• “stortrce.h” is included
• -gen:{km-StorDefault.tpl}*.tmh is added
Trace.h and the generated .tmh files are included in the source code files.
My case is, the support is working fine for other type of drivers when added, but it is not working for my virtual storport miniport driver. I am not getting any traces in the TraceView. Can you please tell me, am I missing anything for the virtual storport miniport drivers; Or, provide any links that I can refer, to correct my implementation.
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Internals & Software Drivers | 19-23 June 2023 | Live, Online |
Writing WDF Drivers | 10-14 July 2023 | Live, Online |
Kernel Debugging | 16-20 October 2023 | Live, Online |
Developing Minifilters | 13-17 November 2023 | Live, Online |
Comments
I've done this successfully in physical StorPort miniports but not a virtual one (yet...will be soon though for a project).
Are you calling WPP_INIT_TRACING with an initialized STORAGE_TRACE_INIT_INFO?
-scott
OSR
Global Variable:
PVOID TraceContext = NULL;
Yes, I am calling WPP_INIT_TRACING with an initialized STORAGE_TRACE_INIT_INFO as given below in the DriverEntry() function:
Also, have the cleanup routine as given below:
VOID WppCleanupRoutine(PVOID arg1)
{
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DRIVER, " WppCleanupRoutine\n");
}