more windows bits
This commit is contained in:
parent
97ad4e92f9
commit
00e2e2cefb
@ -2,9 +2,10 @@ fn main() {
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
windows::build!(
|
||||
windows::win32::system_services::HANDLE,
|
||||
windows::win32::windows_programming::CloseHandle,
|
||||
// API needed for the shared memory
|
||||
windows::win32::system_services::{CreateFileMappingA, MapViewOfFile, UnmapViewOfFile},
|
||||
windows::win32::windows_programming::CloseHandle
|
||||
windows::win32::system_services::{CreateFileMappingA, OpenFileMappingA, MapViewOfFile, UnmapViewOfFile},
|
||||
);
|
||||
|
||||
}
|
||||
|
2
libafl/src/bolts/bindings.rs
Normal file
2
libafl/src/bolts/bindings.rs
Normal file
@ -0,0 +1,2 @@
|
||||
#[cfg(windows)]
|
||||
::windows::include_bindings!();
|
@ -5,3 +5,4 @@ pub mod ownedref;
|
||||
pub mod serdeany;
|
||||
pub mod shmem;
|
||||
pub mod tuples;
|
||||
pub mod bindings;
|
||||
|
@ -5,6 +5,10 @@
|
||||
#[cfg(unix)]
|
||||
pub use shmem::UnixShMem;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[cfg(windows)]
|
||||
pub use shmem::Win32ShMem;
|
||||
|
||||
use alloc::string::{String, ToString};
|
||||
use core::fmt::Debug;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -319,6 +323,29 @@ pub mod shmem {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(feature = "std")]
|
||||
pub mod shmem {
|
||||
|
||||
use core::{mem::size_of, slice};
|
||||
use std::ffi::CStr;
|
||||
|
||||
use crate::Error;
|
||||
use super::ShMem;
|
||||
|
||||
/// The default Sharedmap impl for windows using shmctl & shmget
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Win32ShMem {
|
||||
pub filename: [u8; 64],
|
||||
pub handle: windows::win32::system_services::HANDLE,
|
||||
pub map: *mut u8,
|
||||
pub map_size: usize,
|
||||
}
|
||||
|
||||
// TODO complete
|
||||
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user