Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add driver-install packaging metadata + support for INF only drivers #246

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

ayodejiige
Copy link

@ayodejiige ayodejiige commented Nov 16, 2024

This PR introduces support for building INF-only Windows drivers, which are drivers without a driver binary. INF-only drivers are typically used for:

  1. Extension INFs: These are installed on base drivers to customize them. For more information, see Using an Extension INF File.
  2. NULL Drivers: These can be used for various purposes, such as setting configuration on a device node and installing a Win32 service application.

Note: This PR include support for a new WDK metadata to enable copying additional files to the driver package folder. This particular feature is not exclusive to INF drivers only.

Summary of Changes

  • Add new driver type PACKAGE for INF only drivers to the WDK metadata i.e. wdk.driver-model.driver-type
  • Add new configuration to WDK metadata wdk.driver-install.package-files to enable copying addition files to the driver package folder.
  • Updated the wdk-build to support the additions to the WDK metadata.
  • Added copy-package-files-to-package task to rust-driver-makefile.toml file. The copies the files listed the wdk.driver-install.package-files metadata to the driver package folder.
  • Ensured that tasks in rust-driver-makefile.toml that are required for driver binaries are skipped for PACKAGE driver type.
  • Implemented functions in cargo_make.rs to support the changes in rust-driver-makefile.toml.
  • Added sample inf only driver which is a null driver that installs an sample application into the driver store.

/// User Mode Driver Framework
Umdf(UmdfConfig),
/// INF only drivers e.g. null drivers and extension INFs
Package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wmmc88 wmmc88 changed the title feat: Enable build for INF only drivers feat: Add driver-install packaging metadata + support for INF only drivers Nov 19, 2024
@@ -303,6 +303,24 @@ args = [
private = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if wdk_build_package_matches.len() != 1 {

Previously, there was an assumption that there must be wdk-build in the workspace. This is no longer true now there can be a null driver in the workspace without any actual driver code being built (so no wdk-build in the graph).

In the wdk-build only case, we should also see if putting a workspace dep on wdk-build yields anything in the cargo metadata output.

maybe also worth putting a specific message for the case of no-wdk in workspace since that would typically be a null-driver-only workspace scenario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants