mssf_pal/
lib.rs

1// ------------------------------------------------------------
2// Copyright (c) Microsoft Corporation.  All rights reserved.
3// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
4// ------------------------------------------------------------
5
6//! mssf-pal acts like the windows_core (and windows) crate for the windows-bindgen code to compile on linux.
7//! It reexposes windows_core com supports, and some Win32 error codes.
8//! windows_core does not support string types on linux, so we provide an minimal implementation here.
9//!
10//! To use mssf-pal for windows-bindgen generated code, alias mssf-pal crate as the windows-core and windows crate,
11//! so that the generated code can resolve windows_core crate content via mssf-pal.
12
13// expose minimal windows_core types except string types for mssf to work on linux.
14pub mod imp {
15    pub use windows_core::imp::*;
16}
17pub use windows_core::{
18    AsImpl, BOOL, ComObject, ComObjectInner, ComObjectInterface, CopyType, DYNAMIC_CAST_IID, Error,
19    GUID, HRESULT, IInspectable, IInspectable_Vtbl, IUnknown, IUnknown_Vtbl, IUnknownImpl,
20    Interface, InterfaceRef, OutParam, OutRef, Param, ParamValue, Ref, Result, RuntimeName,
21    RuntimeType, StaticComObject, Type, TypeKind, implement,
22};
23
24// provide other implemenations missing for linux
25// extern crate self as windows_core;
26// This is used on windows as well.
27mod strings;
28pub use strings::*;
29
30// pal definition for windows types
31#[allow(
32    non_snake_case,
33    non_upper_case_globals,
34    non_camel_case_types,
35    dead_code,
36    clippy::all
37)]
38
39/// Provides windows crate Win32 mod contents needed to build windows-bindgen
40/// generated code on linux, and some minimal common windows definitions.
41pub mod Win32;