Skip to content

Add Debug Interface Access (DIA) SDK COM wrappers and tests - #7

Merged
JeremyKuhne merged 1 commit into
mainfrom
dia-sdk-interfaces
Jun 9, 2026
Merged

Add Debug Interface Access (DIA) SDK COM wrappers and tests#7
JeremyKuhne merged 1 commit into
mainfrom
dia-sdk-interfaces

Conversation

@JeremyKuhne

Copy link
Copy Markdown
Owner

Summary

Adds struct-based COM wrappers for the Debug Interface Access (DIA) SDK in the new Microsoft.VisualStudio.Debugging.DebugInterfaceAccess namespace, following the same pattern as the existing VS Setup interfaces: an IComIID struct with a nested [ComImport] Interface, a dual NETFRAMEWORK/static IID implementation, and delegate* unmanaged[Stdcall] vtable calls.

All 54 interfaces from dia2 are covered, plus the supporting enums (SymTagEnum, MemoryTypeEnum, CV_CPU_TYPE_e) and structs (DiaAddressMapEntry, DiaTagValue). Vtable indices were verified against dia2.h for every interface.

Details

  • Header-sourced documentation. Member summaries come from the DIA IDL helpstrings, parameter docs from the SAL annotations ([in]/[out, retval]/[size_is]) in dia2.h, and the IDiaSymbol boolean flags are enriched from the csymrow.h field comments in the DIA implementation sources.
  • Real COM types via CsWin32. IEnumUnknown, PROPSPEC, and IEnumSTATPROPSTG (the types not shipped by Madowaku) are generated through CsWin32 (NativeMethods.txt) and aggregate onto Madowaku's existing Windows.Win32 types. Per-struct IComIID polyfills are added under vsinterop/Windows/... for the net472 path, where CsWin32 does not emit the static-abstract IID.
  • CLASSID class with the DiaSource, DiaSourceAlt, and DiaStackWalker CLSIDs (verified from dia2.h).
  • Tests. Reference the Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles package for the native msdia140.dll binaries, copy the architecture-specific binaries next to the test assembly, and load the correct one directly via Madowaku's ComClassFactory. The tests exercise the full create → loadDataFromPdbopenSession → global scope / compiland / table pipeline against the test assembly's own PDB.

Validation

  • Library builds clean (0 warnings / 0 errors) on net10.0-windows, net10.0, and net472.
  • 11/11 tests pass on both net10.0-windows and net472.

Adds struct-based COM wrappers for the DIA SDK interfaces in the new

Microsoft.VisualStudio.Debugging.DebugInterfaceAccess namespace, following the

same pattern as the existing VS Setup interfaces (IComIID structs with a nested

[ComImport] Interface, dual NETFRAMEWORK/static IID, and delegate* vtable calls).

All 54 dia2 interfaces are covered, with vtable indices verified against dia2.h.

- Documentation is sourced from the DIA headers: IDL helpstrings drive member

  summaries, SAL annotations drive parameter docs, and csymrow.h field comments

  enrich the IDiaSymbol boolean flags.

- IEnumUnknown, PROPSPEC, and IEnumSTATPROPSTG are generated via CsWin32

  (NativeMethods.txt) and aggregated onto Madowaku; net472 IComIID polyfills are

  added for the generated COM structs.

- Adds a CLASSID class with the DiaSource, DiaSourceAlt, and DiaStackWalker CLSIDs.

- Tests load the architecture-appropriate msdia140.dll from the

  Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles package via Madowaku's

  ComClassFactory and exercise the load/session/symbol pipeline.
@JeremyKuhne
JeremyKuhne requested a review from Copilot June 9, 2026 02:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@JeremyKuhne
JeremyKuhne merged commit f37fd76 into main Jun 9, 2026
1 check passed
@JeremyKuhne
JeremyKuhne deleted the dia-sdk-interfaces branch June 9, 2026 02:24
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.

2 participants