-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect nested structs with differing layout or packing requirements (#…
- Loading branch information
Showing
10 changed files
with
260 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#![allow( | ||
non_snake_case, | ||
non_upper_case_globals, | ||
non_camel_case_types, | ||
dead_code, | ||
clippy::all | ||
)] | ||
|
||
#[repr(transparent)] | ||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] | ||
pub struct DI_FUNCTION(pub u32); | ||
#[repr(C, packed(1))] | ||
#[cfg(target_arch = "x86")] | ||
#[derive(Clone, Copy, Default)] | ||
pub struct SP_CLASSINSTALL_HEADER { | ||
pub cbSize: u32, | ||
pub InstallFunction: DI_FUNCTION, | ||
} | ||
#[repr(C)] | ||
#[cfg(any( | ||
target_arch = "aarch64", | ||
target_arch = "arm64ec", | ||
target_arch = "x86_64" | ||
))] | ||
#[derive(Clone, Copy, Debug, Default, PartialEq)] | ||
pub struct SP_CLASSINSTALL_HEADER { | ||
pub cbSize: u32, | ||
pub InstallFunction: DI_FUNCTION, | ||
} | ||
#[repr(C)] | ||
#[derive(Clone, Copy)] | ||
pub struct SP_POWERMESSAGEWAKE_PARAMS_A { | ||
pub ClassInstallHeader: SP_CLASSINSTALL_HEADER, | ||
pub PowerMessageWake: [i8; 512], | ||
} | ||
impl Default for SP_POWERMESSAGEWAKE_PARAMS_A { | ||
fn default() -> Self { | ||
unsafe { core::mem::zeroed() } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#![allow( | ||
non_snake_case, | ||
non_upper_case_globals, | ||
non_camel_case_types, | ||
dead_code, | ||
clippy::all | ||
)] | ||
|
||
pub type DI_FUNCTION = u32; | ||
#[repr(C, packed(1))] | ||
#[cfg(target_arch = "x86")] | ||
#[derive(Clone, Copy, Default)] | ||
pub struct SP_CLASSINSTALL_HEADER { | ||
pub cbSize: u32, | ||
pub InstallFunction: DI_FUNCTION, | ||
} | ||
#[repr(C)] | ||
#[cfg(any( | ||
target_arch = "aarch64", | ||
target_arch = "arm64ec", | ||
target_arch = "x86_64" | ||
))] | ||
#[derive(Clone, Copy, Default)] | ||
pub struct SP_CLASSINSTALL_HEADER { | ||
pub cbSize: u32, | ||
pub InstallFunction: DI_FUNCTION, | ||
} | ||
#[repr(C)] | ||
#[derive(Clone, Copy)] | ||
pub struct SP_POWERMESSAGEWAKE_PARAMS_A { | ||
pub ClassInstallHeader: SP_CLASSINSTALL_HEADER, | ||
pub PowerMessageWake: [i8; 512], | ||
} | ||
impl Default for SP_POWERMESSAGEWAKE_PARAMS_A { | ||
fn default() -> Self { | ||
unsafe { core::mem::zeroed() } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#![allow( | ||
non_snake_case, | ||
non_upper_case_globals, | ||
non_camel_case_types, | ||
dead_code, | ||
clippy::all | ||
)] | ||
|
||
#[repr(transparent)] | ||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] | ||
pub struct DI_FUNCTION(pub u32); | ||
#[repr(C, packed(1))] | ||
#[cfg(target_arch = "x86")] | ||
#[derive(Clone, Copy, Default)] | ||
pub struct SP_CLASSINSTALL_HEADER { | ||
pub cbSize: u32, | ||
pub InstallFunction: DI_FUNCTION, | ||
} | ||
#[repr(C)] | ||
#[cfg(any( | ||
target_arch = "aarch64", | ||
target_arch = "arm64ec", | ||
target_arch = "x86_64" | ||
))] | ||
#[derive(Clone, Copy, Debug, Default, PartialEq)] | ||
pub struct SP_CLASSINSTALL_HEADER { | ||
pub cbSize: u32, | ||
pub InstallFunction: DI_FUNCTION, | ||
} | ||
#[repr(C, packed(1))] | ||
#[cfg(target_arch = "x86")] | ||
#[derive(Clone, Copy)] | ||
pub struct SP_POWERMESSAGEWAKE_PARAMS_W { | ||
pub ClassInstallHeader: SP_CLASSINSTALL_HEADER, | ||
pub PowerMessageWake: [u16; 512], | ||
} | ||
#[cfg(target_arch = "x86")] | ||
impl Default for SP_POWERMESSAGEWAKE_PARAMS_W { | ||
fn default() -> Self { | ||
unsafe { core::mem::zeroed() } | ||
} | ||
} | ||
#[repr(C)] | ||
#[cfg(any( | ||
target_arch = "aarch64", | ||
target_arch = "arm64ec", | ||
target_arch = "x86_64" | ||
))] | ||
#[derive(Clone, Copy)] | ||
pub struct SP_POWERMESSAGEWAKE_PARAMS_W { | ||
pub ClassInstallHeader: SP_CLASSINSTALL_HEADER, | ||
pub PowerMessageWake: [u16; 512], | ||
} | ||
#[cfg(any( | ||
target_arch = "aarch64", | ||
target_arch = "arm64ec", | ||
target_arch = "x86_64" | ||
))] | ||
impl Default for SP_POWERMESSAGEWAKE_PARAMS_W { | ||
fn default() -> Self { | ||
unsafe { core::mem::zeroed() } | ||
} | ||
} |
Oops, something went wrong.