Skip to content

Replace manual COM pointers with wil::com_ptr#24

Merged
asklar merged 1 commit into
mainfrom
refactor/eliminate-manual-com-ptrs
Jul 9, 2026
Merged

Replace manual COM pointers with wil::com_ptr#24
asklar merged 1 commit into
mainfrom
refactor/eliminate-manual-com-ptrs

Conversation

@asklar

@asklar asklar commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary:

  • Replaced owned raw COM members and locals in the XAML TAP DLL with wil::com_ptr, including site/diagnostics/visual-tree-service ownership and class factory temporary ownership.
  • Replaced WPF TAP CLR hosting COM locals with wil::com_ptr.
  • Linked WIL into TAP targets that now include wil/com.h, without changing /MT or cppwinrt/Windows SDK logic.

Deliberately left raw:

  • XAML diagnostics callback/interface parameters and QueryInterface out-parameters remain raw because they are non-owning COM ABI boundaries.
  • GetIInspectableFromHandle handling remains raw to preserve existing XAML diagnostics ABI lifetime behavior in the injected TAP DLL.

Validation:

  • dotnet build src\tap_wpf\LvtWpfTap.csproj -c Release
  • dotnet build src\plugin_avalonia\LvtAvaloniaTreeWalker\LvtAvaloniaTreeWalker.csproj -c Release
  • cmake --build build
  • build\lvt_unit_tests.exe
  • build\lvt.exe --pid --frameworks

Fixes #10

@asklar asklar marked this pull request as draft July 8, 2026 17:55
@asklar asklar force-pushed the refactor/eliminate-manual-com-ptrs branch from 66f39c1 to 2468f51 Compare July 9, 2026 07:10
@asklar asklar marked this pull request as ready for review July 9, 2026 07:10
@asklar asklar marked this pull request as draft July 9, 2026 07:16
Use wil::com_ptr for owned COM references in the XAML, WPF, and WinForms TAP paths while preserving XAML diagnostics raw ABI lifetime behavior where ownership is unclear.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@asklar asklar force-pushed the refactor/eliminate-manual-com-ptrs branch from 2468f51 to 498e0bd Compare July 9, 2026 08:25
@asklar asklar marked this pull request as ready for review July 9, 2026 08:25
@asklar asklar merged commit 05096f6 into main Jul 9, 2026
1 check passed
@asklar asklar deleted the refactor/eliminate-manual-com-ptrs branch July 9, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eliminate manual com ptrs

1 participant