maple_rs/
linux.rs

1use crate::{
2    Result,
3    error::MapleError,
4    memory_module::{MemoryModule, MemoryModuleBuilder},
5};
6
7pub struct LinuxMemoryModule {
8    _placeholder: (),
9}
10
11impl LinuxMemoryModule {
12    pub fn from_memory(_data: &[u8]) -> Result<Self> {
13        Err(MapleError::PlatformNotSupported(
14            "Linux implementation not yet available".to_string(),
15        ))
16    }
17
18    pub fn from_memory_with_options(_data: &[u8], _options: &MemoryModuleBuilder) -> Result<Self> {
19        Err(MapleError::PlatformNotSupported(
20            "Linux implementation not yet available".to_string(),
21        ))
22    }
23}
24
25impl MemoryModule for LinuxMemoryModule {
26    fn get_proc_address(&self, _name: &str) -> Result<*const u8> {
27        Err(MapleError::PlatformNotSupported(
28            "Linux implementation not yet available".to_string(),
29        ))
30    }
31
32    fn get_proc_address_ordinal(&self, _ordinal: u16) -> Result<*const u8> {
33        Err(MapleError::PlatformNotSupported(
34            "Linux implementation not yet available".to_string(),
35        ))
36    }
37
38    fn execute_entry_point(&self) -> Result<()> {
39        Err(MapleError::PlatformNotSupported(
40            "Linux implementation not yet available".to_string(),
41        ))
42    }
43
44    fn call_dll_entry_point(&self, _reason: u32) -> Result<bool> {
45        Err(MapleError::PlatformNotSupported(
46            "Linux implementation not yet available".to_string(),
47        ))
48    }
49
50    fn execute_dll_application(&self) -> Result<()> {
51        Err(MapleError::PlatformNotSupported(
52            "Linux implementation not yet available".to_string(),
53        ))
54    }
55
56    fn free(&mut self) -> Result<()> {
57        Err(MapleError::PlatformNotSupported(
58            "Linux implementation not yet available".to_string(),
59        ))
60    }
61
62    fn is_loaded(&self) -> bool {
63        false
64    }
65
66    fn base_address(&self) -> *const u8 {
67        std::ptr::null()
68    }
69
70    fn size(&self) -> usize {
71        0
72    }
73
74    fn find_resource(
75        &self,
76        _name: Option<&str>,
77        _resource_type: Option<&str>,
78    ) -> Result<*const u8> {
79        Err(MapleError::PlatformNotSupported(
80            "Linux implementation not yet available".to_string(),
81        ))
82    }
83
84    fn find_resource_ex(
85        &self,
86        _name: Option<&str>,
87        _resource_type: Option<&str>,
88        _language: u16,
89    ) -> Result<*const u8> {
90        Err(MapleError::PlatformNotSupported(
91            "Linux implementation not yet available".to_string(),
92        ))
93    }
94
95    fn sizeof_resource(&self, _resource: *const u8) -> Result<usize> {
96        Err(MapleError::PlatformNotSupported(
97            "Linux implementation not yet available".to_string(),
98        ))
99    }
100
101    fn load_resource(&self, _resource: *const u8) -> Result<*const u8> {
102        Err(MapleError::PlatformNotSupported(
103            "Linux implementation not yet available".to_string(),
104        ))
105    }
106
107    fn load_string(&self, _id: u32, _buffer: &mut [u16]) -> Result<usize> {
108        Err(MapleError::PlatformNotSupported(
109            "Linux implementation not yet available".to_string(),
110        ))
111    }
112
113    fn load_string_ex(&self, _id: u32, _buffer: &mut [u16], _language: u16) -> Result<usize> {
114        Err(MapleError::PlatformNotSupported(
115            "Linux implementation not yet available".to_string(),
116        ))
117    }
118}