Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an explicit ComObject<T> type that represents a heap-allocated COM object #3043

Merged
merged 13 commits into from
May 16, 2024
Prev Previous commit
Next Next commit
PR feedbac, propagate visibility
sivadeilra committed May 16, 2024
commit 13f251ef72f58dcd144c4c20e02d3a68aa4e4e4d
2 changes: 1 addition & 1 deletion crates/libs/core/src/com_object.rs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ pub trait ComObjectInner {
/// Describes the COM interfaces implemented by a specific COM object.
///
/// The `#[implement]` macro generates implementations of this trait. Implementations are attached
/// to the "outer" types generated by `#[implemented]`, e.g. the `MyApp_Impl` type. Each
/// to the "outer" types generated by `#[implement]`, e.g. the `MyApp_Impl` type. Each
/// implementation knows how to locate the interface-specific field within `MyApp_Impl`.
///
/// This trait is an implementation detail of the Windows crates.
3 changes: 2 additions & 1 deletion crates/libs/implement/src/lib.rs
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ pub fn implement(attributes: proc_macro::TokenStream, original_type: proc_macro:

let original_type2 = original_type.clone();
let original_type2 = syn::parse_macro_input!(original_type2 as syn::ItemStruct);
let vis = &original_type2.vis;
let original_ident = original_type2.ident;
let mut constraints = quote! {};

@@ -130,7 +131,7 @@ pub fn implement(attributes: proc_macro::TokenStream, original_type: proc_macro:

let tokens = quote! {
#[repr(C)]
struct #impl_ident #generics where #constraints {
#vis struct #impl_ident #generics where #constraints {
identity: *const ::windows_core::IInspectable_Vtbl,
vtables: (#(*const #vtbl_idents,)*),
this: #original_ident::#generics,