Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ jobs:
tool: cargo-make

- name: Build and Package Sample Drivers
run: cargo make default +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }}
# Unset RUSTFLAGS for cargo-make to work around RUSTFLAGS leaking into
# rust-script compilation of wdk-build (path dep via symlink defeats
# --cap-lints). Upstream fix: microsoft/windows-drivers-rs#629
run: |
$env:RUSTFLAGS = $null
cargo make default +${{ matrix.rust_toolchain }} --locked --profile ${{ matrix.cargo_profile }} --target ${{ matrix.target_triple.name }}
shell: pwsh

# Steps to use cargo-wdk to build and package drivers
- name: Install cargo-wdk binary
Expand Down
4 changes: 2 additions & 2 deletions general/echo/kmdf/driver/DriverSync/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
use wdk::{nt_success, paged_code, println};
use wdk_sys::{
call_unsafe_wdf_function_binding,
_WDF_EXECUTION_LEVEL,
_WDF_SYNCHRONIZATION_SCOPE,
NTSTATUS,
STATUS_SUCCESS,
WDFDEVICE,
Expand All @@ -13,8 +15,6 @@ use wdk_sys::{
WDF_NO_HANDLE,
WDF_OBJECT_ATTRIBUTES,
WDF_PNPPOWER_EVENT_CALLBACKS,
_WDF_EXECUTION_LEVEL,
_WDF_SYNCHRONIZATION_SCOPE,
};

use crate::{
Expand Down
8 changes: 4 additions & 4 deletions general/echo/kmdf/driver/DriverSync/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ use wdk::{nt_success, paged_code, println, wdf};
use wdk_sys::{
call_unsafe_wdf_function_binding,
ntddk::{ExAllocatePool2, ExFreePool},
_WDF_EXECUTION_LEVEL,
_WDF_IO_QUEUE_DISPATCH_TYPE,
_WDF_SYNCHRONIZATION_SCOPE,
_WDF_TRI_STATE,
NTSTATUS,
POOL_FLAG_NON_PAGED,
SIZE_T,
Expand All @@ -25,10 +29,6 @@ use wdk_sys::{
WDF_NO_HANDLE,
WDF_OBJECT_ATTRIBUTES,
WDF_TIMER_CONFIG,
_WDF_EXECUTION_LEVEL,
_WDF_IO_QUEUE_DISPATCH_TYPE,
_WDF_SYNCHRONIZATION_SCOPE,
_WDF_TRI_STATE,
};

use crate::{
Expand Down
8 changes: 4 additions & 4 deletions general/echo/kmdf/exe/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ fn async_io_work(io_type: u32) -> Result<(), Box<dyn Error>> {
// - Memory safety: Returns u32 value (no pointer dereferences)
let error = unsafe { GetLastError() };
if error != ERROR_IO_PENDING {
return Err(format!("{i}th Read failed {error}",).into());
return Err(format!("{i}th Read failed {error}").into());
}
}
} else {
Expand Down Expand Up @@ -488,7 +488,7 @@ fn async_io_work(io_type: u32) -> Result<(), Box<dyn Error>> {
}

if io_type == READER_TYPE {
println!("Number of bytes read by request number {i} is {number_of_bytes_transferred}",);
println!("Number of bytes read by request number {i} is {number_of_bytes_transferred}");

if globals.limited_loops {
remaining_requests_to_receive -= 1;
Expand Down Expand Up @@ -539,7 +539,7 @@ fn async_io_work(io_type: u32) -> Result<(), Box<dyn Error>> {
}
} else {
println!(
"Number of bytes written by request number {i} is {number_of_bytes_transferred}",
"Number of bytes written by request number {i} is {number_of_bytes_transferred}"
);

if globals.limited_loops {
Expand Down Expand Up @@ -636,7 +636,7 @@ fn get_device_path(interface_guid: &Uuid) -> Result<(), Box<dyn Error>> {

if config_ret != DeviceAndDriverInstallation::CR_SUCCESS {
return Err(
format!("Error 0x{config_ret:08X} retrieving device interface list size.",).into(),
format!("Error 0x{config_ret:08X} retrieving device interface list size.").into(),
);
}

Expand Down
4 changes: 2 additions & 2 deletions tools/dv/kmdf/fail_driver_pool_leak/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use wdk::{nt_success, paged_code, println};
use wdk_sys::{
call_unsafe_wdf_function_binding,
ntddk::ExAllocatePool2,
_WDF_EXECUTION_LEVEL,
_WDF_SYNCHRONIZATION_SCOPE,
DRIVER_OBJECT,
NTSTATUS,
PCUNICODE_STRING,
Expand All @@ -19,8 +21,6 @@ use wdk_sys::{
WDF_NO_HANDLE,
WDF_NO_OBJECT_ATTRIBUTES,
WDF_OBJECT_ATTRIBUTES,
_WDF_EXECUTION_LEVEL,
_WDF_SYNCHRONIZATION_SCOPE,
};

use crate::{GLOBAL_BUFFER, GUID_DEVINTERFACE};
Expand Down
Loading