Skip to content

Commit

Permalink
more sorted bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Dec 3, 2024
1 parent 01763ef commit b541b7d
Show file tree
Hide file tree
Showing 17 changed files with 628 additions and 628 deletions.
24 changes: 12 additions & 12 deletions crates/tests/misc/standalone/src/b_arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ windows_targets::link!("user32.dll" "system" fn GetWindowLongPtrW(hwnd : HWND, n
#[cfg(target_pointer_width = "32")]
pub use GetWindowLongW as GetWindowLongPtrW;
windows_targets::link!("user32.dll" "system" fn GetWindowLongW(hwnd : HWND, nindex : WINDOW_LONG_PTR_INDEX) -> i32);
pub type WINDOW_LONG_PTR_INDEX = i32;
pub type HANDLE = *mut core::ffi::c_void;
pub type HWND = *mut core::ffi::c_void;
pub type PSTR = *mut u8;
pub type WINDOW_LONG_PTR_INDEX = i32;
#[repr(C)]
#[cfg(any(
target_arch = "aarch64",
target_arch = "arm64ec",
target_arch = "x86_64"
))]
#[cfg(target_arch = "x86")]
#[derive(Clone, Copy)]
pub struct WSADATA {
pub wVersion: u16,
pub wHighVersion: u16,
pub szDescription: [i8; 257],
pub szSystemStatus: [i8; 129],
pub iMaxSockets: u16,
pub iMaxUdpDg: u16,
pub lpVendorInfo: PSTR,
pub szDescription: [i8; 257],
pub szSystemStatus: [i8; 129],
}
#[repr(C)]
#[cfg(target_arch = "x86")]
#[cfg(any(
target_arch = "aarch64",
target_arch = "arm64ec",
target_arch = "x86_64"
))]
#[derive(Clone, Copy)]
pub struct WSADATA {
pub wVersion: u16,
pub wHighVersion: u16,
pub szDescription: [i8; 257],
pub szSystemStatus: [i8; 129],
pub iMaxSockets: u16,
pub iMaxUdpDg: u16,
pub lpVendorInfo: PSTR,
pub szDescription: [i8; 257],
pub szSystemStatus: [i8; 129],
}
pub type PSTR = *mut u8;
198 changes: 99 additions & 99 deletions crates/tests/misc/standalone/src/b_arch_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
)]

windows_targets::link!("kernel32.dll" "system" fn RtlCaptureContext(contextrecord : *mut CONTEXT));
pub type CONTEXT_FLAGS = u32;
#[repr(C)]
#[derive(Clone, Copy)]
pub union ARM64_NT_NEON128 {
Expand All @@ -24,64 +23,34 @@ pub struct ARM64_NT_NEON128_0 {
pub High: i64,
}
#[repr(C)]
#[cfg(target_arch = "aarch64")]
#[cfg(target_arch = "x86")]
#[derive(Clone, Copy)]
pub struct CONTEXT {
pub ContextFlags: CONTEXT_FLAGS,
pub Cpsr: u32,
pub Anonymous: CONTEXT_0,
pub Sp: u64,
pub Pc: u64,
pub V: [ARM64_NT_NEON128; 32],
pub Fpcr: u32,
pub Fpsr: u32,
pub Bcr: [u32; 8],
pub Bvr: [u64; 8],
pub Wcr: [u32; 2],
pub Wvr: [u64; 2],
}
#[repr(C)]
#[cfg(target_arch = "aarch64")]
#[derive(Clone, Copy)]
pub union CONTEXT_0 {
pub Anonymous: CONTEXT_0_0,
pub X: [u64; 31],
}
#[repr(C)]
#[cfg(target_arch = "aarch64")]
#[derive(Clone, Copy)]
pub struct CONTEXT_0_0 {
pub X0: u64,
pub X1: u64,
pub X2: u64,
pub X3: u64,
pub X4: u64,
pub X5: u64,
pub X6: u64,
pub X7: u64,
pub X8: u64,
pub X9: u64,
pub X10: u64,
pub X11: u64,
pub X12: u64,
pub X13: u64,
pub X14: u64,
pub X15: u64,
pub X16: u64,
pub X17: u64,
pub X18: u64,
pub X19: u64,
pub X20: u64,
pub X21: u64,
pub X22: u64,
pub X23: u64,
pub X24: u64,
pub X25: u64,
pub X26: u64,
pub X27: u64,
pub X28: u64,
pub Fp: u64,
pub Lr: u64,
pub Dr0: u32,
pub Dr1: u32,
pub Dr2: u32,
pub Dr3: u32,
pub Dr6: u32,
pub Dr7: u32,
pub FloatSave: FLOATING_SAVE_AREA,
pub SegGs: u32,
pub SegFs: u32,
pub SegEs: u32,
pub SegDs: u32,
pub Edi: u32,
pub Esi: u32,
pub Ebx: u32,
pub Edx: u32,
pub Ecx: u32,
pub Eax: u32,
pub Ebp: u32,
pub Eip: u32,
pub SegCs: u32,
pub EFlags: u32,
pub Esp: u32,
pub SegSs: u32,
pub ExtendedRegisters: [u8; 512],
}
#[repr(C)]
#[cfg(any(target_arch = "arm64ec", target_arch = "x86_64"))]
Expand Down Expand Up @@ -165,41 +134,68 @@ pub struct CONTEXT_0_0 {
pub Xmm15: M128A,
}
#[repr(C)]
#[cfg(target_arch = "x86")]
#[cfg(target_arch = "aarch64")]
#[derive(Clone, Copy)]
pub struct CONTEXT {
pub ContextFlags: CONTEXT_FLAGS,
pub Dr0: u32,
pub Dr1: u32,
pub Dr2: u32,
pub Dr3: u32,
pub Dr6: u32,
pub Dr7: u32,
pub FloatSave: FLOATING_SAVE_AREA,
pub SegGs: u32,
pub SegFs: u32,
pub SegEs: u32,
pub SegDs: u32,
pub Edi: u32,
pub Esi: u32,
pub Ebx: u32,
pub Edx: u32,
pub Ecx: u32,
pub Eax: u32,
pub Ebp: u32,
pub Eip: u32,
pub SegCs: u32,
pub EFlags: u32,
pub Esp: u32,
pub SegSs: u32,
pub ExtendedRegisters: [u8; 512],
pub Cpsr: u32,
pub Anonymous: CONTEXT_0,
pub Sp: u64,
pub Pc: u64,
pub V: [ARM64_NT_NEON128; 32],
pub Fpcr: u32,
pub Fpsr: u32,
pub Bcr: [u32; 8],
pub Bvr: [u64; 8],
pub Wcr: [u32; 2],
pub Wvr: [u64; 2],
}
#[repr(C)]
#[cfg(any(
target_arch = "aarch64",
target_arch = "arm64ec",
target_arch = "x86_64"
))]
#[cfg(target_arch = "aarch64")]
#[derive(Clone, Copy)]
pub union CONTEXT_0 {
pub Anonymous: CONTEXT_0_0,
pub X: [u64; 31],
}
#[repr(C)]
#[cfg(target_arch = "aarch64")]
#[derive(Clone, Copy)]
pub struct CONTEXT_0_0 {
pub X0: u64,
pub X1: u64,
pub X2: u64,
pub X3: u64,
pub X4: u64,
pub X5: u64,
pub X6: u64,
pub X7: u64,
pub X8: u64,
pub X9: u64,
pub X10: u64,
pub X11: u64,
pub X12: u64,
pub X13: u64,
pub X14: u64,
pub X15: u64,
pub X16: u64,
pub X17: u64,
pub X18: u64,
pub X19: u64,
pub X20: u64,
pub X21: u64,
pub X22: u64,
pub X23: u64,
pub X24: u64,
pub X25: u64,
pub X26: u64,
pub X27: u64,
pub X28: u64,
pub Fp: u64,
pub Lr: u64,
}
pub type CONTEXT_FLAGS = u32;
#[repr(C)]
#[cfg(target_arch = "x86")]
#[derive(Clone, Copy)]
pub struct FLOATING_SAVE_AREA {
pub ControlWord: u32,
Expand All @@ -210,10 +206,14 @@ pub struct FLOATING_SAVE_AREA {
pub DataOffset: u32,
pub DataSelector: u32,
pub RegisterArea: [u8; 80],
pub Cr0NpxState: u32,
pub Spare0: u32,
}
#[repr(C)]
#[cfg(target_arch = "x86")]
#[cfg(any(
target_arch = "aarch64",
target_arch = "arm64ec",
target_arch = "x86_64"
))]
#[derive(Clone, Copy)]
pub struct FLOATING_SAVE_AREA {
pub ControlWord: u32,
Expand All @@ -224,7 +224,7 @@ pub struct FLOATING_SAVE_AREA {
pub DataOffset: u32,
pub DataSelector: u32,
pub RegisterArea: [u8; 80],
pub Spare0: u32,
pub Cr0NpxState: u32,
}
#[repr(C)]
#[derive(Clone, Copy)]
Expand All @@ -233,11 +233,7 @@ pub struct M128A {
pub High: i64,
}
#[repr(C)]
#[cfg(any(
target_arch = "aarch64",
target_arch = "arm64ec",
target_arch = "x86_64"
))]
#[cfg(target_arch = "x86")]
#[derive(Clone, Copy)]
pub struct XSAVE_FORMAT {
pub ControlWord: u16,
Expand All @@ -254,11 +250,15 @@ pub struct XSAVE_FORMAT {
pub MxCsr: u32,
pub MxCsr_Mask: u32,
pub FloatRegisters: [M128A; 8],
pub XmmRegisters: [M128A; 16],
pub Reserved4: [u8; 96],
pub XmmRegisters: [M128A; 8],
pub Reserved4: [u8; 224],
}
#[repr(C)]
#[cfg(target_arch = "x86")]
#[cfg(any(
target_arch = "aarch64",
target_arch = "arm64ec",
target_arch = "x86_64"
))]
#[derive(Clone, Copy)]
pub struct XSAVE_FORMAT {
pub ControlWord: u16,
Expand All @@ -275,6 +275,6 @@ pub struct XSAVE_FORMAT {
pub MxCsr: u32,
pub MxCsr_Mask: u32,
pub FloatRegisters: [M128A; 8],
pub XmmRegisters: [M128A; 8],
pub Reserved4: [u8; 224],
pub XmmRegisters: [M128A; 16],
pub Reserved4: [u8; 96],
}
2 changes: 1 addition & 1 deletion crates/tests/misc/standalone/src/b_bstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
)]

windows_targets::link!("oleaut32.dll" "system" fn SysAllocString(psz : PCWSTR) -> BSTR);
pub type PCWSTR = *const u16;
pub type BSTR = *const u16;
pub type PCWSTR = *const u16;
6 changes: 3 additions & 3 deletions crates/tests/misc/standalone/src/b_constant_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
clippy::all
)]

pub type NTSTATUS = i32;
pub const CMC_ADD_ATTRIBUTES: PCSTR = 63i32 as _;
pub const E_ACCESSDENIED: HRESULT = 0x80070005_u32 as _;
pub type HRESULT = i32;
pub const IDC_UPARROW: PCWSTR = 32516u16 as _;
pub const STATUS_NOT_FOUND: NTSTATUS = 0xC0000225_u32 as _;
pub type NTSTATUS = i32;
pub type PCSTR = *const u8;
pub type PCWSTR = *const u16;
pub type HRESULT = i32;
pub const STATUS_NOT_FOUND: NTSTATUS = 0xC0000225_u32 as _;
6 changes: 3 additions & 3 deletions crates/tests/misc/standalone/src/b_depends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
clippy::all
)]

pub type ADDRESS_FAMILY = u16;
pub type HANDLE = *mut core::ffi::c_void;
pub type LPWSAOVERLAPPED_COMPLETION_ROUTINE = Option<
unsafe extern "system" fn(
dwerror: u32,
Expand All @@ -14,8 +16,6 @@ pub type LPWSAOVERLAPPED_COMPLETION_ROUTINE = Option<
dwflags: u32,
),
>;
pub type ADDRESS_FAMILY = u16;
pub type HANDLE = *mut core::ffi::c_void;
#[repr(C)]
#[derive(Clone, Copy)]
pub struct OVERLAPPED {
Expand All @@ -36,6 +36,7 @@ pub struct OVERLAPPED_0_0 {
pub Offset: u32,
pub OffsetHigh: u32,
}
pub type PSTR = *mut u8;
#[repr(C)]
#[derive(Clone, Copy)]
pub struct SOCKADDR {
Expand Down Expand Up @@ -67,4 +68,3 @@ pub struct WSASENDMSG {
pub lpOverlapped: *mut OVERLAPPED,
pub lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE,
}
pub type PSTR = *mut u8;
Loading

0 comments on commit b541b7d

Please sign in to comment.