IT tutorials
 
Technology
 

Windows 7 : Kernel Mode Installation and Build - Debugging Macros and Routines, WDF Debugger Extension Commands

11/26/2013 8:21:32 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

1. Debugging Macros and Routines

KMDF drivers can include any of the standard debugging macros and routines, such as ASSERT or DbgPrintEx. Several routines and macros are also specific to WDF as summarized in Table 1.

Table 1. Debugging Macros
CategoryTests
WdfVerifierDbgBreakPointThis routine breaks into the debugger if the DbgBreakOnError value is set in the registry.
WDFVERIFYIf the VerifyOn value is set in the registry, this macro tests a logical expression and breaks into the kernel debugger if the expression evaluates to FALSE. Unlike ASSERT, this macro is included in both checked and free builds.
VERIFY_IS_IRQL_PASSIVE_LEVELIf the VerifyOn value is set in the register, this macro breaks into the kernel debugger if the driver is not executing at IRQL=PASSIVE_LEVEL.

2. WDF Debugger Extension Commands

KMDF includes a set of debugger extension commands that can be invoked in the debugger’s command window to obtain a variety of WDF-related data. The output often includes command strings that can be pasted into the command line to retrieve additional related information. Table 2 shows some of the more commonly used commands.

Table 2. Debugger Extension Commands
CategoryTests
!wdfhelpDisplays the list of debugger extensions.
!wdfcrashdumpDisplays a crash dump that includes the framework’s log information.
!wdfdeviceDisplays information that is associated with a WDFDEVICE-typed handle.
!wdfdevicequeuesDisplays information about all the queue objects that belong to a specified device.
!wdfdriverinfoDisplays information about a framework-based driver, such as its run-time version and hierarchy of object handles.
!wdfhandleDisplays information about a specified KMDF handle.
!wdfIotargetDisplays information about a WDFIOTARGET-typed object handle.
!wdfdrDisplays all loaded WDF drivers.
!wdfIodumpDisplays the framework’s log information.
!wdfqueueDisplays information about a WDFQUEUE-typed object handle.
!wdfrequestDisplays information about a WDFREQUEST-typed object handle.

When KMDF Verifier is enabled, several of the WDF debugger extension commands provide more information than is available otherwise. For example, !wdfdriverinfo reports leaked handles.

The code for the WDF debugger extensions is contained in a DLL that is named wdfkd.dll. The DLL is included with WDK debugging tools and is stored in Program Files\Debugging Tools for Windows\winext. Check it against the most recent version of the DLL, which is included with the latest KMDF distribution. Wdfkd.dll is stored under WinDDK\BuildNumber\bin\. There are actually three versions of wdfkd.dll, one for each supported architecture (amd64, Intel Itanium, or x86). If necessary, overwrite the version that came with the debugger with the most recent version.

3. Using WPP Tracing with a KMDF Driver

WPP tracing works in essentially the same way with a KMDF driver as it does with a WDM driver. However, KMDF provides hundreds of framework-specific tracing messages. To enable KMDF support for WPP, include the following RUN_WPP directive in the project’s Sources file:

RUN_WPP = $(SOURCES)                   \
-km \
-func:TraceEvents(LEVEL,FLAGS,MSG,...) \
-gen:{km-WdfDefault.tpl}*.tmh
 
Others
 
- Microsoft Excel 2010 : Introducing the Excel Web App - Sharing a Workbook, Interacting with a Sheet Online
- Microsoft Excel 2010 : Uploading and Downloading Workbooks (part 2) - Saving to SkyDrive from Excel, Saving a File to Your Local Drive
- Microsoft Excel 2010 : Uploading and Downloading Workbooks (part 1) - Accessing the SkyDrive, Uploading with Windows Live
- Microsoft Excel 2010 : Introducing the Excel Web App - Acquiring a Windows Live ID
- Deploying Windows in a Windows Server 2008 R2 Environment (part 6) - Practice Create a Windows PE CD
- Deploying Windows in a Windows Server 2008 R2 Environment (part 5) - Windows Deployment Methods - Windows Deployment Services
- Deploying Windows in a Windows Server 2008 R2 Environment (part 4) - Windows Deployment Methods - Installing from the Product DVD, Network Share Distribution
- Deploying Windows in a Windows Server 2008 R2 Environment (part 3) - Windows Deployment Fundamentals - Deployment Image Servicing and Management
- Deploying Windows in a Windows Server 2008 R2 Environment (part 2) - Windows Deployment Fundamentals - Windows Automated Installation Kit Tools
- Deploying Windows in a Windows Server 2008 R2 Environment (part 1) - Windows Deployment Fundamentals - Understanding WIM Files
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us