windows-drivers-rs icon indicating copy to clipboard operation
windows-drivers-rs copied to clipboard

feat: configure WDK configuration via parsing Cargo manifest metadata

Open wmmc88 opened this issue 7 months ago • 3 comments

This PR enables configuring the WDK Metadata via [metadata.wdk] tags in Cargo manifests.

As a consequence of that new feature, several other changes were required:

  • Added minimal Sample WDM and UMDF drivers
  • Make all driver packaging tooling (ex. signing, cat generation, etc) support WDM and UMDF
  • Serde Serializer added to export WDKMetadata configuration to a structured format
  • Emit that structured format so that downstream code can cfg based off of certain WDK configuration parameters * A wdf.c file is compiled and linked in to provide the __declspec(selectany) that are not generated by bindgen
  • Have several templates that generate rust code in wdk-sys's build.rs that is otherwise not possible to generate conditionally (ex. call_unsafe_wdf_function_binding definition that points to OUT_DIR, WDFFUNCTIONS symbol name that depends on configuration, WDF_FUNCTION_TABLE definition whose size depends on configuration, etc.)
  • remove local generated_bindings copy of bindings
  • exporting via links keys in cargo manifests is deprecated

resolves #82

wmmc88 avatar Jul 18 '24 17:07 wmmc88