Skip to content

[cDAC] Add managed definitions for IXCLRData COM interfaces#124922

Merged
max-charlamb merged 2 commits intodotnet:mainfrom
max-charlamb:cdac-add-interfaces
Feb 27, 2026
Merged

[cDAC] Add managed definitions for IXCLRData COM interfaces#124922
max-charlamb merged 2 commits intodotnet:mainfrom
max-charlamb:cdac-add-interfaces

Conversation

@max-charlamb
Copy link
Copy Markdown
Member

@max-charlamb max-charlamb commented Feb 26, 2026

This PR adds managed [GeneratedComInterface] definitions for IXCLRData* and ICLRData* COM interfaces from xclrdata.idl and clrdata.idl.

Changes

New interface definitions (IXCLRData.cs)

Added managed definitions for 14 interfaces that were previously missing:

  • IXCLRDataAppDomain
  • IXCLRDataAssembly
  • IXCLRDataTypeDefinition
  • IXCLRDataTypeInstance
  • IXCLRDataMethodDefinition
  • IXCLRDataExceptionState
  • IXCLRDataValue
  • IXCLRDataExceptionNotification / IXCLRDataExceptionNotification2 / IXCLRDataExceptionNotification3 / IXCLRDataExceptionNotification4 / IXCLRDataExceptionNotification5
  • IXCLRDataTarget3
  • IXCLRLibrarySupport

Also added the ClrDataMethodDefinitionExtent struct.

Note: IXCLRDisassemblySupport and IXCLRDataDisplay are intentionally omitted because they use varargs (...) and non-HRESULT return types incompatible with [GeneratedComInterface].

New interface definitions (ICLRData.cs)

Added managed definitions for 2 interfaces:

  • ICLRDataTarget2
  • ICLRDataTarget3

Also changed ICLRDataTarget2.AllocVirtual and ICLRDataTarget2.FreeVirtual address parameters from ulong to ClrDataAddress to match CLRDATA_ADDRESS in the IDL.

All GUIDs and vtable ordering verified against src/coreclr/inc/xclrdata.idl and src/coreclr/inc/clrdata.idl.

Files changed

  • IXCLRData.cs — 14 new interface definitions + ClrDataMethodDefinitionExtent struct
  • ICLRData.cs — Added ICLRDataTarget2, ICLRDataTarget3, and ClrDataAddress fix

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@max-charlamb max-charlamb marked this pull request as draft February 26, 2026 21:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces managed [GeneratedComInterface] projections for additional IXCLRData* COM interfaces (from xclrdata.idl) and updates existing cDAC COM surface/implementations to use typed parameters instead of void*/void**.

Changes:

  • Add managed definitions for many previously-missing IXCLRData* interfaces and related structs.
  • Add ICLRDataTarget2 / ICLRDataTarget3 managed definitions.
  • Update cDAC implementations and forwarders to match the updated COM method signatures.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/IXCLRData.cs Adds many new IXCLRData* interfaces and replaces void*/void** with typed parameters.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ICLRData.cs Adds ICLRDataTarget2 and ICLRDataTarget3 interface definitions.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataFrame.cs Updates IXCLRDataFrame / IXCLRDataFrame2 implementation signatures to match new interface definitions.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataMethodInstance.cs Updates method instance implementation signatures and related COM-pointer plumbing.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataModule.cs Updates module implementation signatures to match new interface definitions.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataTask.cs Updates task implementation signatures to match new interface definitions.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.IXCLRDataProcess.cs Updates process implementation signatures to match new interface definitions.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

Copy link
Copy Markdown
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR comments mention adding 14 new interfaces but some of the interfaces in that list already exist. For example: https://github.com/max-charlamb/runtime/blob/bb5c6c3425acf6f48d4d13521e6da1f5efe71b05/src/native/managed/cdacreader/src/Legacy/IXCLRData.cs#L346

Not a big deal, but it would be nice to get the right info there for posterity :)

Change AllocVirtual and FreeVirtual address parameters from ulong to
ClrDataAddress to match CLRDATA_ADDRESS in clrdata.idl.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@max-charlamb
Copy link
Copy Markdown
Member Author

/ba-g cDAC only change

@max-charlamb max-charlamb merged commit b6a3e78 into dotnet:main Feb 27, 2026
41 of 50 checks passed
@max-charlamb max-charlamb deleted the cdac-add-interfaces branch February 27, 2026 17:49
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants