| 1 |
mod literals; |
| 2 |
|
| 3 |
#[doc(hidden)] |
| 4 |
pub use literals::*; |
| 5 |
|
| 6 |
pub type HRESULT = i32; |
| 7 |
pub type HSTRING = *mut ::core::ffi::c_void; |
| 8 |
pub type IUnknown = *mut ::core::ffi::c_void; |
| 9 |
pub type IInspectable = *mut ::core::ffi::c_void; |
| 10 |
pub type PSTR = *mut u8; |
| 11 |
pub type PWSTR = *mut u16; |
| 12 |
pub type PCSTR = *const u8; |
| 13 |
pub type PCWSTR = *const u16; |
| 14 |
pub type BSTR = *const u16; |
| 15 |
|
| 16 |
#[repr(C)] |
| 17 |
pub struct GUID { |
| 18 |
pub data1: u32, |
| 19 |
pub data2: u16, |
| 20 |
pub data3: u16, |
| 21 |
pub data4: [u8; 8], |
| 22 |
} |
| 23 |
|
| 24 |
impl ::core::marker::Copy for GUID {} |
| 25 |
|
| 26 |
impl ::core::clone::Clone for GUID { |
| 27 |
fn clone(&self) -> Self { |
| 28 |
*self |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
impl GUID { |
| 33 |
pub const fn from_u128(uuid: u128) -> Self { |
| 34 |
Self { data1: (uuid >> 96) as u32, data2: (uuid >> 80 & 0xffff) as u16, data3: (uuid >> 64 & 0xffff) as u16, data4: (uuid as u64).to_be_bytes() } |
| 35 |
} |
| 36 |
} |