winapi/lib.rs
1// Licensed under the Apache License, Version 2.0
2// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4// All files in the project carrying such notice may not be copied, modified, or distributed
5// except according to those terms.
6#![cfg(windows)]
7#![deny(unused, unused_qualifications)]
8#![warn(unused_attributes)]
9#![allow(bad_style, overflowing_literals, unused_macros, deprecated, unused_crate_dependencies)]
10#![recursion_limit = "2563"]
11#![no_std]
12//Uncomment as needed or once minimum Rust version is bumped to 1.18
13//#![cfg_attr(feature = "cargo-clippy", warn(clippy::pedantic))]
14//#![cfg_attr(feature = "cargo-clippy", allow(clippy::absurd_extreme_comparisons, clippy::cast_lossless, clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_precision_loss, clippy::cast_ptr_alignment, clippy::cast_sign_loss, clippy::doc_markdown, clippy::empty_enum, clippy::erasing_op, clippy::excessive_precision, clippy::expl_impl_clone_on_copy, clippy::identity_op, clippy::if_not_else, clippy::many_single_char_names, clippy::module_inception, clippy::cast_possible_truncation, clippy::too_many_arguments, clippy::transmute_int_to_float, clippy::trivially_copy_pass_by_ref, clippy::unreadable_literal, clippy::unseparated_literal_suffix, clippy::used_underscore_binding, clippy::redundant_static_lifetimes, clippy::missing_safety_doc))]
15
16#[cfg(feature = "std")]
17extern crate std;
18
19/// Hack for exported macros
20#[doc(hidden)]
21pub extern crate core as _core;
22
23// Modules
24#[macro_use]
25mod macros;
26pub mod km;
27pub mod shared;
28pub mod ucrt;
29pub mod um;
30pub mod vc;
31pub mod winrt;
32
33/// Built in primitive types provided by the C language
34pub mod ctypes {
35 #[cfg(feature = "std")]
36 pub use std::os::raw::c_void;
37 #[cfg(not(feature = "std"))]
38 pub enum c_void {}
39 pub type c_char = i8;
40 pub type c_schar = i8;
41 pub type c_uchar = u8;
42 pub type c_short = i16;
43 pub type c_ushort = u16;
44 pub type c_int = i32;
45 pub type c_uint = u32;
46 pub type c_long = i32;
47 pub type c_ulong = u32;
48 pub type c_longlong = i64;
49 pub type c_ulonglong = u64;
50 pub type c_float = f32;
51 pub type c_double = f64;
52 pub type __int8 = i8;
53 pub type __uint8 = u8;
54 pub type __int16 = i16;
55 pub type __uint16 = u16;
56 pub type __int32 = i32;
57 pub type __uint32 = u32;
58 pub type __int64 = i64;
59 pub type __uint64 = u64;
60 pub type wchar_t = u16;
61}
62// This trait should be implemented for all COM interfaces
63pub trait Interface {
64 // Returns the IID of the Interface
65 fn uuidof() -> shared::guiddef::GUID;
66}
67// This trait should be implemented for all COM classes
68pub trait Class {
69 // Returns the CLSID of the Class
70 fn uuidof() -> shared::guiddef::GUID;
71}