Guest User

Untitled

a guest
Oct 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #[macro_use]
  2. extern crate lazy_static;
  3.  
  4. pub struct MyHWND {
  5. hwnd: *mut u64,
  6. }
  7.  
  8. unsafe impl Send for MyHWND {}
  9. unsafe impl Sync for MyHWND {}
  10.  
  11. impl MyHWND {
  12. fn get(&self) -> *mut u64 {
  13. self.hwnd
  14. }
  15. }
  16.  
  17. const GU64: u64 = 19;
  18. lazy_static! {
  19. pub static ref WIN: MyHWND = MyHWND { hwnd: &mut GU64 as *mut u64};
  20. }
  21.  
  22. fn main() {
  23. unsafe { println!("value: {:?}", *WIN.get() as u64); }
  24. println!("global: {:?}", GU64);
  25.  
  26. }
Add Comment
Please, Sign In to add comment