From 98cf4d7298910ed344a4fee805f64cfa4a10cf86 Mon Sep 17 00:00:00 2001 From: Leonid Bloch Date: Thu, 21 Jan 2016 09:43:38 +0200 Subject: [PATCH] UsbDk: Added documentation on WDF log generation Also added a .reg file to quickly add the registry settings needed for the log generation. Signed-off-by: Leonid Bloch Signed-off-by: Dmitry Fleytman --- Documentation/WdfLogDumping.txt | 59 +++++++++++++++++++++++++++++++++ Tools/RegSettingsForWdfLog.reg | 8 +++++ 2 files changed, 67 insertions(+) create mode 100644 Documentation/WdfLogDumping.txt create mode 100644 Tools/RegSettingsForWdfLog.reg diff --git a/Documentation/WdfLogDumping.txt b/Documentation/WdfLogDumping.txt new file mode 100644 index 0000000..05ea383 --- /dev/null +++ b/Documentation/WdfLogDumping.txt @@ -0,0 +1,59 @@ +1) Download and install the latest version of UsbDk, if you haven't done so + already. It is available from: + + https://github.com/daynix/UsbDk/releases + +2) Download the latest WDK from here: + + https://msdn.microsoft.com/en-us/windows/hardware/hh852365.aspx + + Look for the link named "Download WDK 8.1 Update", or whatever the latest + version is. It is advised to use the latest version always. + +3) Enable local kernel-mode debugging: + + a) Open a Command Prompt window as the Administrator. + b) Enter "bcdedit /debug on". + c) Enter "bcdedit /dbgsettings local". + d) Reboot the computer. + +4) Set logging parameters for UsbDk: run the "Tools/RegSettingsForWdfLog.reg" + file from UsbDk source tree on the intended machine. + + * ALTERNATIVELY, these, and other settings can be set using a GUI: + + a) Launch WdfVerifier. Its default path should look like that: + "C:\Program Files (x86)\Windows Kits\8.1\Tools\x64\wdfverifier.exe" + b) Under the "WDF Drivers" tab look for "UsbDk.sys" and click the plus sign + near it. Change the following settings (right-click to change): + + i) Set VerifierOn to "ON" + ii) Set VerboseOn to "ON" + iii) Set LogPages to "16" + iv) Set VerifyDownLevel to "ON" + + c) Click "Apply", and reboot the machine if prompted. + +5) Start the WinDbg debugger, that was installed as a part of WDK: + + a) Open a Command Prompt window as the Administrator. + b) Change directory to where WinDbg is installed. FOR EXAMPLE: + 'cd "C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x64"' + c) Run WinDbg connected to the local machine: "windbg -kl" + d) Load the WDF debugger extension: + "!load wdfkd.dll" + e) Load the system symbols: + ".symfix+" + ".reload" + f) Specify the WDF .tmf file. FOR EXAMPLE: + "!wdftmffile C:\temp\Wudf01011.tmf" + + * The default path to this file looks like: + "C:\Program Files (x86)\Windows Kits\8.1\Tools\x64\Tracing", + but it is necessary to copy it to some folder with no spaces in its + name, such as "C:\temp\", in the example above. + * Please make sure to choose the file for the correct WDF version, it is + 1.11 in the example above. + +6) Dump the log with "!wdflogdump .sys". FOR EXAMPLE: + "!wdflogdump usbdk.sys" diff --git a/Tools/RegSettingsForWdfLog.reg b/Tools/RegSettingsForWdfLog.reg new file mode 100644 index 0000000..2f37b8d --- /dev/null +++ b/Tools/RegSettingsForWdfLog.reg @@ -0,0 +1,8 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbDk\Parameters\Wdf] +"VerifierOn"=dword:00000001 +"VerboseOn"=dword:00000001 +"LogPages"=dword:00000010 +"VerifyDownLevel"=dword:00000001 +"EnhancedVerifierOptions"=dword:00000001