diff --git a/.gitignore b/.gitignore index d92d5d4..2f7896d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ target/ -DriverCertificate.cer -.cargo-make-loadscripts/ diff --git a/Cargo.toml b/Cargo.toml index be76602..411f2d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["general/echo/kmdf/driver/*","general/echo/kmdf/exe"] +members = ["general/echo/kmdf/driver/*", "general/echo/kmdf/exe"] resolver = "2" [workspace.package] @@ -17,8 +17,8 @@ panic = "abort" lto = true [workspace.dependencies] -wdk = "0.1.0" -wdk-alloc = "0.1.0" -wdk-build = "0.1.0" -wdk-panic = "0.1.0" -wdk-sys = "0.1.0" +wdk = "0.2.0" +wdk-alloc = "0.2.0" +wdk-build = "0.2.0" +wdk-panic = "0.2.0" +wdk-sys = "0.2.0" diff --git a/Makefile.toml b/Makefile.toml index 6694102..3359623 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,14 +1,22 @@ -extend = ".cargo-make-loadscripts/rust-driver-makefile.toml" +extend = "target/rust-driver-makefile.toml" [env] CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true +WDK_BUILD_ADDITIONAL_INFVERIF_FLAGS = "/msft" [config] -load_script = """ -pwsh.exe -Command "\ -if ($env:CARGO_MAKE_CRATE_IS_WORKSPACE) { return };\ -$cargoMakeURI = 'https://raw.githubusercontent.com/microsoft/windows-drivers-rs/main/rust-driver-makefile.toml';\ -New-Item -ItemType Directory .cargo-make-loadscripts -Force;\ -Invoke-RestMethod -Method GET -Uri $CargoMakeURI -OutFile $env:CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY/.cargo-make-loadscripts/rust-driver-makefile.toml\ -" -""" +load_script = ''' +#!@rust +//! ```cargo +//! [dependencies] +//! wdk-build = "0.2.0" +//! ``` +#![allow(unused_doc_comments)] + +wdk_build::cargo_make::load_rust_driver_makefile()? +''' + +[tasks.default] +# Since this worspace contains both driver and non-driver crates, we need to explicitly specify `build` so that non-driver crates are still compiled +clear = true +dependencies = ["build", "package-driver-flow"] diff --git a/README.md b/README.md index fdd91bb..4ebbb14 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,10 @@ If build is successful, this will stamp the INF and create a CAT file placed wit `shutdown -r -t 0` 1. Copy the following to the DUT (Device Under Test: the computer you want to test the driver on): - 1. `.\target\..configuration..\package` - 1. `Path\To\Driver\DriverCertificate.cer` + 1. The driver `package` folder located in the [Cargo Output Directory](https://doc.rust-lang.org/cargo/guide/build-cache.html). The Cargo Output Directory changes based off of build profile, target architecture, etc. + * Ex. `\target\x86_64-pc-windows-msvc\debug\package`, `\target\x86_64-pc-windows-msvc\release\package`, `\target\aarch64-pc-windows-msvc\debug\package`, `\target\aarch64-pc-windows-msvc\release\package`, + `\target\debug\package`, + `\target\release\package` 1. The version of `devgen.exe` from the WDK Developer Tools that matches the archtecture of your DUT * Ex. `C:\ewdk\Program Files\Windows Kits\10\Tools\10.0.22621.0\x64\devgen.exe` 1. Install the Certificate on the DUT: @@ -82,6 +84,7 @@ If build is successful, this will stamp the INF and create a CAT file placed wit 1. Click Install Certificate 1. Store Location: Local Machine -> Next 1. Place all certificates in the following Store -> Browse -> Trusted Root Certification Authorities -> Ok -> Next + 1. Repeat 2-4 for Store -> Browse -> Trusted Publishers -> Ok -> Next 1. Finish 1. Install the driver from Admin Command Prompt: 1. In the package directory, run: `pnputil.exe /add-driver echo_2.inf /install` diff --git a/general/echo/kmdf/driver/DriverSync/Cargo.toml b/general/echo/kmdf/driver/DriverSync/Cargo.toml index 292ba46..3d29c53 100644 --- a/general/echo/kmdf/driver/DriverSync/Cargo.toml +++ b/general/echo/kmdf/driver/DriverSync/Cargo.toml @@ -6,6 +6,8 @@ rust-version = "1.72.1" edition.workspace = true publish.workspace = true +[package.metadata.wdk] + [lib] crate-type = ["cdylib"] diff --git a/general/echo/kmdf/exe/Makefile.toml b/general/echo/kmdf/exe/Makefile.toml deleted file mode 100644 index e1d467e..0000000 --- a/general/echo/kmdf/exe/Makefile.toml +++ /dev/null @@ -1,4 +0,0 @@ -# Test apps do not need the driver signing process so skip the workspace signing setup -[tasks.sign] -clear = true -dependencies = ["build"]