-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix!: explicitly mark _KGDTENTRY64
and _KIDTENTRY64
as opaque types in bindgen
#277
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 24 out of 39 changed files in this pull request and generated 2 comments.
Files not reviewed (15)
- .vscode/settings.json: Language not supported
- crates/wdk-sys/src/input.h: Language not supported
- crates/wdk-sys/src/wdf.c: Language not supported
- .github/workflows/code-formatting-check.yaml: Evaluated as low risk
- .github/workflows/codeql.yml: Evaluated as low risk
- .github/workflows/build.yaml: Evaluated as low risk
- Cargo.toml: Evaluated as low risk
- crates/wdk-sys/src/ntddk.rs: Evaluated as low risk
- crates/wdk-build/src/bindgen.rs: Evaluated as low risk
- CONTRIBUTING.md: Evaluated as low risk
- .github/workflows/docs.yaml: Evaluated as low risk
- crates/wdk-sys/Cargo.toml: Evaluated as low risk
- crates/wdk-sys/src/lib.rs: Evaluated as low risk
- .github/workflows/test.yaml: Evaluated as low risk
- .github/workflows/lint.yaml: Evaluated as low risk
Comments suppressed due to low confidence (3)
crates/wdk-sys/src/hid.rs:13
- The
reason
parameter is not valid for the#[allow]
attribute. It should be removed.
#[allow(missing_docs, reason = "most items in the WDK headers have no inline documentation, so bindgen is unable to generate documentation for their bindings")]
crates/wdk-sys/src/hid.rs:19
- The
reason
parameter is not valid for the#[allow]
attribute. It should be removed.
#[allow(clippy::wildcard_imports, reason = "the underlying c code relies on all type definitions being in scope, which results in the bindgen generated code relying on the generated types being in scope as well")]
crates/wdk-sys/build.rs:47
- The usage of
unreachable!
macro might not be the best way to handle unexpected configurations. Consider using a more descriptive error message or handle the case more gracefully.
unreachable!("generate_wdf_function_table is only called with WDF driver configurations")
wmmc88
force-pushed
the
opaque-missing-km-structs
branch
3 times, most recently
from
January 25, 2025 04:07
85dc60f
to
d8c1e96
Compare
…s in bindgen BREAKING CHANGE: defintions for `_KGDTENTRY64` and `_KIDTENTRY64` have been removed
wmmc88
force-pushed
the
opaque-missing-km-structs
branch
from
January 30, 2025 05:04
d8c1e96
to
15d65ba
Compare
wmmc88
changed the title
fix!: explicitly mark _KGDTENTRY64 and _KIDTENTRY64 as opaque types in bindgen
fix!: explicitly mark Jan 30, 2025
_KGDTENTRY64
and _KIDTENTRY64
as opaque types in bindgen
hamzamust
previously approved these changes
Jan 30, 2025
leon-xd
previously approved these changes
Jan 30, 2025
wmmc88
force-pushed
the
opaque-missing-km-structs
branch
from
January 31, 2025 19:12
5d3d02b
to
6afddc0
Compare
ayodejiige
approved these changes
Jan 31, 2025
hamzamust
approved these changes
Jan 31, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the
wdk-build
crate to improve its functionality and maintainability. The most important changes include explicitly marking_KGDTENTRY64
and_KIDTENTRY64
as opaque types and adding new tests for thebindgen_header_contents
method.The new types are generated as:
and replace the historic structs that were manually added to the bindgen input header. These historic structs are no longer present in modern WDK headers, and these types should be treated as opaque.
Cfg Updates:
crates/wdk-build/build.rs
: Updated the cfg name fromnightly_feature
tonightly_toolchain
to reflect its purpose of enabling when the toolchain is detected as nightly.Blocklist Additions:
crates/wdk-build/src/bindgen.rs
: Changed_KGDTENTRY64
and_KIDTENTRY64
to be explicitly marked as opaque as they have no definitions in WDK.Typo Fix:
crates/wdk-build/src/lib.rs
: Corrected a typo in a comment from "processs" to "process".Code Refactoring:
crates/wdk-build/src/lib.rs
: Refactored thebindgen_header_contents
method to useflat_map
andcollect
for improved readability and performance. Removed the hardcoded definitions forKGDTENTRY64
andKIDTENTRY64
.Test Additions:
crates/wdk-build/src/lib.rs
: Added new tests for thebindgen_header_contents
method to ensure it generates the correct headers for different driver configurations (Wdm
,Kmdf
, andUmdf
).BREAKING CHANGE: definitions for
_KGDTENTRY64
and_KIDTENTRY64
have been removed