Skip to content

Commit

Permalink
UsbDk: Added documentation on WDF log generation
Browse files Browse the repository at this point in the history
Also added a .reg file to quickly add the registry settings needed for
the log generation.

Signed-off-by: Leonid Bloch <[email protected]>
Signed-off-by: Dmitry Fleytman <[email protected]>
  • Loading branch information
blochl authored and Dmitry Fleytman committed Jan 21, 2016
1 parent c573972 commit 98cf4d7
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
59 changes: 59 additions & 0 deletions Documentation/WdfLogDumping.txt
Original file line number Diff line number Diff line change
@@ -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 <driver_name>.sys". FOR EXAMPLE:
"!wdflogdump usbdk.sys"
8 changes: 8 additions & 0 deletions Tools/RegSettingsForWdfLog.reg
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 98cf4d7

Please sign in to comment.