Skip to content
Merged
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
2 changes: 1 addition & 1 deletion wslpluginapi-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct-field-names-as-array = { version = "0.3", features = [
"derive",
], optional = true }

[dependencies.windows]
[dependencies.windows-sys]
version = ">0.32"
features = [
"Win32_Foundation",
Expand Down
9 changes: 5 additions & 4 deletions wslpluginapi-sys/build/WslPluginApi.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* automatically generated by rust-bindgen 0.72.0 */

use windows::core::*;
use windows::Win32::Foundation::*;
use windows::Win32::Networking::WinSock::SOCKET;
use windows::Win32::Security::*;
use windows_sys::core::*;
use windows_sys::Win32::Foundation::*;
use windows_sys::Win32::Networking::WinSock::SOCKET;
#[allow(unused_imports)]
use windows_sys::Win32::Security::*;
#[allow(clippy::upper_case_acronyms)]
type LPCWSTR = PCWSTR;
#[allow(clippy::upper_case_acronyms)]
Expand Down
2 changes: 1 addition & 1 deletion wslpluginapi-sys/build/checksum.sha256
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
896ecb0b3b7e6467e6f4cda3b00201473ed7b7face1a31081671bc32b9e679d3 metadata.json
b8f7209005250c821184da6a11eefc40a84bfc9d44a34cb9bbd1fc302d62e4b4 WslPluginApi.rs
62b630c8c307ef6321c5ca698a79adaca3b6375575de62ebb2d007e73dfc15cc WslPluginApi.rs
2 changes: 2 additions & 0 deletions wslpluginapi-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod bindgen;
mod manual;
/// Re-export the [windows_sys] crate for use in higher-level crates
pub extern crate windows_sys;
pub use crate::bindgen::*;
pub use manual::*;
10 changes: 5 additions & 5 deletions wslpluginapi-sys/src/manual.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::WSLPluginAPIV1;
use windows::core::HRESULT;
use windows::Win32::Foundation::{SEVERITY_ERROR, S_OK};
use windows::Win32::System::Diagnostics::Debug::{FACILITY_CODE, FACILITY_ITF};
use windows_sys::core::HRESULT;
use windows_sys::Win32::Foundation::{SEVERITY_ERROR, S_OK};
use windows_sys::Win32::System::Diagnostics::Debug::{FACILITY_CODE, FACILITY_ITF};

#[inline(always)]
const fn make_hresult(severity: u32, facility: FACILITY_CODE, code: u32) -> HRESULT {
HRESULT(((severity << 31) | (facility.0 << 16) | code) as i32)
((severity << 31) | (facility << 16) | code) as HRESULT
}

pub const WSL_E_PLUGIN_REQUIRES_UPDATE: HRESULT =
Expand Down Expand Up @@ -60,7 +60,7 @@ pub const unsafe fn require_version(
mod tests {
use super::*;
use crate::{WSLPluginAPIV1, WSLVersion};
use windows::Win32::Foundation::S_OK;
use windows_sys::Win32::Foundation::S_OK;

#[test]
fn test_version_exact_match() {
Expand Down
9 changes: 5 additions & 4 deletions xtask/src/header_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ pub(crate) fn process<P: AsRef<Path>>(
target: Option<&str>,
) -> anyhow::Result<bindgen::Bindings> {
let mut builder = bindgen::Builder::default()
.raw_line("use windows::core::*;")
.raw_line("use windows::Win32::Foundation::*;")
.raw_line("use windows::Win32::Security::*;")
.raw_line("use windows::Win32::Networking::WinSock::SOCKET;")
.raw_line("use windows_sys::core::*;")
.raw_line("use windows_sys::Win32::Foundation::*;")
.raw_line("#[allow(unused_imports)]")
.raw_line("use windows_sys::Win32::Security::*;")
.raw_line("use windows_sys::Win32::Networking::WinSock::SOCKET;")
.raw_line("#[allow(clippy::upper_case_acronyms)] type LPCWSTR = PCWSTR;")
.raw_line("#[allow(clippy::upper_case_acronyms)] type LPCSTR = PCSTR;")
.raw_line("#[allow(clippy::upper_case_acronyms)] type DWORD = u32;")
Expand Down