Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[macro_use]
- extern crate lazy_static;
- pub struct MyHWND {
- hwnd: *mut u64,
- }
- unsafe impl Send for MyHWND {}
- unsafe impl Sync for MyHWND {}
- impl MyHWND {
- fn get(&self) -> *mut u64 {
- self.hwnd
- }
- }
- const GU64: u64 = 19;
- lazy_static! {
- pub static ref WIN: MyHWND = MyHWND { hwnd: &mut GU64 as *mut u64};
- }
- fn main() {
- unsafe { println!("value: {:?}", *WIN.get() as u64); }
- println!("global: {:?}", GU64);
- }
Add Comment
Please, Sign In to add comment