Skip to content

Commit

Permalink
Update to DV-FailDriver-WDM (microsoft#823)
Browse files Browse the repository at this point in the history
* Removed unsupported install section

- This change removes the unsupported install method from the .inf file.

* Updated readme with DevGen example

- Add section to readme to encourage the usage of DevGen.
- Added example of how to use DevGen when installing sample driver.

* Update readme

- updated README.md based on the given suggestions

* More updates to readme

- added link to SwDevice
- fixed missing back tick
  • Loading branch information
matthesoundman authored Jan 9, 2023
1 parent 995dd62 commit 921e951
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 16 additions & 0 deletions tools/dv/samples/DV-FailDriver-WDM/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ The DV-FailDriver-WDM sample driver contains intentional code errors that are de

See [Deploying a Driver to a Test Computer](https://docs.microsoft.com/windows-hardware/drivers/develop/deploying-a-driver-to-a-test-computer) for details on how to deploy the sample.

#### New

It is highly encouraged when testing a driver to use [DevGen](https://learn.microsoft.com/windows-hardware/drivers/devtest/devgen) to create a [SwDevice](https://learn.microsoft.com/windows/win32/api/_swdevice/).

__DevGen Usage Example__

1. From a terminal (running as admin) on test computer go to the WDK tools path and run `.\devgen /add /bus SWD /hardwareid root\defect_toastmon`. ***If WDK is not available on test computer, simply copy over `devgen.exe`***

2. There is now a `Generic software device` available in the system. ***Use Device Manager as a simple means to inspect or from a terminal run `pnputil /enum-devices /deviceid "root\defect_toastmon"`.***

3. Now that there is a device with the appropriate hardware ID, deploy/install driver sample accordingly.

> Note: Use `.\devgen /remove "<Device instance path>"` to remove SW device (the path can be copied from output of `.\devgen /add` or from Device Manager).
>
> Device instance path example `"SWD\DEVGEN\{D0299946-2EC2-C146-B00B-E01144166F8B}"`
## Test the sample

See [How to test a driver at runtime](https://docs.microsoft.com/windows-hardware/drivers/develop/how-to-test-a-driver-at-runtime-from-a-command-prompt) for details on how to run tests on the Toastmon driver.
Expand Down
3 changes: 0 additions & 3 deletions tools/dv/samples/DV-FailDriver-WDM/driver/defect_toastmon.inf
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ StartType = 1 ; SERVICE_SYSTEM_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\defect_toastmon.sys

[DeviceInstall32]
AddDevice=ROOT\Samples\0001,,ToastMonbuggy

[ToastMonBuggy]
HardwareIds=root\defect_toastmon

Expand Down

0 comments on commit 921e951

Please sign in to comment.