memflow_native/
lib.rs

1#[cfg(target_os = "linux")]
2pub mod linux;
3#[cfg(target_os = "linux")]
4pub use linux::LinuxOs as NativeOs;
5#[cfg(target_os = "linux")]
6pub use linux::LinuxProcess as NativeProcess;
7
8#[cfg(target_os = "macos")]
9pub mod macos;
10#[cfg(target_os = "macos")]
11pub use macos::MacOs as NativeOs;
12#[cfg(target_os = "macos")]
13pub use macos::MacProcess as NativeProcess;
14
15#[cfg(target_os = "windows")]
16pub mod windows;
17#[cfg(target_os = "windows")]
18pub use self::windows::WindowsKeyboard as NativeKeyboard;
19#[cfg(target_os = "windows")]
20pub use self::windows::WindowsKeyboardState as NativeKeyboardState;
21#[cfg(target_os = "windows")]
22pub use self::windows::WindowsOs as NativeOs;
23#[cfg(target_os = "windows")]
24pub use self::windows::WindowsProcess as NativeProcess;
25#[cfg(target_os = "windows")]
26use crate::keyboard::OsKeyboardVtbl;
27
28use memflow::cglue;
29use memflow::prelude::v1::*;
30
31#[cfg(target_os = "windows")]
32cglue_impl_group!(NativeOs, OsInstance, { OsKeyboard });
33#[cfg(not(target_os = "windows"))]
34cglue_impl_group!(NativeOs, OsInstance, {});
35
36#[cfg_attr(feature = "plugins", os(name = "native", return_wrapped = true))]
37pub fn create_os(args: &OsArgs, lib: LibArc) -> Result<OsInstanceArcBox<'static>> {
38    let os = NativeOs::new(args)?;
39    Ok(memflow::plugins::os::create_instance(os, lib, args))
40}