-
Notifications
You must be signed in to change notification settings - Fork 110
feat: add bindings for network headers (WFP only) #595
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -335,6 +335,8 @@ pub enum ApiSubset { | |||||||||||||
| Storage, | ||||||||||||||
| /// API subset for USB (Universal Serial Bus) drivers: <https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/_usbref/> | ||||||||||||||
| Usb, | ||||||||||||||
| /// API subset for network drivers: <https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/_netvista/> | ||||||||||||||
| Network, | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| #[derive(Debug, Error, PartialEq, Eq)] | ||||||||||||||
|
|
@@ -687,21 +689,25 @@ impl Config { | |||||||||||||
| // ] | ||||||||||||||
| // .into_iter() | ||||||||||||||
| // .map(|(key, value)| (key.to_string(), value.map(|v| v.to_string()))) | ||||||||||||||
| let mut defs = vec![("NDIS_SUPPORT_NDIS6", None)]; | ||||||||||||||
|
|
||||||||||||||
|
Comment on lines
+692
to
+693
|
||||||||||||||
| let mut defs = vec![("NDIS_SUPPORT_NDIS6", None)]; | |
| let mut defs = Vec::new(); | |
| if cfg!(feature = "network") { | |
| defs.push(("NDIS_SUPPORT_NDIS6", None)); | |
| } |
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.
wdk-build does not hide any of this behind feature flags. I don't think this suggestion is correct.
dlon marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // Copyright (c) Microsoft Corporation | ||
| // License: MIT OR Apache-2.0 | ||
|
|
||
| //! Direct FFI bindings to network APIs from the Windows Driver Kit (WDK) | ||
dlon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| //! | ||
| //! This module contains all bindings for network headers. Types are not | ||
| //! included in this module, but are available in the top-level `wdk_sys` | ||
| //! module. | ||
dlon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #[allow( | ||
| missing_docs, | ||
| reason = "most items in the WDK headers have no inline documentation, so bindgen is unable to \ | ||
| generate documentation for their bindings" | ||
| )] | ||
| #[allow(clippy::derive_partial_eq_without_eq)] | ||
| #[allow(non_camel_case_types)] | ||
| #[allow(non_snake_case)] | ||
| #[allow(non_upper_case_globals)] | ||
| #[allow(unnecessary_transmutes)] | ||
| mod bindings { | ||
| #[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" | ||
| )] | ||
dlon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| use crate::types::*; | ||
|
|
||
| include!(concat!(env!("OUT_DIR"), "/network.rs")); | ||
| } | ||
|
|
||
dlon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| pub use bindings::*; | ||
Uh oh!
There was an error while loading. Please reload this page.