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
#![cfg(windows)]
extern crate winapi;

extern crate failure;
#[macro_use]
extern crate failure_derive;

#[macro_use]
pub mod macros;

pub mod bstr;
pub mod comptr;
mod comutil;
mod iunknown;
pub mod refcount;
mod types;

pub use comutil::*;
pub use iunknown::*;
pub use types::*;

pub mod errors {
    pub type Result<T> = ::std::result::Result<T, ComError>;

    #[derive(Debug, Fail)]
    #[fail(display = "COM call returned error: {}", result)]
    pub struct ComError {
        pub result: ::HRESULT,
    }
}