Skip to content

Support additional GUID/CLSID declarations #5190

Open

Description

Description

Not all headers define GUIDs using the macros windows-clangs currently looks for to discern GUID facts. Some use EXTERN_GUID (defined in rpcndr.h), and some don't use a macro at all, declaring with a raw initializer list.

mfidl.h:

EXTERN_GUID( MF_PD_PMPHOST_CONTEXT, 0x6c990d31, 0xbb8e, 0x477a, 0x85, 0x98, 0xd, 0x5d, 0x96, 0xfc, 0xd8, 0x8a );
EXTERN_GUID( MF_PD_APP_CONTEXT, 0x6c990d32, 0xbb8e, 0x477a, 0x85, 0x98, 0xd, 0x5d, 0x96, 0xfc, 0xd8, 0x8a );

dxcapi.h:

CLSID_SCOPE const CLSID CLSID_DxcCompiler = {
    0x73e22d93,
    0xe6ce,
    0x47f3,
    {0xb5, 0xbf, 0xf0, 0x66, 0x4f, 0x39, 0xc1, 0xb0}};

// {EF6A8087-B0EA-4D56-9E45-D07E1A8B7806}
CLSID_SCOPE const GUID CLSID_DxcLinker = {
    0xef6a8087,
    0xb0ea,
    0x4d56,
    {0x9e, 0x45, 0xd0, 0x7e, 0x1a, 0x8b, 0x78, 0x6}};

Also consider GUIDs defined in terms of another.
dxcapi.h:

CLSID_SCOPE const GUID CLSID_DxcUtils = CLSID_DxcLibrary;

In all cases, these declarations get skipped over and don't end up in the rdl and consequently in the windows(-sys) bindings crate. I confirmed win32metadata contained these GUIDs in their winmd.

Request

Extend windows-clang’s GUID detection logic to support:

  1. EXTERN_GUID(...) macro expansions
  2. Raw GUID / CLSID declarations using initializer lists
  3. GUID / CLSID defined in terms of another

Activity

  1. jorge-ortega commented on Oct 22, 2026

    @jorge-ortega
    Author

    FWIWs, I had copilot take a shot at this. I've published a branch that implements the change and brings in way more GUIDs then I was expecting.

    Diff

  2. added
    windows-clang
    on Oct 22, 2026
  3. jorge-ortega commented on Oct 29, 2026

    @jorge-ortega
    Author

    The new clang backend picks up the previously missed GUID definitions.

    I tried out the new scrapper with dxcapi.h, and it also picks up the CLSIDs except for CLSID_DxcUtils.

    Unrelated, but I also noticed in strmif.rdl, the IID_IAMFilterGraphCallback GUID was added but the IAMFilterGraphCallback interface was removed.

  4. kennykerr commented on Nov 5, 2026

    @kennykerr
    Collaborator

    Confirmed with SDK 10.0.28000.2957: EXTERN_GUID and raw GUID/CLSID initializer lists now work. Keeping this open for the remaining CLSID_DxcUtils case: Clang reports that copying the non-constexpr CLSID_DxcLibrary is not a constant expression, so the current capture omits it rather than guessing a constant value.

    The IAMFilterGraphCallback omission is separate. strmif.h explicitly says its methods are not stdcall; UnableToRender uses the C++ member calling convention on x86. Its IID is captured, but the interface cannot be projected as ordinary COM without changing its ABI.

    The GUID cases are covered here:

    // #5190: `EXTERN_GUID` and raw initializer declarations publish their values. Copying a
    // non-constexpr GUID is C++ dynamic initialization, so it has no constant value to publish.
    #[test]
    fn guid_declarations() {
    let omissions = single("guid_declarations");
    assert_eq!(omissions.len(), 1, "{omissions:?}");
    assert_omitted(&omissions, "CLSID_DxcUtils");
    assert_omitted(&omissions, "not a constant expression");
    }

  5. changed the title [-]`windows-clang` Support additional GUID/CLSID declarations[/-] [+]Support additional GUID/CLSID declarations[/+] on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    windows-clang

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions