microsoft / windows-rs

Rust for Windows
https://kennykerr.ca/rust-getting-started/
Apache License 2.0
10.13k stars 473 forks source link

Fix handling of COM interfaces with same method name #3059

Closed sivadeilra closed 1 month ago

sivadeilra commented 1 month ago

It is common in COM interfaces for different interfaces to have methods that have the same name, especially for interface "versions" that extend the semantics of the underlying interfaces. For example, look at many of the inheritance relationships in COM interfaces in DirectWrite (IDWriteTextFormat, IDWriteTextFormat2, IDWriteTextFormat3, etc.)

This fixes the handling of this situation. All that is necessary is to use the syntax which explicitly selects a specific trait, when invoking IFoo_Impl methods. This PR adds unit test coverage for this situation.