-
Notifications
You must be signed in to change notification settings - Fork 528
/
Copy pathmod.rs
119 lines (109 loc) · 2.19 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
mod abi;
mod agile_reference;
mod array;
pub(crate) mod bindings;
mod compose;
mod delay_load;
mod error;
mod event;
mod factory_cache;
mod generic_factory;
mod guid;
mod heap;
mod hresult;
mod hstring;
mod inspectable;
mod interface;
mod into_param;
mod param;
mod pcstr;
mod pcwstr;
mod pstr;
mod pwstr;
mod ref_count;
mod runtime_name;
mod runtime_type;
mod sha1;
mod to_impl;
mod unknown;
mod waiter;
mod weak;
mod weak_ref_count;
#[doc(hidden)]
pub use abi::*;
pub use agile_reference::*;
pub use array::*;
#[doc(hidden)]
pub use compose::*;
pub(crate) use delay_load::*;
pub use error::*;
pub use event::*;
#[doc(hidden)]
pub use factory_cache::*;
#[doc(hidden)]
pub use generic_factory::*;
pub use guid::*;
pub(crate) use heap::*;
pub use hresult::*;
pub use hstring::*;
pub use inspectable::*;
pub use interface::*;
#[doc(hidden)]
pub use into_param::*;
#[doc(hidden)]
pub use param::*;
pub use pcstr::*;
pub use pcwstr::*;
pub use pstr::*;
pub use pwstr::*;
#[doc(hidden)]
pub use ref_count::*;
#[doc(hidden)]
pub use runtime_name::*;
#[doc(hidden)]
pub use runtime_type::*;
#[doc(hidden)]
pub use sha1::*;
#[doc(hidden)]
pub use to_impl::*;
pub use unknown::*;
#[doc(hidden)]
pub use waiter::*;
pub use weak::*;
#[doc(hidden)]
pub use weak_ref_count::*;
/// A specialized [`Result`] type that provides Windows error information.
pub type Result<T> = core::result::Result<T, Error>;
#[doc(hidden)]
pub use bindings::IAgileObject;
// TODO: rather than hiding, consider just removing
#[doc(hidden)]
pub type RawPtr = *mut core::ffi::c_void;
#[doc(hidden)]
#[cfg(feature = "implement")]
pub use windows_implement::implement;
#[doc(hidden)]
#[cfg(feature = "interface")]
pub use windows_interface::interface;
extern "C" {
#[doc(hidden)]
pub fn memcmp(left: *const core::ffi::c_void, right: *const core::ffi::c_void, len: usize) -> i32;
}
#[doc(hidden)]
pub extern crate alloc;
#[doc(hidden)]
pub fn as_ptr_or_null<T>(value: &[T]) -> *const T {
if value.is_empty() {
core::ptr::null()
} else {
value.as_ptr()
}
}
#[doc(hidden)]
pub fn as_mut_ptr_or_null<T>(value: &mut [T]) -> *mut T {
if value.is_empty() {
core::ptr::null_mut()
} else {
value.as_mut_ptr()
}
}